Changeset 2995


Ignore:
Timestamp:
10/03/08 02:46:30 (16 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/App/Demos/Vis/FriendlyCulling/src
Files:
3 edited

Legend:

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

    r2994 r2995  
    350350                 
    351351                sOldModelViewProjMatrixParam = cgGetNamedParameter(sCgSsaoProgram, "oldModelViewProj"); 
    352                 sModelViewProjMatrixParam = cgGetNamedParameter(sCgSsaoProgram, "mymodelViewProj"); 
     352                sModelViewProjMatrixParam = cgGetNamedParameter(sCgSsaoProgram, "oldModelView"); 
    353353                sMaxDepthParam = cgGetNamedParameter(sCgSsaoProgram, "maxDepth"); 
    354354                sTemporalCoherenceParam = cgGetNamedParameter(sCgSsaoProgram, "temporalCoherence"); 
     
    657657        cgGLSetMatrixParameterfc(sOldModelViewProjMatrixParam, (const float *)oldProjViewMatrix.x); 
    658658 
     659        cgGLSetMatrixParameterfc(sModelViewProjMatrixParam, (const float *)projViewMatrix.x); 
     660 
    659661        GLuint colorsTex = fbo->GetColorBuffer(colorBufferIdx)->GetTexture(); 
    660662        GLuint positionsTex = fbo->GetColorBuffer(1)->GetTexture(); 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp

    r2994 r2995  
    278278 
    279279static Matrix4x4 oldViewProjMatrix; 
     280static Matrix4x4 oldMatViewing; 
     281 
    280282 
    281283 
     
    881883        // store matrix of last frame 
    882884        oldViewProjMatrix = matProjectionView; 
     885        camera->GetModelViewMatrix(oldMatViewing); 
    883886 
    884887        glMatrixMode(GL_PROJECTION); 
     
    11911194 
    11921195                ShadowMap *sm = showShadowMap ? shadowMap : NULL; 
    1193                 ssaoShader->Render(fbo, oldViewProjMatrix, matProjectionView, ssaoTempCohFactor, light, useHDR, sm); 
     1196                //ssaoShader->Render(fbo, oldViewProjMatrix, matProjectionView, ssaoTempCohFactor, light, useHDR, sm); 
     1197                ssaoShader->Render(fbo, oldViewProjMatrix, oldMatViewing, ssaoTempCohFactor, light, useHDR, sm); 
    11941198        } 
    11951199 
     
    17241728        AxisAlignedBox3 box = bvh->GetBox(); 
    17251729 
    1726         // hack: set far plane for viz 
    1727         //camera->SetFar(0.35f * Magnitude(box.Diagonal())); 
    1728  
    17291730        const float offs = box.Size().x * 0.3f; 
    1730         //const float offs = box.Size().x * 0.6f; 
    17311731         
    17321732        Vector3 vizpos = Vector3(box.Min().x, box.Min().y  - box.Size().y * 0.35f, box.Min().z + box.Size().z * 50); 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg

    r2993 r2995  
    149149                   uniform float3 br, 
    150150                   uniform float3 tl, 
    151                    uniform float3 tr 
     151                   uniform float3 tr, 
     152                   const uniform float4x4 oldModelView 
    152153                   ) 
    153154{ 
     
    197198        float4 oldPos = mul(oldModelViewProj, realPos); 
    198199 
     200        // the depth projected into the old frame 
    199201        const float newDepth = oldPos.z / oldPos.w; 
    200202 
     203        // fit from unit cube into 0 .. 1 
    201204        float2 tex = (oldPos.xy / oldPos.w) * 0.5f + 0.5f; 
     205 
     206        // optain the sample frpm last frame 
    202207        float4 oldCol = tex2D(oldTex, tex); 
    203208 
     
    212217        // the number of valid samples in this frame 
    213218        const float newNumSamples = ao.y; 
     219 
    214220 
    215221        if (//(temporalCoherence > 0) && 
     
    219225                // if visibility changed in the surrounding area we have to recompute 
    220226                && (oldNumSamples > 0.8f * newNumSamples) 
    221                 //&& (oldAvgDepth / newAvgDepth > 0.99) 
    222227                ) 
    223228        { 
     
    225230                newWeight = oldWeight + 1.0f; 
    226231                OUT.illum_col.xy = (ao.xy + oldCol.xy * oldWeight) / newWeight; 
    227  
    228232                //if (!(oldNumSamples > ao.y - 1.5f)) newWeight = 0; 
    229233        } 
Note: See TracChangeset for help on using the changeset viewer.