Changeset 3367 for GTP


Ignore:
Timestamp:
04/30/09 16:22:48 (15 years ago)
Author:
mattausch
Message:

working nicely but still artifacts where high convergence regions come on low convergence ones

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

Legend:

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

    r3362 r3367  
    518518                 "samples", "bl", "br", "tl", "tr",  
    519519                 "modelViewProj", "oldModelViewProj", "oldEyePos", "oldbl", "oldbr",  
    520                  "oldtl", "oldtr", "attribsTex", "kernelRadius", "sampleIntensity"}; 
    521          
    522         sCgSsaoProgram->AddParameters(ssaoParams, 0, 20); 
     520                 "oldtl", "oldtr", "attribsTex", "kernelRadius", "sampleIntensity", 
     521             "dummyIdx"}; 
     522         
     523        sCgSsaoProgram->AddParameters(ssaoParams, 0, 21); 
    523524         
    524525        string giParams[] =  
     
    830831        // read the second buffer, write to the first buffer 
    831832        mIllumFbo->Bind(); 
    832         glDrawBuffers(2, mrt + mIllumFboIndex); 
     833        glDrawBuffers(1, mrt + mIllumFboIndex); 
    833834 
    834835        int i = 0; 
     
    892893        sCgSsaoProgram->SetValue1f(i ++, mKernelRadius); 
    893894        sCgSsaoProgram->SetValue1f(i ++, mSampleIntensity * mKernelRadius); 
     895 
     896        static int dummyIdx = 0; 
     897        sCgSsaoProgram->SetValue1f(i ++, dummyIdx); 
     898        dummyIdx += NUM_SAMPLES; 
    894899 
    895900        DrawQuad(sCgSsaoProgram); 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp

    r3365 r3367  
    828828        //fbo->AddColorBuffer(ColorBufferObject::RGB_UBYTE, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_NEAREST); 
    829829        // buffer holding the difference vector to the old frame 
    830         fbo->AddColorBuffer(ColorBufferObject::RGB_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR); 
     830        fbo->AddColorBuffer(ColorBufferObject::RGB_FLOAT_16, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR); 
    831831        //fbo->AddColorBuffer(ColorBufferObject::RGB_UBYTE, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR); 
    832832        // another color buffer 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h

    r3363 r3367  
    1616#define NUM_SAMPLES 48 
    1717 
    18 #define MIN_SAMPLES 8 
    19 //#define MIN_SAMPLES 48 
     18//#define MIN_SAMPLES 8 
     19#define MIN_SAMPLES 48 
    2020 
    2121#define DISTANCE_SCALE 1e-2f 
     
    7474#define PERFORMANCE_TEST 1 
    7575 
    76 #define USE_OPTIMIZATION 0 
     76#define USE_OPTIMIZATION 1 
    7777 
    7878 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg

    r3366 r3367  
    2020{ 
    2121        float4 illum_col: COLOR0; 
    22         float4 col: COLOR1; 
    2322}; 
    2423 
     
    549548                // they possibly have any influence on the ao 
    550549 
    551                 if (cosAngle >= 0) 
     550                const float3 oldVector = oldSamplePos - oldPos; 
     551                const float oldDistance = length(oldVector); 
     552                const float cosAngle2 = dot(oldVector, normal); 
     553 
     554                if ((cosAngle >= 0) || (cosAngle2 >= 0)) 
    552555                { 
    553556                        const float oldDistance = length(oldSamplePos - oldPos); 
     
    615618                        uniform float kernelRadius, 
    616619                        uniform float sampleIntensity 
     620                        ,uniform float dummyIdx 
    617621                        ) 
    618622{ 
     
    757761        OUT.illum_col.w = eyeSpaceDepth; 
    758762 
    759         // this value can be used to check if this pixel belongs to a moving object 
    760         OUT.col.x = SqrLen(diffVec); 
    761         //OUT.illum_col.z = SqrLen(diffVec); 
    762  
    763763#else 
    764764 
Note: See TracChangeset for help on using the changeset viewer.