Hey, so I’m kind of new to geometry shaders. I’ve been experimenting with this grass shader, and I’ve gotten shadows to work, sort of.

As you can see, shadows go “through” the geometry.

In my geometry shader I do this.
TRANSFER_SHADOW(o);
Where o is a custom struct geometryOutput
struct geometryOutput {
float4 pos : SV_POSITION;
float3 uv : TEXCOORD0;
float3 pos_ws : TEXCOORD1;
unityShadowCoord4 _ShadowCoord : TEXCOORD2;
};
And then in my fragment shader I sample it like so
float atten = SHADOW_ATTENUATION(i) + 1;
atten /= 2;
I have run into this issue before when working with unlit shaders, but that was solved by using a fallback to vertexLit (So I’m assuming something is missing here that “writes” to the shadows, so to speak)
I have tried implementing a ShadowCollector pass, but that hasn’t given any effect. Altough that might be because I don’t really understand ShadowCollector passes and haven’t found any resources regarding them.
So… is the ShadowCollector pass what’s needed here, or is there something else?