Changeset 3345 for GTP/trunk/App
- Timestamp:
- 04/13/09 17:08:51 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp
r3343 r3345 821 821 // read the second buffer, write to the first buffer 822 822 mIllumFbo->Bind(); 823 glDrawBuffers( 2, mrt + mIllumFboIndex);823 glDrawBuffers(1, mrt + mIllumFboIndex); 824 824 825 825 int i = 0; -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg
r3341 r3345 254 254 // retrieve the sample from the last frame 255 255 const float4 oldPixel = tex2Dlod(oldTex, float4(oldTexCoords, .0f, .0f)); 256 const float oldDiff = tex2Dlod(myTex, float4(oldTexCoords, .0f, .0f)).x; 256 //const float oldDiff = tex2Dlod(myTex, float4(oldTexCoords, .0f, .0f)).x; 257 const float oldDiff = tex2Dlod(myTex, float4(oldTexCoords, .0f, .0f)).z; 257 258 258 259 // calculate eye space position of sample in old frame … … 338 339 const float3 normal = normalize(tex2Dlod(normalsTex, float4(IN.texCoord, 0, 0)).xyz); 339 340 340 //#ifdef PERFORMANCE_TEST 341 #if 1 341 #ifdef PERFORMANCE_TEST 342 342 // do reprojection and filter out the pixels that are not save 343 343 const float2 pValid = PixelValid(oldTex, … … 353 353 ); 354 354 #else 355 const float2 pValid = float2(0, 0);355 const float2 pValid = float2(0, 0); 356 356 #endif 357 357 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
r3344 r3345 20 20 { 21 21 float4 illum_col: COLOR0; 22 float4 col: COLOR1;22 //float4 col: COLOR1; 23 23 }; 24 24 … … 117 117 const float oldEyeSpaceDepth = oldPixel.w; 118 118 119 // vector from eye pos to old sample 119 // vector from eye pos to old sample 120 120 const float3 viewVec = Interpol(oldTexCoords, oldbl, oldbr, oldtl, oldtr); 121 121 const float invLen = 1.0f / length(viewVec); … … 148 148 149 149 //w = ComputeConvergence(oldTex, oldTexCoords, float2(1024.0f, 768.0f)); 150 w = oldPixel.y; 150 w = floor(oldPixel.y); 151 //w = oldPixel.y; 151 152 idx = floor(oldPixel.z); 152 153 153 } 154 154 else 155 155 { 156 w = 0.0f;156 w = .0f; 157 157 idx = .0f; 158 158 } … … 501 501 #ifdef PERFORMANCE_TEST 502 502 503 float3 diffVec = tex2Dlod(attribsTex, float4(IN.texCoord, 0, 0)).xyz;503 float3 diffVec = tex2Dlod(attribsTex, float4(IN.texCoord, .0f, .0f)).xyz; 504 504 505 505 const float sqrMoveSpeed = SqrLen(diffVec); … … 521 521 const float oldSsao = temporalVals.x; 522 522 523 float oldWeight = temporalVals.y; 524 float oldIdx = temporalCoherence > 1 ? temporalVals.z : 0; 525 523 float oldIdx = temporalCoherence > 1 ? temporalVals.y : .0f; 524 //float oldWeight = temporalVals.y; 525 float oldWeight = clamp(oldIdx, 0, temporalCoherence); 526 526 527 #else 527 528 528 529 const bool isMovingObject = false; 529 const float oldSsao = 0;530 531 float oldWeight = 0;532 float oldIdx = 0;530 const float oldSsao = .0f; 531 532 float oldWeight = .0f; 533 float oldIdx = .0f; 533 534 534 535 #endif … … 582 583 else if (ao.y > partlyResetThres) 583 584 { 584 oldWeight = min(oldWeight, 4.0f * newWeight); 585 //oldWeight = .0f; 586 //oldIdx = .0f; 585 oldWeight = min(oldWeight, 4.0f * NUM_SAMPLES); oldIdx = oldWeight; 586 //oldWeight = .0f; oldIdx = .0f; 587 587 } 588 588 } … … 596 596 597 597 // the new weight for the next frame 598 const float combinedWeight = clamp(newWeight + oldWeight, .0f, temporalCoherence); 599 600 OUT.illum_col.y = combinedWeight; 601 OUT.illum_col.z = oldIdx + newWeight; // the new index 598 const float newIdx = newWeight + oldIdx; 599 //const float combinedWeight = clamp(newIdx, .0f, temporalCoherence); 600 const float combinedWeight = clamp(newIdx, .0f, min(newWeight + oldWeight, temporalCoherence)); 601 602 //OUT.illum_col.y = combinedWeight; 603 OUT.illum_col.y = newIdx; // the new index 602 604 OUT.illum_col.w = eyeSpaceDepth; 603 605 … … 605 607 606 608 // this value can be used to check if this pixel belongs to a moving object 607 OUT.col.x = SqrLen(diffVec);608 //OUT.illum_col.z = SqrLen(diffVec);609 //OUT.col.x = SqrLen(diffVec); 610 OUT.illum_col.z = SqrLen(diffVec); 609 611 610 612 #else -
GTP/trunk/App/Demos/Vis/FriendlyCulling/toto.txt
r3344 r3345 223 223 fix shadows! 224 224 make images with / without filter 225 use nicer buddha 226 227 make samplingstrategy different: poisson has same status as halton, 228 use one of both (parent class randomsampler)
Note: See TracChangeset
for help on using the changeset viewer.