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

found error, working ok

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.