I have a custom geometry shader for grass that adds 4 vertices in the Geometry pass and I calculate shadow coordinates for each vertex using the vertex’s world position:
ShadowCoords = TransformWorldToShadowCoord(positionWS);
In the fragment shader, I get the Main Light from the ShadowCoords and use its shadow attenuation for lighting:
Light mainLight = GetMainLight(ShadowCoords);
float4 shadowAttenuation = mainLight.shadowAttenuation;
But for some reason it seems like the edges of each shadow cascade have the wrong shadow attenuation value: Screen capture - a0297f2ccd8b57288a948b1d67e6b596 - Gyazo
To make this easier to see, here is with the fragment shader just returning the shadowAttenuation value: Screen capture - 92341d33a83ca2e4331d44296d1088ea - Gyazo (sorry if the gif glitches out a bit!)
I’m not very experienced with writing shaders, so does anyone have any ideas what to do to resolve this?