Fix particle system with unlit mesh emitter #7795
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, mesh particle emitters with
lighting: false
will not render in either WebGL2 or WebGPU. For a repro, look at https://playcanvas.vercel.app/#/graphics/particles-mesh and toggle thelighting
option.I think the main issue is that we are using the
NORMAL
define as a proxy for whether to use lighting, but in the case of an unlit mesh we do want mesh normals, we just don't want that mesh to be shaded.This PR restores rendering for unlit mesh emitters by:
Try the latest preview deployment on this PR and you will see that now, on the particles-mesh example, particles are still rendered when
lighting
is off. We can also see that the shading on those particles is flat. If you reduce the directional light intensity to 0.01 in this scene, you will see that the particles are not affected by the light whenlighting
is off.I confirm I have read the contributing guidelines and signed the Contributor License Agreement.