Projection is fine, as long coordinates in x, y, z are all relative to each other.
mul(_LightMatrix0,float4( worldPos, 1)) in the forward pipeline gets me coordinates that are all proportional to the range of the spotlight.
Forward Shader logic (In ForwardAdd pass of the fragment shader)
#ifdef SPOT
return mul(_LightMatrix0,float4( worldPos, 1));
#endif
(This I can use, since the x, y and x values are all normalized and can be compared to each other to get angles)
mul(_LightMatrix0, float4(wpos, 1)) * -1 in the deferred pipeline gets me coordinates that are all proportional to the angle of the spotlight, or, a projection in other words. In addition, I have to multiply the result by -1.
Deferred Shader logic (In CalculateLight() of Internal-DeferredShading)
float4 lightSpacePos = mul(_LightMatrix0, float4(wpos, 1));
return half4(lightSpacePos.x, lightSpacePos.y, 0, 0) * -1;
(This I can’t use, I can use the x, y coordinates to get angle yes, but without the spot angle of the light I have no way of comparing z against the x, y coordinates)
See the attached image. Left quad = lit w/ a deferred pipeline, Right quad = lit w/ a forward pipeline. Both of them use lighting shaders that simply return the bolded code snippets as colours (light-space coordinates) if the matrix was identical, I’d expect there to be no seam/differences between the quads.