diff --git a/src/scene/particle-system/particle-material.js b/src/scene/particle-system/particle-material.js index c2c0e46664f..3fc1f1474c5 100644 --- a/src/scene/particle-system/particle-material.js +++ b/src/scene/particle-system/particle-material.js @@ -44,7 +44,8 @@ class ParticleMaterial extends Material { defines: ShaderUtils.getCoreDefines(this, params), pass: SHADER_FORWARD, useCpu: this.emitter.useCpu, - normal: emitter.lighting ? ((emitter.normalMap !== null) ? 2 : 1) : 0, + lighting: emitter.lighting, + normal: emitter.lighting ? ((emitter.normalMap !== null) ? 2 : 1) : (this.emitter.useMesh ? 1 : 0), halflambert: this.emitter.halfLambert, stretch: this.emitter.stretch, alignToMotion: this.emitter.alignToMotion, diff --git a/src/scene/shader-lib/glsl/chunks/particle/frag/particle-shader.js b/src/scene/shader-lib/glsl/chunks/particle/frag/particle-shader.js index e2d5c59100b..86e21ade0c4 100644 --- a/src/scene/shader-lib/glsl/chunks/particle/frag/particle-shader.js +++ b/src/scene/shader-lib/glsl/chunks/particle/frag/particle-shader.js @@ -39,7 +39,7 @@ export default /* glsl */` #include "particle_normalMapPS" #endif - #if NORMAL != NONE + #if LIGHTING && NORMAL != NONE #ifdef HALF_LAMBERT #include "particle_halflambertPS" #else diff --git a/src/scene/shader-lib/programs/particle.js b/src/scene/shader-lib/programs/particle.js index 860486ef439..b7105c33bac 100644 --- a/src/scene/shader-lib/programs/particle.js +++ b/src/scene/shader-lib/programs/particle.js @@ -54,6 +54,7 @@ class ShaderGeneratorParticle extends ShaderGenerator { const fDefines = new Map(options.defines); if (options.soft > 0) fDefines.set('SOFT', ''); + if (options.lighting) fDefines.set('LIGHTING', ''); if (options.halflambert) fDefines.set('HALF_LAMBERT', ''); fDefines.set('NORMAL', normalTypeNames[options.normal]); diff --git a/src/scene/shader-lib/wgsl/chunks/particle/frag/particle-shader.js b/src/scene/shader-lib/wgsl/chunks/particle/frag/particle-shader.js index f944ec3adf5..7c91d4b58d6 100644 --- a/src/scene/shader-lib/wgsl/chunks/particle/frag/particle-shader.js +++ b/src/scene/shader-lib/wgsl/chunks/particle/frag/particle-shader.js @@ -42,7 +42,7 @@ export default /* wgsl */` #include "particle_normalMapPS" #endif - #if NORMAL != NONE + #if LIGHTING && NORMAL != NONE #ifdef HALF_LAMBERT #include "particle_halflambertPS" #else