Changeset 3297 for GTP


Ignore:
Timestamp:
02/11/09 01:52:36 (15 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/App/Demos/Vis/FriendlyCulling
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env

    r3292 r3297  
    107107useFullScreen=0 
    108108 
    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) 
    110110#renderMethod=2 
    111111renderMethod=0 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp

    r3296 r3297  
    652652#else 
    653653 
     654/** star filter 
     655*/ 
    654656void DeferredRenderer::PrepareSsaoFilter() 
    655657{ 
     
    662664        const float yoffs = (float)filterWidth / mHeight; 
    663665 
    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; 
    668674 
    669675                ssaoFilterWeights[i] = GaussianDistribution(x, y, 1.0f); 
    670676                 
    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; 
    685705        } 
    686706} 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp

    r3295 r3297  
    625625        if (0) LoadPompeiiFloor(); 
    626626 
    627 #if 0 
     627#if 1 
    628628        const Vector3 sceneCenter(470.398f, 240.364f, 181.7f); 
    629629        //const Vector3 sceneCenter(470.398f, 240.364f, 180.3); 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h

    r3295 r3297  
    88//#define NUM_SAMPLES 8 
    99//#define NUM_SAMPLES 16 
    10 //#define NUM_SAMPLES 24 
    11 #define NUM_SAMPLES 48 
     10#define NUM_SAMPLES 24 
     11//#define NUM_SAMPLES 48 
    1212 
    1313#define MIN_SAMPLES 8 
     
    2020#define VIEW_CORRECTION_SCALE 1.0f 
    2121 
    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 
    2325 
    2426#define SSAO_CONVERGENCE_THRESHOLD 700.0f 
     
    6264#define NUM_DOF_TABS 16 
    6365 
    64 #define USE_GTX 
     66//#define USE_GTX 
    6567 
    6668#endif // __SHADERENV_H 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/combineSsao.cg

    r3296 r3297  
    6969                //samplePos = ReconstructSamplePos(ssaoTex, sampleTexCoord.xy, bl, br, tl, tr); 
    7070 
    71                 len = min(SqrLen(centerPos - samplePos), 1e2f); 
     71                len = SqrLen(centerPos - samplePos); 
     72                //len = length(centerPos - samplePos); 
    7273                spatialFactor = 1.0f / max(len, 1e-3f); 
    7374 
     
    144145 
    145146        // 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)) 
    147149        { 
    148150                const float distanceScale = 1.0f; 
     
    151153                const float convergenceWeight = SSAO_CONVERGENCE_THRESHOLD / (ssaoFilterRadius - 1.0f); 
    152154                const float convergenceScale = convergenceWeight / (convergence + convergenceWeight); 
    153                 const float scale = ssaoFilterRadius * convergenceScale * distanceScale; 
     155                const float scale = 1;//ssaoFilterRadius * convergenceScale * distanceScale; 
    154156 
    155157                // the filtered ssao value 
     
    221223                const float convergenceWeight = SSAO_CONVERGENCE_THRESHOLD / (ssaoFilterRadius - 1.0f); 
    222224                const float convergenceScale = convergenceWeight / (convergence + convergenceWeight); 
    223                 const float scale = ssaoFilterRadius * convergenceScale * distanceScale; 
     225                const float scale = 1;//ssaoFilterRadius * convergenceScale * distanceScale; 
    224226 
    225227                // the filtered ssao value 
Note: See TracChangeset for help on using the changeset viewer.