Ignore:
Timestamp:
08/27/08 16:14:10 (16 years ago)
Author:
mattausch
Message:

implemented glob-illum solution

File:
1 edited

Legend:

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

    r2873 r2874  
    106106mScaleFactor(scaleFactor) 
    107107{ 
    108          
    109108        /////////// 
    110109        //-- the flip-flop fbos 
     
    222221                sNoiseMultiplierGiParam = cgGetNamedParameter(sCgGiProgram, "noiseMultiplier"); 
    223222                 
    224                 sOldModelViewProjMatrixParam = cgGetNamedParameter(sCgGiProgram, "oldModelViewProj"); 
     223                sOldModelViewProjMatrixGiParam = cgGetNamedParameter(sCgGiProgram, "oldModelViewProj"); 
    225224                sMaxDepthGiParam = cgGetNamedParameter(sCgGiProgram, "maxDepth"); 
    226225                sExpFactorGiParam = cgGetNamedParameter(sCgGiProgram, "expFactor"); 
     
    272271        swap(mNewFbo, mOldFbo);  
    273272 
    274         cgGLSetMatrixParameterfc(sOldModelViewProjMatrixParam, (const float *)oldProjViewMatrix.x); 
    275273 
    276274        glPushAttrib(GL_VIEWPORT_BIT); 
     
    300298        FirstPass(fbo); 
    301299         
    302         ComputeSsao(fbo, expFactor); 
    303         //ComputeGlobIllum(fbo, expFactor); 
     300        //ComputeSsao(fbo, expFactor, oldProjViewMatrix); 
     301        ComputeGlobIllum(fbo, expFactor, oldProjViewMatrix); 
    304302 
    305303        //Combine(fbo); 
     
    321319 
    322320 
    323 void SsaoShader::ComputeSsao(FrameBufferObject *fbo, float expFactor) 
    324 { 
     321void SsaoShader::ComputeSsao(FrameBufferObject *fbo,  
     322                                                         float expFactor, 
     323                                                         const Matrix4x4 &oldProjViewMatrix 
     324                                                         ) 
     325{ 
     326        cgGLSetMatrixParameterfc(sOldModelViewProjMatrixParam, (const float *)oldProjViewMatrix.x); 
     327 
    325328        GLuint colorsTex = mFbo3->GetColorBuffer(0)->GetTexture(); 
    326329        GLuint positionsTex = fbo->GetColorBuffer(1)->GetTexture(); 
     
    582585 
    583586 
    584 void SsaoShader::ComputeGlobIllum(FrameBufferObject *fbo, float expFactor) 
    585 { 
     587void SsaoShader::ComputeGlobIllum(FrameBufferObject *fbo,  
     588                                                                  float expFactor, 
     589                                                                  const Matrix4x4 &oldProjViewMatrix 
     590                                                                  ) 
     591{ 
     592        cgGLSetMatrixParameterfc(sOldModelViewProjMatrixGiParam, (const float *)oldProjViewMatrix.x); 
     593 
    586594        GLuint colorsTex = mFbo3->GetColorBuffer(0)->GetTexture(); 
    587595        GLuint positionsTex = fbo->GetColorBuffer(1)->GetTexture(); 
Note: See TracChangeset for help on using the changeset viewer.