Changeset 3328
- Timestamp:
- 02/25/09 17:41:00 (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/shaderenv.h
r3327 r3328 5 5 //////////// 6 6 //-- ssao + gi parameters 7 #define NUM_PRECOMPUTED_SAMPLES 1007 #define NUM_PRECOMPUTED_SAMPLES 4096 8 8 //#define NUM_SAMPLES 8 9 9 //#define NUM_SAMPLES 16 10 10 //#define NUM_SAMPLES 24 11 #define NUM_SAMPLES 811 #define NUM_SAMPLES 48 12 12 13 13 //#define MIN_SAMPLES 48 … … 61 61 #define NUM_DOF_TABS 16 62 62 63 //#define USE_GTX63 #define USE_GTX 64 64 65 65 #define SSAO_FILTER_RADIUS 5 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/combineSsaoSep.cg
r3327 r3328 192 192 { 193 193 // the filtered ssao value 194 //OUT.illum_col.x = FilterXY(IN.texCoord, ssaoTex, colorsTex, bl, br, tl, tr, xyStep, convergence, maxConvergence, spatialWeight);194 OUT.illum_col.x = FilterXY(IN.texCoord, ssaoTex, colorsTex, bl, br, tl, tr, xyStep, convergence, maxConvergence, spatialWeight); 195 195 } 196 196 … … 232 232 { 233 233 // the filtered ssao value 234 //ao.x = FilterXY(IN.texCoord, ssaoTex, colorsTex, bl, br, tl, tr, xyStep, convergence, maxConvergence, spatialWeight);234 ao.x = FilterXY(IN.texCoord, ssaoTex, colorsTex, bl, br, tl, tr, xyStep, convergence, maxConvergence, spatialWeight); 235 235 } 236 236 … … 241 241 if (depth < DEPTH_THRESHOLD) 242 242 { 243 //OUT.illum_col.xyz = col.xyz * max(minAO, 1.0f - ao.x);244 OUT.illum_col.xyz = max(minAO, 1.0f - ao.x);243 OUT.illum_col.xyz = col.xyz * max(minAO, 1.0f - ao.x); 244 //OUT.illum_col.xyz = max(minAO, 1.0f - ao.x); 245 245 } 246 246 else -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg
r3326 r3328 253 253 254 254 // retrieve the sample from the last frame 255 const float4 oldPixel = tex2Dlod( myTex, float4(oldTexCoords, .0f, .0f));256 const float oldDiff = tex2Dlod( oldTex, float4(oldTexCoords, .0f, .0f)).x;255 const float4 oldPixel = tex2Dlod(oldTex, float4(oldTexCoords, .0f, .0f)); 256 const float oldDiff = tex2Dlod(myTex, float4(oldTexCoords, .0f, .0f)).x; 257 257 258 258 // calculate eye space position of sample in old frame … … 272 272 273 273 // check if the pixel belonged to a dynamic object in the last frame 274 const bool newDynamic = (squaredLen > 100000);//DYNAMIC_OBJECTS_THRESHOLD);275 const bool oldDynamic = (oldDiff > 1000000);//DYNAMIC_OBJECTS_THRESHOLD);274 const bool newDynamic = (squaredLen > DYNAMIC_OBJECTS_THRESHOLD); 275 const bool oldDynamic = (oldDiff > DYNAMIC_OBJECTS_THRESHOLD); 276 276 277 277 … … 306 306 } 307 307 308 //isPixelValid = 2e20f;309 308 return float2(isPixelValid, abs(oldEyeSpaceDepth - projectedEyeSpaceDepth)); 310 309 } -
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.