Change material if in shadow, like in the gif animation

Do this bit in the post process, where you have access to the shadows and stencils. Then you can control the threshold by how shadowed the area is.


Here I’m figuring how shadowed an area is by comparing the base color vs the final render.
Then I’m using this to lerp between two thresholds for a step, turning the image black and white. In this case I’m using a fixed set of thresholds, but you could set them per object by reading your stencil value. Then I’m colorizing it (in this case just with the original basecolor, but once again this could be done by stencil.

Here’s a closeup of where the shadow mask is changing the threshold.

1 Like