Ignore:
Timestamp:
11/06/08 16:38:05 (16 years ago)
Author:
mattausch
Message:

reprojection working much better using 1 - eyespacedepth / oldEyeSpaceDepth

File:
1 edited

Legend:

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

    r3105 r3106  
    963963        mOldProjViewMatrix = mProjViewMatrix; 
    964964        mOldEyePos = mEyePos; 
    965  
    966  
    967         /////////////////// 
    968  
    969         Matrix4x4 matViewing, matProjection; 
     965        mEyePos = mCamera->GetPosition(); 
    970966 
    971967        // hack: temporarily change far to improve precision 
    972968        const float oldFar = mCamera->GetFar(); 
    973         mCamera->SetFar(1e3f); 
     969        const float oldNear = mCamera->GetNear(); 
     970        //mCamera->SetFar(1e3f); 
     971        //mCamera->SetNear(3.0f); 
    974972        //mCamera->SetFar(1e2f); 
    975973 
    976  
    977         //mCamera->GetModelViewMatrix(matViewing); 
     974        Matrix4x4 matViewing, matProjection; 
     975/* 
     976        mCamera->SetPosition(mOldEyePos - mEyePos); 
     977 
     978        mCamera->GetModelViewMatrix(matViewing); 
     979        mCamera->GetProjectionMatrix(matProjection); 
     980 
     981        mOldProjViewMatrix = matViewing * matProjection; 
     982        mCamera->SetPosition(mEyePos);*/ 
     983 
     984        /////////////////// 
     985 
     986 
    978987        mCamera->GetViewOrientationMatrix(matViewing); 
    979988        mCamera->GetProjectionMatrix(matProjection); 
     
    981990        mProjViewMatrix = matViewing * matProjection; 
    982991        ComputeViewVectors(mCamera, mCornersView[0], mCornersView[1], mCornersView[2], mCornersView[3]); 
    983         mEyePos = mCamera->GetPosition(); 
    984  
     992         
    985993 
    986994        // switch roles of old and new fbo 
     
    10181026        // revert to old far plane 
    10191027        mCamera->SetFar(oldFar); 
     1028        mCamera->SetNear(oldNear); 
    10201029} 
    10211030 
Note: See TracChangeset for help on using the changeset viewer.