Changeset 3345 for GTP


Ignore:
Timestamp:
04/13/09 17:08:51 (15 years ago)
Author:
mattausch
Message:

trying to reduce render targets but something srange

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

Legend:

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

    r3343 r3345  
    821821        // read the second buffer, write to the first buffer 
    822822        mIllumFbo->Bind(); 
    823         glDrawBuffers(2, mrt + mIllumFboIndex); 
     823        glDrawBuffers(1, mrt + mIllumFboIndex); 
    824824 
    825825        int i = 0; 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg

    r3341 r3345  
    254254        // retrieve the sample from the last frame 
    255255        const float4 oldPixel = tex2Dlod(oldTex, float4(oldTexCoords, .0f, .0f)); 
    256         const float oldDiff = tex2Dlod(myTex, float4(oldTexCoords, .0f, .0f)).x; 
     256        //const float oldDiff = tex2Dlod(myTex, float4(oldTexCoords, .0f, .0f)).x; 
     257        const float oldDiff = tex2Dlod(myTex, float4(oldTexCoords, .0f, .0f)).z; 
    257258 
    258259        // calculate eye space position of sample in old frame 
     
    338339        const float3 normal = normalize(tex2Dlod(normalsTex, float4(IN.texCoord, 0, 0)).xyz); 
    339340 
    340 //#ifdef PERFORMANCE_TEST 
    341 #if 1 
     341#ifdef PERFORMANCE_TEST 
    342342        // do reprojection and filter out the pixels that are not save 
    343343        const float2 pValid = PixelValid(oldTex, 
     
    353353                                                                         ); 
    354354#else 
    355         const float2 pValid = float2(0,0); 
     355        const float2 pValid = float2(0, 0); 
    356356#endif 
    357357 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg

    r3344 r3345  
    2020{ 
    2121        float4 illum_col: COLOR0; 
    22         float4 col: COLOR1; 
     22        //float4 col: COLOR1; 
    2323}; 
    2424 
     
    117117        const float oldEyeSpaceDepth = oldPixel.w; 
    118118 
    119         // vector from eye pos to old sample  
     119        // vector from eye pos to old sample 
    120120        const float3 viewVec = Interpol(oldTexCoords, oldbl, oldbr, oldtl, oldtr); 
    121121        const float invLen = 1.0f / length(viewVec); 
     
    148148                 
    149149                //w = ComputeConvergence(oldTex, oldTexCoords, float2(1024.0f, 768.0f)); 
    150                 w = oldPixel.y; 
     150                w = floor(oldPixel.y); 
     151                //w = oldPixel.y; 
    151152                idx = floor(oldPixel.z); 
    152  
    153153        } 
    154154        else 
    155155        {        
    156                 w = 0.0f; 
     156                w = .0f; 
    157157                idx = .0f; 
    158158        } 
     
    501501#ifdef PERFORMANCE_TEST  
    502502 
    503         float3 diffVec = tex2Dlod(attribsTex, float4(IN.texCoord, 0, 0)).xyz; 
     503        float3 diffVec = tex2Dlod(attribsTex, float4(IN.texCoord, .0f, .0f)).xyz; 
    504504 
    505505        const float sqrMoveSpeed = SqrLen(diffVec); 
     
    521521        const float oldSsao = temporalVals.x; 
    522522         
    523         float oldWeight = temporalVals.y; 
    524         float oldIdx = temporalCoherence > 1 ? temporalVals.z : 0; 
    525          
     523        float oldIdx = temporalCoherence > 1 ? temporalVals.y : .0f; 
     524        //float oldWeight = temporalVals.y; 
     525        float oldWeight = clamp(oldIdx, 0, temporalCoherence); 
     526 
    526527#else 
    527528 
    528529        const bool isMovingObject = false; 
    529         const float oldSsao = 0; 
    530          
    531         float oldWeight = 0; 
    532         float oldIdx = 0; 
     530        const float oldSsao = .0f; 
     531         
     532        float oldWeight = .0f; 
     533        float oldIdx = .0f; 
    533534         
    534535#endif 
     
    582583                else if (ao.y > partlyResetThres) 
    583584                { 
    584                         oldWeight = min(oldWeight, 4.0f * newWeight); 
    585                         //oldWeight = .0f;  
    586                         //oldIdx = .0f; 
     585                        oldWeight = min(oldWeight, 4.0f * NUM_SAMPLES); oldIdx = oldWeight; 
     586                        //oldWeight = .0f; oldIdx = .0f; 
    587587                } 
    588588        } 
     
    596596 
    597597        // the new weight for the next frame 
    598         const float combinedWeight = clamp(newWeight + oldWeight, .0f, temporalCoherence); 
    599  
    600         OUT.illum_col.y = combinedWeight; 
    601         OUT.illum_col.z = oldIdx + newWeight; // the new index 
     598        const float newIdx = newWeight + oldIdx; 
     599        //const float combinedWeight = clamp(newIdx, .0f, temporalCoherence); 
     600        const float combinedWeight = clamp(newIdx, .0f, min(newWeight + oldWeight, temporalCoherence)); 
     601 
     602        //OUT.illum_col.y = combinedWeight; 
     603        OUT.illum_col.y = newIdx; // the new index 
    602604        OUT.illum_col.w = eyeSpaceDepth; 
    603605 
     
    605607 
    606608        // this value can be used to check if this pixel belongs to a moving object 
    607         OUT.col.x = SqrLen(diffVec); 
    608         //OUT.illum_col.z = SqrLen(diffVec); 
     609        //OUT.col.x = SqrLen(diffVec); 
     610        OUT.illum_col.z = SqrLen(diffVec); 
    609611 
    610612#else 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/toto.txt

    r3344 r3345  
    223223fix shadows! 
    224224make images with / without filter 
     225use nicer buddha 
     226 
     227make samplingstrategy different: poisson has same status as halton, 
     228use one of both (parent class randomsampler) 
Note: See TracChangeset for help on using the changeset viewer.