Changeset 3162


Ignore:
Timestamp:
11/25/08 12:02:58 (16 years ago)
Author:
mattausch
Message:

playing around with filter: returning to world space depth difference for filter kernel??

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

Legend:

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

    r3161 r3162  
    521521 
    522522        // antialiasing of the color buffer 
    523         //AntiAliasing(fbo, light); 
     523        AntiAliasing(fbo, light); 
    524524 
    525525        switch (mShadingMethod) 
     
    670670        GLuint normalsTex = fbo->GetColorBuffer(1)->GetTexture(); 
    671671 
    672         FrameBufferObject::Release(); 
    673672        // read the second buffer, write to the first buffer 
    674673        //FlipFbos(fbo); 
     674        // end of the pipeline => just draw image to screen 
     675        FrameBufferObject::Release(); 
    675676 
    676677        // the neighbouring texels 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SampleGenerator.cpp

    r3103 r3162  
    7171 
    7272                        if ((rx * rx + ry * ry > mRadius * mRadius)  
    73                                 // also test if sample exactly in center => avoid that                           
     73                                // also avoid case that sample exactly in center                         
    7474                                || (distanceSquared <= 1e-3f) 
    7575                                ) 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h

    r3161 r3162  
    77 
    88//#define NUM_SAMPLES 8 
    9 #define NUM_SAMPLES 48 
     9#define NUM_SAMPLES 24 
    1010 
    1111// for quadratic falloff 
    1212//#define SAMPLE_INTENSITY 0.2f 
    13 #define SAMPLE_INTENSITY 0.07f 
    14 //#define SAMPLE_INTENSITY 0.005f 
     13//#define SAMPLE_INTENSITY 0.07f 
     14#define SAMPLE_INTENSITY 0.01f 
    1515 
    1616//#define SAMPLE_INTENSITY 0.075f 
     
    6161 
    6262//#define NUM_SSAO_FILTERSAMPLES 25 
    63 #define NUM_SSAO_FILTERSAMPLES 8 
     63#define NUM_SSAO_FILTERSAMPLES 25 
    6464//#define NUM_SSAO_FILTERSAMPLES 80 
    6565 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/combineSsao.cg

    r3161 r3162  
    6363                //sampleDepth = aoSample.w; 
    6464                 
    65                 //depthFactor = max(step(1e-1f, 1.0f - abs(1.0f - eyeSpaceDepth / sampleDepth)), 1e-3f); 
    66                 depthFactor = 1.0f / max(abs(eyeSpaceDepth - sampleDepth), 1e-3f); 
    67                 //normalFactor = max(step(0.6f, dot(sampleNorm, centerNormal)), 1e-6f); 
    68                 normalFactor = max(dot(sampleNorm, centerNormal), 1e-6f); 
    69                 convergenceFactor = min(200.0f, aoSample.y) * 0.01f; 
     65                //depthFactor = 1.0f / max(abs(eyeSpaceDepth - sampleDepth), 1e-2f); 
     66                depthFactor = 1.0f - step(1e-2f, abs(1.0f - eyeSpaceDepth / sampleDepth)); 
     67                //normalFactor = max(step(0.6f, dot(sampleNorm, centerNormal)), 1e-3f); 
     68                normalFactor = max(dot(sampleNorm, centerNormal), 1e-3f); 
     69                //convergenceFactor = min(100.0f, aoSample.y); 
     70                convergenceFactor = aoSample.y; 
    7071 
    7172                // combine the weights 
    72                 w = depthFactor * normalFactor * convergenceFactor; 
     73                w = filterWeights[i] * convergenceFactor * depthFactor * normalFactor; 
     74                //w = normalFactor * convergenceFactor; 
    7375 
    7476                average += aoSample.x * w; 
     
    7678        } 
    7779 
    78         average /= max(total_w, 1e-1f); 
     80        average /= max(total_w, 1e-6f); 
    7981 
    8082        return saturate(average); 
     
    123125        } 
    124126 
    125         OUT.illum_col.xyz = col.xyz * ao.x; 
    126         //OUT.illum_col.xyz = float3(0, ao.x, 0); 
     127        //OUT.illum_col.xyz = col.xyz * ao.x; 
     128        OUT.illum_col.xyz = float3(ao.x, ao.x, ao.x); 
    127129        //OUT.illum_col.xyz = float3(0, clamp(1.0f - ao.y * 1e-2f, 0, 1), 1); 
    128130        OUT.illum_col.w = col.w; 
Note: See TracChangeset for help on using the changeset viewer.