Changeset 3297 for GTP/trunk/App/Demos/Vis/FriendlyCulling
- Timestamp:
- 02/11/09 01:52:36 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env
r3292 r3297 107 107 useFullScreen=0 108 108 109 # the used render method (forward, forward + depth pass, deferred, deferred + depth pass 109 # the used render method (forward, forward + depth pass, deferred, deferred + depth pass) 110 110 #renderMethod=2 111 111 renderMethod=0 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp
r3296 r3297 652 652 #else 653 653 654 /** star filter 655 */ 654 656 void DeferredRenderer::PrepareSsaoFilter() 655 657 { … … 662 664 const float yoffs = (float)filterWidth / mHeight; 663 665 664 for (int i = 0; i < NUM_SSAO_FILTER_SAMPLES / 2; ++ i) 665 { 666 float x = xoffs * (i - NUM_SSAO_FILTER_SAMPLES / 4); 667 float y = 0; 666 const int n = NUM_SSAO_FILTER_SAMPLES / 2 + 1; 667 668 for (int i = 0; i < n; ++ i) 669 { 670 const int idx = i - NUM_SSAO_FILTER_SAMPLES / 4; 671 672 const float x = xoffs * (float)idx; 673 const float y = 0; 668 674 669 675 ssaoFilterWeights[i] = GaussianDistribution(x, y, 1.0f); 670 676 671 ssaoFilterOffsets[2 * i + 0] = xoffs; 672 ssaoFilterOffsets[2 * i + 1] = yoffs; 673 } 674 675 for (int i = 0; i < NUM_SSAO_FILTER_SAMPLES / 2; ++ i) 676 { 677 float x = 0; 678 float y = yoffs * (i - NUM_SSAO_FILTER_SAMPLES / 4); 679 680 ssaoFilterWeights[i] = GaussianDistribution(x, y, 1.0f); 681 //ssaoFilterWeights[i] = 1.0f; 682 683 ssaoFilterOffsets[2 * (NUM_SSAO_FILTER_SAMPLES / 2 + i) + 0] *= xoffs; 684 ssaoFilterOffsets[2 * (NUM_SSAO_FILTER_SAMPLES / 2 + i) + 1] *= yoffs; 677 ssaoFilterOffsets[2 * i + 0] = x; 678 ssaoFilterOffsets[2 * i + 1] = y; 679 } 680 681 int j = 2 * n; 682 683 for (int i = 0; i < n; ++ i) 684 { 685 const int idx = i - NUM_SSAO_FILTER_SAMPLES / 4; 686 687 if (idx) 688 { 689 const float x = 0; 690 const float y = yoffs * (float)idx; 691 692 ssaoFilterWeights[i] = GaussianDistribution(x, y, 1.0f); 693 //ssaoFilterWeights[i] = 1.0f; 694 695 ssaoFilterOffsets[j + 0] = x; 696 ssaoFilterOffsets[j + 1] = y; 697 698 j += 2; 699 } 700 } 701 702 for (int i = 0; i < NUM_SSAO_FILTER_SAMPLES; ++ i) 703 { 704 cout << "samples " << i << ": " << ssaoFilterOffsets[i * 2] << " " << ssaoFilterOffsets[i * 2 + 1] << endl; 685 705 } 686 706 } -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
r3295 r3297 625 625 if (0) LoadPompeiiFloor(); 626 626 627 #if 0627 #if 1 628 628 const Vector3 sceneCenter(470.398f, 240.364f, 181.7f); 629 629 //const Vector3 sceneCenter(470.398f, 240.364f, 180.3); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h
r3295 r3297 8 8 //#define NUM_SAMPLES 8 9 9 //#define NUM_SAMPLES 16 10 //#define NUM_SAMPLES 2411 #define NUM_SAMPLES 4810 #define NUM_SAMPLES 24 11 //#define NUM_SAMPLES 48 12 12 13 13 #define MIN_SAMPLES 8 … … 20 20 #define VIEW_CORRECTION_SCALE 1.0f 21 21 22 #define NUM_SSAO_FILTER_SAMPLES 16 22 //#define NUM_SSAO_FILTER_SAMPLES 13 // 7x7 23 #define NUM_SSAO_FILTER_SAMPLES 9 24 //#define NUM_SSAO_FILTER_SAMPLES 5 23 25 24 26 #define SSAO_CONVERGENCE_THRESHOLD 700.0f … … 62 64 #define NUM_DOF_TABS 16 63 65 64 #define USE_GTX66 //#define USE_GTX 65 67 66 68 #endif // __SHADERENV_H -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/combineSsao.cg
r3296 r3297 69 69 //samplePos = ReconstructSamplePos(ssaoTex, sampleTexCoord.xy, bl, br, tl, tr); 70 70 71 len = min(SqrLen(centerPos - samplePos), 1e2f); 71 len = SqrLen(centerPos - samplePos); 72 //len = length(centerPos - samplePos); 72 73 spatialFactor = 1.0f / max(len, 1e-3f); 73 74 … … 144 145 145 146 // filter up to a certain convergance value and leave out background (sky) by checking depth 146 if ((convergence < SSAO_CONVERGENCE_THRESHOLD) && (col.w < 1e10f)) 147 if (//(convergence < SSAO_CONVERGENCE_THRESHOLD) && 148 (col.w < 1e10f)) 147 149 { 148 150 const float distanceScale = 1.0f; … … 151 153 const float convergenceWeight = SSAO_CONVERGENCE_THRESHOLD / (ssaoFilterRadius - 1.0f); 152 154 const float convergenceScale = convergenceWeight / (convergence + convergenceWeight); 153 const float scale = ssaoFilterRadius * convergenceScale * distanceScale;155 const float scale = 1;//ssaoFilterRadius * convergenceScale * distanceScale; 154 156 155 157 // the filtered ssao value … … 221 223 const float convergenceWeight = SSAO_CONVERGENCE_THRESHOLD / (ssaoFilterRadius - 1.0f); 222 224 const float convergenceScale = convergenceWeight / (convergence + convergenceWeight); 223 const float scale = ssaoFilterRadius * convergenceScale * distanceScale;225 const float scale = 1;//ssaoFilterRadius * convergenceScale * distanceScale; 224 226 225 227 // the filtered ssao value
Note: See TracChangeset
for help on using the changeset viewer.