• Unity
  • Possible to exclude shader from ambient lighting?

Hi there,
I don't see any way to achieve this and adding

#pragma noambient 

to the SpritePixelLit.shader didn't work either.

I would like to toggle a material/shader to not be affected by Unity's ambient lighting.
Could that be achieved somehow?

Related Discussions
...
  • Изменено

I'm afraid you will need to create your own modified copy of the Spine/Sprite/Pixel Lit shader. You can then include your modified version of CGIncludes/SpriteVertexLighting.cginc which omits (or replaces) the call to calculateAmbientLight() here:
spine-runtimes/SpritePixelLighting.cginc at 3.8

Same applies to the Spine/Sprite/Vertex Lit shader, just search for calculateAmbientLight.

Harald написал

I'm afraid you will need to create your own modified copy of the Spine/Sprite/Pixel Lit shader. You can then include your modified version of CGIncludes/SpriteVertexLighting.cginc which omits (or replaces) the call to calculateAmbientLight() here:
spine-runtimes/SpritePixelLighting.cginc at 3.8

Same applies to the Spine/Sprite/Vertex Lit shader, just search for calculateAmbientLight.

Thanks a bunch, as always, for the quick reply! :heart:
I will try this out!
Cheers!

You're welcome! 🙂