urp-ssao
urp-ssao copied to clipboard
found error in ssao:
Watch out, there is an error in the ssao.shader
inside the frag()
function:
float3 random = normalize( tex2D(_RandomTexture, input.uv * 4.123).rgb );
This has range of [0, 1]
You need to expand the range to [-1,1] which is what the original post contained, like so:
float3 random = tex2D(_RandomTexture, input.uv).rgb;
random = normalize(random*2-1); //NOTICE: normalize AFTER the expansion.
You also need to ensure your texture contains RGB color noise (not black-and-white monochrome)