- Timestamp:
- 11/12/08 13:05:11 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp
r3121 r3122 535 535 sCgSsaoProgram->SetValue1f(i ++, (mUseTemporalCoherence && !mRegenerateSamples) ? tempCohFactor : 0); 536 536 537 if (//mUseTemporalCoherence || 538 mRegenerateSamples) 537 if (mUseTemporalCoherence || mRegenerateSamples) 539 538 { 540 539 mRegenerateSamples = false; -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h
r3120 r3122 6 6 //-- ssao + gi parameters 7 7 8 #define NUM_SAMPLES 89 //#define NUM_SAMPLES 168 //#define NUM_SAMPLES 8 9 #define NUM_SAMPLES 16 10 10 11 11 // for quadratic falloff 12 12 //#define SAMPLE_INTENSITY 0.1f 13 #define SAMPLE_INTENSITY 0.07f14 //#define SAMPLE_INTENSITY 0.03f13 //#define SAMPLE_INTENSITY 0.07f 14 #define SAMPLE_INTENSITY 0.03f 15 15 16 16 #define SAMPLE_RADIUS 8e-1f -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/combineSsao.cg
r3120 r3122 86 86 //sampleNorm = tex2Dlod(normalsTex, offs).xyz; 87 87 88 w = filterWeights[i] * max(dot(sampleNorm, norm), .0f) * depthFactor;88 w = filterWeights[i] * max(dot(sampleNorm, norm), 1e-3f) * depthFactor; 89 89 90 90 average += aoSample.x * w; … … 113 113 if ((ao.y < 60.0f) && (col.w < 1e10f)) 114 114 { 115 const static float scaleFactor = 10.0f;115 const static float scaleFactor = 20.0f; 116 116 117 117 //ao.x = Filter(IN.texCoord, ssaoTex, filterOffs, filterWeights); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
r3121 r3122 185 185 //float overallDepth = 0; 186 186 const float squaredLen = diffVec.x * diffVec.x + diffVec.y * diffVec.y + diffVec.z * diffVec.z; 187 187 188 #if 1 188 189 if (squaredLen < 1e-8f) // object not dynamic … … 208 209 #endif 209 210 210 //const float oldWeight = clamp(oldPixel.y, .0f, temporalCoherence);211 float oldWeight = oldPixel.y;211 //const float clampedOldWeight = clamp(oldPixel.y, .0f, temporalCoherence); 212 const float oldWeight = oldPixel.y; 212 213 213 214 float newWeight; … … 219 220 // if visibility changed in the surrounding area we have to recompute 220 221 //&& (oldNumSamples > 0.8f * newNumSamples) 221 //&& (notValid < 1.0f)222 && (notValid < 1.0f) 222 223 ) 223 224 { 224 225 // increase the weight for convergence 225 226 newWeight = oldWeight + 1.0f; 226 if (notValid > 1.0f) newWeight = 2.0f;227 //if (notValid > 1.0f) newWeight = 2.0f; 227 228 } 228 229 else … … 231 232 } 232 233 233 if (oldPixel.y >= temporalCoherence) 234 newWeight = min(temporalCoherence+1, max(oldPixel.y - 70, 50)); 234 //if (oldPixel.y >= 2000) 235 // newWeight = min(temporalCoherence + 1, max(oldPixel.y - 70, 50)); 236 if (newWeight >= 2000) newWeight = 1000; 235 237 236 238 return float3(oldPixel.x, newWeight, eyeSpaceDepth); … … 379 381 const float newWeight = temporalVals.y; 380 382 381 float2 noiseOffs = float2(newWeight / 256.0f, (newWeight - 256.0f) / 192.0f); 383 //float2 noiseOffs = float2(newWeight / 139.0f, newWeight / 141.0f); 384 float2 noiseOffs = float2(.0f); 382 385 383 386 float2 ao; 387 384 388 // note: this should be done with the stencil buffer 385 389 if (eyeSpaceDepth < 1e10f) … … 393 397 } 394 398 395 396 OUT.illum_col.x = (ao.x + oldSsao * (newWeight - 1.0f)) / newWeight; 399 const float clampedWeight = clamp(newWeight, 1, temporalCoherence); 400 401 OUT.illum_col.x = (ao.x + oldSsao * (clampedWeight - 1.0f)) / clampedWeight; 397 402 OUT.illum_col.y = newWeight; 398 403 OUT.illum_col.z = invw;
Note: See TracChangeset
for help on using the changeset viewer.