Hi, I am trying to implement a Custom Post Process volumetric rays shader in URP that in order to work needs the light position in screen space.
For every pixel the shader marches to the light source and sees if that pixel would be occluded or not, and specifically the ratio of free and occluded space to determine the darkness of that pixel (the volumetric ray).
I am not an expert in shader coding, but for what I know in order to get the light position in screen space I would need to get the light world position (that for the main light can be “calculated” as _LightDirection*_ProjectionParams.z, hence as a point infinitely far in that direction) and then multiply it by UNITY_MATRIX_VP, which for what i understand is the same thing that is done on each vertex in the vertex shader to transform it into clip space.
Yet the result does not seem to work, am I missing something?
This is the implementation I am following: Chapter 13. Volumetric Light Scattering as a | NVIDIA Developer
I hope I made myself clear