I am trying to create a fog shader that uses height of a pixel in some of its calculations. I am using computeViewSpacePositionFromDepth from the ssao shader but it doesn’t seem to work for half of the screen. Here I sent its output directly to gl_fragColor. The whole screen should be cyan in this. It doesn’t seem to work for the top half of the screen.
Here is how I am calling it in the fragment shader:
"highp vec2 uv = vUv0; // variable_vertex.xy; // interpolated at pixel's center",
"float fogDepth = getLinearScreenDepth(uv);",
"vec3 uCameraView = computeViewSpacePositionFromDepth(uv,fogDepth);",