- Timestamp:
- 02/25/09 17:41:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
r3327 r3328 179 179 sampler2D colors, 180 180 sampler2D noiseTex, 181 //float2 samples[NUM_PRECOMPUTED_SAMPLES],182 181 sampler2D samples, 183 182 float3 normal, … … 211 210 //-- (affects performance for some reason!) 212 211 213 if ( 1)//convergence < SSAO_CONVERGENCE_THRESHOLD)212 if (convergence < SSAO_CONVERGENCE_THRESHOLD) 214 213 { 215 214 float2 mynoise = tex2Dlod(noiseTex, float4(IN.texCoord * 4.0f, 0, 0)).xy; … … 274 273 // to the current pixel or if the angle is small enough 275 274 // to have any influence in the current or last frame 276 #if 0275 #if 1 277 276 const float tooFarAway = step(0.5f, lengthToSample - changeFactor); 278 277 279 278 const float partlyResetThres = 1.0f; 280 if ( 0)//pixelValid <= partlyResetThres)279 if (pixelValid <= partlyResetThres) 281 280 validSamples = max(validSamples, pixelValid * (1.0f - tooFarAway) * step(-0.1f, cosAngle)); 282 281 else … … 295 294 // (=> there was no discontinuity recently) 296 295 //else if (isMovingObject && (convergence > SSAO_CONVERGENCE_THRESHOLD)) break; 297 //else if (isMovingObject && (convergence > NUM_SAMPLES * 5)) break;296 else if (isMovingObject && (convergence > NUM_SAMPLES * 5)) break; 298 297 } 299 298 #endif … … 407 406 // or if the angle is small enough 408 407 // to have any influence in the current or last frame 409 #if 0408 #if 1 410 409 const float partlyResetThres = 1.0f; 411 410 … … 456 455 uniform sampler2D noiseTex, 457 456 uniform sampler2D samples, 458 //uniform float2 samples[NUM_PRECOMPUTED_SAMPLES],459 457 uniform sampler2D oldTex, 460 458 uniform float4x4 modelViewProj, … … 513 511 514 512 const float oldSsao = temporalVals.x; 515 const float oldWeight = temporalVals.y; 516 const float oldIdx = 0;//temporalVals.z; 513 514 float oldWeight = temporalVals.y; 515 float oldIdx = temporalVals.z; 517 516 518 517 float3 ao; … … 551 550 552 551 // don't check for moving objects, otherwise almost no coherence 553 /*if (!isMovingObject)552 if (!isMovingObject) 554 553 { 555 554 if (ao.y > completelyResetThres) … … 560 559 else if (ao.y > partlyResetThres) 561 560 { 562 //oldWeight = min(oldWeight, 4.0f * newWeight);563 oldWeight = .0f;564 oldIdx = .0f;565 } 566 } */561 oldWeight = min(oldWeight, 4.0f * newWeight); 562 //oldWeight = .0f; 563 //oldIdx = .0f; 564 } 565 } 567 566 568 567 … … 586 585 //OUT.illum_col.z = SqrLen(diffVec); 587 586 588 //OUT.illum_col.xyz = normal.xyz;589 587 return OUT; 590 588 }
Note: See TracChangeset
for help on using the changeset viewer.