float3 fetch_eye_pos(float2 uv)
{
float z = tLinDepth.SampleLevel(samNearest, float3(uv, 0), 0);
return uv_to_eye(uv, z);
}
float3 fetch_eye_pos(float2 uv, sampler2D depthMap)
{
// tLinDepth.SampleLevel(samNearest, float3(uv, 0), 0);
//float4 depth = tex2D(depthMap,uv);
float f=750.0f; // adjust this to match fx.visibility from racer.ini
float n = 0.1f;
float z = (2 * n) / (f + n - tex2D( depthMap, float2(uv) ).z * (f - n));
return uv_to_eye(uv, z);
}
float3 rand=1.0f/1024.0f;
I'm gonna implement this as a feature as soon as possible.
I've gotta tell ya, i'm blown away by this SSAO stuff, it's absolutly amazing.
here is the fullscreen shader:
http://rapidshare.com/files/353374955/ssao_final.rar