1
\$\begingroup\$

I have a sprite that I want to use in my particle systems (it's just 4x4 white square). I'd also like for the particles to be lit (react to lighting within a scene).

Since I'm using 2D Toolkit, I simply created a new tk2d sprite collection of just the single texture, generating normals for it within the sprite collection settings, set the shader for the atlas0 material that's generated to LitBlendVertex and attached the atlas0 material to the particle system.

However, the particles are not reacting to light. I've tried different shaders (both Unity and tk2d) but to no avail. I also messed with the particle systems normal direction setting but still nothing.

Is there something I'm missing to get particles in a particle system to be lit?

\$\endgroup\$
1
\$\begingroup\$

Certain shaders don't react to light, and it's possible certain lights won't effect particles.

Make sure the light you're testing with is set to Auto or Important Render Mode.

Also make sure you're using a shader that gets affected by lighting. For performance reasons, none of the default particle shaders are affected by lighting but many are transparent and get affected by their background's lighting (i.e. Additive). For example, a water splash will take on the lighting of its background. If it's in a dark cave, the water splash will be a similar color, thus indirectly affected by lighting.

Do you think you can get away with that? If not, your best bet is to create your own shader.

\$\endgroup\$
  • \$\begingroup\$ I can confirm that the particular shader applied to the materials being used in the particle system does react to light, just not when used in particle systems; same material and shader combination used elsewhere in the scene react to light fine. \$\endgroup\$ – Cooper May 17 '15 at 17:21
  • \$\begingroup\$ Have you tested this with nothing in the background? Often, particle shaders cause the object to blend with its background so if something in the background is affected by light, the particle will be affected by light. \$\endgroup\$ – JPtheK9 May 17 '15 at 17:27
  • \$\begingroup\$ Just tried this, to no avail. \$\endgroup\$ – Cooper May 17 '15 at 17:40
  • \$\begingroup\$ Does additive soft work? Also, are you using Unity 5 because if not, we might have different default shaders. On a sidenote, you can try this shader I found: ryangatts.com/lit-particle-shaders.html. \$\endgroup\$ – JPtheK9 May 17 '15 at 18:02
-1
\$\begingroup\$

I had the same problem and was the fog. When i turn it off the particles show up again!

\$\endgroup\$
  • \$\begingroup\$ This answer would be even better if it showed where in the interface a user can go to switch off the fog as you describe. \$\endgroup\$ – DMGregory Oct 15 '18 at 14:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.