I am finishing up my water shader and am trying to get shadows on top of it. I found out if the render queue is set to transparent then it will not recieve shadows, so I set it to:
Tags { “RenderType” = “Transparent” “Queue” = “Geometry+1”}
Problem is the shader throws an error about ComputeScreenPos:
Out.scrPos = ComputeScreenPos(Out.position);
invalid subscript ‘pos’ ‘ComputeScreenPos’: no matching 1 parameter function at line 224
Line 224 holds the Transfer shadow function:
TRANSFER_VERTEX_TO_FRAGMENT(Out);
When the Queue is set to transparent it all seems to work (without shadows of course) Am I missing something with the render queue and compute screen pos?
If you need more information like code snippets please do not hesitate to ask
Oh I am also using grab pass to gain refraction under the surface of the shader, will the change of queue from “Transparent” to “Geometry+1” be the reason affecting this?
i.e. vertex instead of position and your outputting vertex position must be named pos the function throws an error. Seems a bit odd but Unity is full of quirky things