- Home /
How to modify shadows with an image effect
I want to get the shadows in the scene in an image effect shader (vert/frag) and modify just the shadows/shaded faces with an effect.
I know I have to include #include "AutoLight.cginc" and that will have what I need but after trying a bunch of old forum posts I can only get solid white or black pixels covering the whole screen. (I know forward lighting is required).
I would like to get the pixel coordinates/color of just the shadows from whatever pass happens before my image effect so I can apply a effect to just the shadowed area.
Where should I start?
There's no real way to directly access the shadows directly without using command buffers and making individual copies of every light's shadowmap. Ins$$anonymous$$d, I would say it's easier to re-render the scene from the camera's perspective with a replacement shader that only returns 1 when lit or 0 when in shadow, save that result to a rendertexture and pass it to your effect that way.