Hey, I’m experimenting with custom light in my graph, it works ok, but I get some strange glitches in the shadows when the light changes.

Heres the graph:
And the code in the custom function goes like this:
void LWRPLightingFunction_float (float3 ObjPos, out float3 Direction, out float3 Color, out float ShadowAttenuation)
{
#ifdef LIGHTWEIGHT_LIGHTING_INCLUDED
//Actual light data from the pipeline
Light light = GetMainLight(GetShadowCoord(GetVertexPositionInputs(ObjPos)));
Direction = light.direction;
Color = light.color;
ShadowAttenuation = light.shadowAttenuation;
#else
//Hardcoded data, used for the preview shader inside the graph where light functions are not available
Direction = float3(-0.5, 0.5, -0.5);
Color = float3(1, 1, 1);
ShadowAttenuation = 0.4;
#endif
}
Is there something obvious I’m missing in order for this to work a little bit better?
