0
\$\begingroup\$

I am trying to make it so the sprites in my scene are affected by lighting, but I cannot figure out how. I looked it up, and everywhere I looked, I was told to switch the sprite's material from "Sprite-Unlit-Default" to "Sprite-Lit-Default." According to what I had heard, assuming my scene had no lights, all of the sprites should have turned completely black, but instead, all of the sprites remained completely unchanged. I then tried creating my own lit material, by creating a material and setting the shader to Universal Render Pipeline > 2D > Sprite Lit Default, but again, nothing happened once I applied it to the sprites. Here is a screenshot of the situation, the Sprite-Lit-Default material is attached to all three sprites:

enter image description here

Does anyone know why this is happening, or what is even happening in the first place, and how I can fix it? Any help you can give is much appreciated. Thanks! (I'm still relatively new to Unity and URP, so the solution may very well be extremely simple.)

\$\endgroup\$
0

1 Answer 1

2
\$\begingroup\$

Possibly, your sprites won't turn black because of ambient light. If it's at 1.0 then sprites won't look any different than when rendered with the base shader.

Just in case, make sure you configured the URP 2DRenderer for use with the 2D lighting package, and upgraded prefabs and scenes if needed.

You can also use masks and normal maps for sprites to achieve a nice look for lights affecting your game objects. Many parameters are exposed for 2D lights to customise their behaviour.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .