Changeset 3328 for GTP


Ignore:
Timestamp:
02/25/09 17:41:00 (15 years ago)
Author:
mattausch
Message:

found error, working ok

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  
    55//////////// 
    66//-- ssao + gi parameters 
    7 #define NUM_PRECOMPUTED_SAMPLES 100 
     7#define NUM_PRECOMPUTED_SAMPLES 4096 
    88//#define NUM_SAMPLES 8 
    99//#define NUM_SAMPLES 16 
    1010//#define NUM_SAMPLES 24 
    11 #define NUM_SAMPLES 8 
     11#define NUM_SAMPLES 48 
    1212 
    1313//#define MIN_SAMPLES 48 
     
    6161#define NUM_DOF_TABS 16 
    6262 
    63 //#define USE_GTX 
     63#define USE_GTX 
    6464 
    6565#define SSAO_FILTER_RADIUS 5 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/combineSsaoSep.cg

    r3327 r3328  
    192192        { 
    193193                // 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); 
    195195        } 
    196196 
     
    232232        { 
    233233                // 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); 
    235235        } 
    236236 
     
    241241        if (depth < DEPTH_THRESHOLD) 
    242242        { 
    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); 
    245245        } 
    246246        else 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg

    r3326 r3328  
    253253         
    254254        // 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; 
    257257 
    258258        // calculate eye space position of sample in old frame 
     
    272272 
    273273        // 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); 
    276276 
    277277 
     
    306306        } 
    307307         
    308         //isPixelValid = 2e20f; 
    309308        return float2(isPixelValid, abs(oldEyeSpaceDepth - projectedEyeSpaceDepth)); 
    310309} 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg

    r3327 r3328  
    179179                         sampler2D colors, 
    180180                         sampler2D noiseTex, 
    181                          //float2 samples[NUM_PRECOMPUTED_SAMPLES], 
    182181                         sampler2D samples, 
    183182                         float3 normal, 
     
    211210                //-- (affects performance for some reason!) 
    212211 
    213                 if (1)//convergence < SSAO_CONVERGENCE_THRESHOLD) 
     212                if (convergence < SSAO_CONVERGENCE_THRESHOLD) 
    214213                { 
    215214                        float2 mynoise = tex2Dlod(noiseTex, float4(IN.texCoord * 4.0f, 0, 0)).xy; 
     
    274273                // to the current pixel or if the angle is small enough 
    275274                // to have any influence in the current or last frame 
    276 #if 0 
     275#if 1 
    277276                const float tooFarAway = step(0.5f, lengthToSample - changeFactor); 
    278277 
    279278                const float partlyResetThres = 1.0f; 
    280                 if (0)//pixelValid <= partlyResetThres) 
     279                if (pixelValid <= partlyResetThres) 
    281280                        validSamples = max(validSamples, pixelValid * (1.0f - tooFarAway) * step(-0.1f, cosAngle)); 
    282281                else 
     
    295294                        // (=> there was no discontinuity recently) 
    296295                        //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; 
    298297                } 
    299298#endif 
     
    407406                // or if the angle is small enough 
    408407                // to have any influence in the current or last frame 
    409 #if 0 
     408#if 1 
    410409                const float partlyResetThres = 1.0f; 
    411410 
     
    456455                        uniform sampler2D noiseTex, 
    457456                        uniform sampler2D samples, 
    458                         //uniform float2 samples[NUM_PRECOMPUTED_SAMPLES], 
    459457                        uniform sampler2D oldTex, 
    460458                        uniform float4x4 modelViewProj, 
     
    513511 
    514512        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; 
    517516 
    518517        float3 ao; 
     
    551550         
    552551        // don't check for moving objects, otherwise almost no coherence 
    553         /*if (!isMovingObject) 
     552        if (!isMovingObject) 
    554553        { 
    555554                if (ao.y > completelyResetThres)  
     
    560559                else if (ao.y > partlyResetThres) 
    561560                { 
    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        } 
    567566 
    568567 
     
    586585        //OUT.illum_col.z = SqrLen(diffVec); 
    587586 
    588         //OUT.illum_col.xyz = normal.xyz; 
    589587        return OUT; 
    590588} 
Note: See TracChangeset for help on using the changeset viewer.