- Timestamp:
- 12/07/08 23:26:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/combineSsao.cg
r3209 r3212 125 125 126 126 aoSample = tex2Dlod(ssaoTex, sampleTexCoord); 127 //sampleNorm = tex2Dlod(normalsTex, sampleTexCoord).xyz; 128 127 129 128 // check spatial discontinuity 130 129 // note: using the depth from the color texture is not 100% correct as depth was … … 136 135 spatialFactor = 1.0f / max(len, 1e-3f); 137 136 137 convergenceFactor = aoSample.y + 1.0f; 138 139 //sampleNorm = tex2Dlod(normalsTex, sampleTexCoord).xyz; 138 140 //normalFactor = max(step(.2f, dot(sampleNorm, centerNormal)), 1e-2f); 139 convergenceFactor = aoSample.y + 1.0f; 140 141 141 142 // combine the weights 142 143 w = convergenceFactor * convergenceFactor * spatialFactor;// * normalFactor; … … 232 233 return OUT; 233 234 } 234 235 236 /** Function combining image and indirect illumination buffer using a237 depth and normal aware discontinuity filter.238 */239 pixel SmoothSsao(fragment IN,240 uniform sampler2D ssaoTex)241 {242 pixel OUT;243 244 float4 ao = tex2Dlod(ssaoTex, float4(IN.texCoord, 0, 0));245 246 float4 dummy;247 const float xoffs = .5f / 1024.0f; const float yoffs = .5f / 768.0f;248 249 // get positions exactly between old texel centers250 dummy.x = tex2Dlod(ssaoTex, float4(IN.texCoord + float2(xoffs, 0), 0, 0)).y;251 dummy.y = tex2Dlod(ssaoTex, float4(IN.texCoord + float2(0, -yoffs), 0, 0)).y;252 dummy.z = tex2Dlod(ssaoTex, float4(IN.texCoord + float2(-xoffs, 0), 0, 0)).y;253 dummy.w = tex2Dlod(ssaoTex, float4(IN.texCoord + float2(0, yoffs), 0, 0)).y;254 255 const float m1 = min(dummy.x, dummy.y);256 const float m2 = min(dummy.z, dummy.w);257 258 ao.y = min(ao.y, min(m1, m2));259 260 return OUT;261 }
Note: See TracChangeset
for help on using the changeset viewer.