Changeset 3122 for GTP


Ignore:
Timestamp:
11/12/08 13:05:11 (16 years ago)
Author:
mattausch
Message:

still problems with noise

Location:
GTP/trunk/App/Demos/Vis/FriendlyCulling/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp

    r3121 r3122  
    535535        sCgSsaoProgram->SetValue1f(i ++, (mUseTemporalCoherence && !mRegenerateSamples) ? tempCohFactor : 0); 
    536536         
    537         if (//mUseTemporalCoherence ||  
    538                 mRegenerateSamples) 
     537        if (mUseTemporalCoherence || mRegenerateSamples) 
    539538        { 
    540539                mRegenerateSamples = false; 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h

    r3120 r3122  
    66//-- ssao + gi parameters 
    77 
    8 #define NUM_SAMPLES 8 
    9 //#define NUM_SAMPLES 16 
     8//#define NUM_SAMPLES 8 
     9#define NUM_SAMPLES 16 
    1010 
    1111// for quadratic falloff 
    1212//#define SAMPLE_INTENSITY 0.1f 
    13 #define SAMPLE_INTENSITY 0.07f 
    14 //#define SAMPLE_INTENSITY 0.03f 
     13//#define SAMPLE_INTENSITY 0.07f 
     14#define SAMPLE_INTENSITY 0.03f 
    1515 
    1616#define SAMPLE_RADIUS 8e-1f 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/combineSsao.cg

    r3120 r3122  
    8686                //sampleNorm = tex2Dlod(normalsTex, offs).xyz; 
    8787 
    88                 w = filterWeights[i] * max(dot(sampleNorm, norm), .0f) * depthFactor; 
     88                w = filterWeights[i] * max(dot(sampleNorm, norm), 1e-3f) * depthFactor; 
    8989 
    9090                average += aoSample.x * w; 
     
    113113        if ((ao.y < 60.0f) && (col.w < 1e10f)) 
    114114        { 
    115                 const static float scaleFactor = 10.0f; 
     115                const static float scaleFactor = 20.0f; 
    116116 
    117117                //ao.x = Filter(IN.texCoord, ssaoTex, filterOffs, filterWeights); 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg

    r3121 r3122  
    185185        //float overallDepth = 0; 
    186186        const float squaredLen = diffVec.x * diffVec.x + diffVec.y * diffVec.y + diffVec.z * diffVec.z; 
     187 
    187188#if 1 
    188189        if (squaredLen < 1e-8f) // object not dynamic 
     
    208209#endif 
    209210 
    210         //const float oldWeight = clamp(oldPixel.y, .0f, temporalCoherence); 
    211         float oldWeight = oldPixel.y; 
     211        //const float clampedOldWeight = clamp(oldPixel.y, .0f, temporalCoherence); 
     212        const float oldWeight = oldPixel.y; 
    212213 
    213214        float newWeight; 
     
    219220                // if visibility changed in the surrounding area we have to recompute 
    220221                //&& (oldNumSamples > 0.8f * newNumSamples) 
    221                 //&& (notValid < 1.0f) 
     222                && (notValid < 1.0f) 
    222223                ) 
    223224        { 
    224225                // increase the weight for convergence 
    225226                newWeight = oldWeight + 1.0f; 
    226                 if (notValid > 1.0f) newWeight = 2.0f; 
     227                //if (notValid > 1.0f) newWeight = 2.0f; 
    227228        } 
    228229        else 
     
    231232        } 
    232233 
    233         if (oldPixel.y >= temporalCoherence) 
    234                 newWeight = min(temporalCoherence+1, max(oldPixel.y - 70, 50)); 
     234        //if (oldPixel.y >= 2000) 
     235        //      newWeight = min(temporalCoherence + 1, max(oldPixel.y - 70, 50)); 
     236        if (newWeight >= 2000) newWeight = 1000; 
    235237 
    236238        return float3(oldPixel.x, newWeight, eyeSpaceDepth); 
     
    379381        const float newWeight = temporalVals.y; 
    380382 
    381         float2 noiseOffs = float2(newWeight / 256.0f, (newWeight - 256.0f) / 192.0f); 
     383        //float2 noiseOffs = float2(newWeight / 139.0f, newWeight / 141.0f); 
     384        float2 noiseOffs = float2(.0f); 
    382385 
    383386        float2 ao; 
     387 
    384388        // note: this should be done with the stencil buffer 
    385389        if (eyeSpaceDepth < 1e10f) 
     
    393397        } 
    394398 
    395  
    396         OUT.illum_col.x = (ao.x + oldSsao * (newWeight - 1.0f)) / newWeight; 
     399        const float clampedWeight = clamp(newWeight, 1, temporalCoherence); 
     400 
     401        OUT.illum_col.x = (ao.x + oldSsao * (clampedWeight - 1.0f)) / clampedWeight; 
    397402        OUT.illum_col.y = newWeight; 
    398403        OUT.illum_col.z = invw; 
Note: See TracChangeset for help on using the changeset viewer.