- Home /
URP (2D) Lit Particle Material - Color from Particle System?
Hello. I am trying to create a particle effect using the Texture Sheet Animation feature with a little sprite sheet I'd done up and loaded into a material, that interacts with the Universal RP + 2D renderer and lighting. The sprite sheet was originally done in pure white, so that I would be able to fill in the color using the Particle System itself. However, when using Universal Render Pipeline/Particles/Lit
or UniversalRenderPipeline/Particles/Simple Lit
, the material doesn't end up being rendered with the color of the Particle System
, even though I've set Color Mode
to Color
.
In its shortest form, my question seems to be:
Can I use the Lit/Simple Lit materials and correctly provide the color through the particle system while also interacting with 2D lighting in the URP?
If not, is there any reason I'd want to avoid using the Sprite-Lit-Default material for a particle system, or should I prefer just using the Unlit particle material?
I did eventually figure out (while writing this question) that using the Universal Render Pipeline/Particles/Unlit
shader for my particle material resulted in the desired behavior (sans interaction with 2d lighting?), which is probably good enough for the project I'm working on, but I figured I'd still leave this question up in case there is a known way to accomplish this with the Lit or Simple Lit shaders, or in any way that would interact with the URP's 2D lighting system (or -- in case someone knows that this specifically can't be done).
Using Universal Render Pipeline/2D/Sprite-Lit-Default
also seems to work but... well basically, I assume that the particle shaders are there for a reason? Or maybe that is the best way forward if I want colored particles to be lit?
I extracted this behavior into a fairly minimal project. Below are some screenshots of my setup, but the full project has also been uploaded to a github repo here. I tried my best to follow the docs for setting up a 2D URP project here, and used the docs for the URP Shaders and Materials here.
Here is my setup (apologies for the hacky image):
Here is the result:
I was unable to reproduce in URP version 10.2.2. What happens if you upgrade/downgrade URP versions?