Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/scene/particle-system/particle-material.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Comment thread
mvaligursky marked this conversation as resolved.
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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/scene/shader-lib/programs/particle.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down