Question by
Syriph · May 09, 2020 at 05:18 PM ·
shadershadowsshader programmingshader writinggeometry shader
Geometry shader double sided leaf, shadows projected on both sides.
I am trying to write a leaf geometry shader using just two passes one for lighting of the leaves, and the other for casting shadows. I am using VFACE to flip the leaf normal's in my fragment shader and everything works, apart from any shadows being received on a leaf, being projected onto both sides of the leaves. Does anyone know a way I can have shadows only show up on the sides I actually want them too? I am currently Setting each vertex's _ShadowCoord property to their screen position in the geometry shader and then using SHADOW_ATTENUATION() to get the shadows. but obviously this means that I get shadows on both sides of the leaf.
Any solution ideas would be appreciated.
Comment