@@ -266,7 +266,8 @@ float4 GetAO(float2 coords)
266266 float3 ilum;
267267 float3 scatter;
268268 float fade = smoothstep (DEPTH_AO_FADE_END - DEPTH_AO_FADE_START, 0.0 , pointnd.w - DEPTH_AO_FADE_START);
269- //float zoomfactor = pow((1.0 - pointnd.w) * fade, 2); // Not being used right now. Could use later to compress taps that are far in the distance.
269+ float zoomfactor = pow ((1.0 - pointnd.w) * fade, 2 ); // Not being used right now. Could use later to compress taps that are far in the distance.
270+ zoomfactor = max (zoomfactor, 0.5 );
270271 float3 tapeyevector;
271272
272273 #if DEPTH_AO_USE_MANUAL_RADIUS
@@ -304,9 +305,9 @@ float4 GetAO(float2 coords)
304305 randomvector = Rotate90 (randomvector);
305306 #endif
306307 #if DEPTH_AO_USE_TIMED_NOISE
307- float2 tapcoords = coords + pixelradius * randomvector * (0.5 + GetRandomT (coords)) * (p + 1 ) / depth_passes;
308+ float2 tapcoords = coords + pixelradius * randomvector * zoomfactor * (0.5 + GetRandomT (coords)) * (p + 1 ) / depth_passes;
308309 #else
309- float2 tapcoords = coords + pixelradius * randomvector * (p + 1 ) / depth_passes;
310+ float2 tapcoords = coords + pixelradius * randomvector * zoomfactor * (p + 1 ) / depth_passes;
310311 #endif
311312
312313 float4 tapnd = tex2Dlod (SamplerND, float4 (tapcoords, 0 , miplevel));
@@ -594,11 +595,11 @@ float4 PS_AOCombine(float4 vpos : SV_Position, float2 texcoord : TEXCOORD) : COL
594595 ret.rgb = lerp (ret.rgb + il, ret.rgb * (1.0 + il), dot (ret.rgb, 0.3333 ));
595596
596597 if (DEPTH_AO_DEBUG == 1 )
597- ret.rgb = ao * DEPTH_AO_STRENGTH ;
598+ ret.rgb = 0.75 + (ret.rgb * 0.25 ) - ao ;
598599 else if (DEPTH_AO_DEBUG == 2 )
599- ret.rgb = il;
600+ ret.rgb = ret.rgb * 0.25 + il;
600601 else if (DEPTH_AO_DEBUG == 3 )
601- ret.rgb = 0.3 + il - ao;
602+ ret.rgb = ret.rgb * 0.3 + il - ao * 0.3 ;
602603
603604 return saturate (ret);
604605}
0 commit comments