- Home /
Displaying a different shader ONLY where a spotlight hits an object.
Hi, I'm trying to figure out if it is possible to have objects display a different shader only where a spotlight is hitting them.
The idea is that the scene will be very dark, objects that are in the dark will use a dark purple toon shader with white outline. When ever one of the spotlights in my scene hits an object the illuminated area displays a normal shader like a simple diffuse.
Any help would be appreciated
Thanks!
Answer by jonas-echterhoff · Oct 12, 2010 at 08:39 AM
Why not write a single shader doing both? If you use forward rendering, add one path for the toon rendering, and on top of that, add one path rendering the spotlight, blending over the previous path.
Would anyone happen to have sample code that would do this? I'm an artist and don't have a lot of experience writing my own shaders.