Extract Shadows and use as Mask
Hey so i'm trying to figure out how i can extract the shaded part of a object and use it as a mask to lerp between two textures. So when it's in darkness it uses one texture and when it's in light it uses another texture.
Anyone have any idea how i could do this? Thanks.
asked Jan 29 '17 at 03:15 PM in Rendering
Shortly speaking, you can't do that. There is no shadow information at stage where your material is being processed.
A typical workaround is to render a depth capture into a render target from your light's perspective, and use it in object's material to determine if this part is shadowed or not, though this is a bit more advanced.
answered Jan 29 '17 at 09:05 PM
Hm, not sure if this would solve your problem but you might be able to use the "PrecomputedAOMask" node in the material editor. This would allow you to mask out your shaded areas with other textures using the scene's AO. But this would require lightmaps and would not work on anything movable.
To use this, you first need to enable "Use Ambient Occlusion" and " Generate Ambient Occlusion Material Mask" in the World settings before adding the node to your material.
answered Mar 17 '17 at 01:40 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here