Ignore:
Timestamp:
08/22/08 13:20:06 (16 years ago)
Author:
mattausch
Message:

cleaned up code

File:
1 edited

Legend:

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

    r2860 r2861  
    1414class Vector3; 
    1515class Camera; 
    16  
     16class Matrix4x4; 
    1717 
    1818/** This class implements a deferred shading algorithm that takes 
     
    2323public: 
    2424        /** constructor for a deferred shader taking the requested output image size, 
    25                 the current camera, the exponential smoothing factor for temporal reprojection,  
    26                 and a scaling factor. 
     25                the current camera,     and a scaling factor. 
    2726                         
    2827                The parameter scaleFactor must be reciprocal value of the  
     
    3029                exact scene size that was scaled in order to improve floating point precision. 
    3130        */ 
    32         SsaoShader(int w, int h, Camera *cam, float expFactor, float scaleFactor); 
    33         /** The algorithm renders the scene given an fbo. 
    34                 The fbo must have color buffer, position buffer, normal buffer. 
     31        SsaoShader(int w, int h, Camera *cam, float scaleFactor); 
     32        /**  
     33         
     34                The algorithm renders the scene given an fbo consists of 1 color buffer,  
     35                1 position buffer, and 1 normal buffer. 
     36                We also need the  projection view matrix of the last frame for reprojection, and 
     37                a smoothing factor for temporal coherence 
    3538        */ 
    36         void Render(FrameBufferObject *fbo, FrameBufferObject *fbo2); 
     39        void Render(FrameBufferObject *fbo, const Matrix4x4 &oldProjViewMatrix, float expFactor); 
    3740 
    3841        /** Initialises the deferred shader and loads the required shaders: 
     
    4144        static void Init(CGcontext context); 
    4245 
     46        ~SsaoShader(); 
    4347 
    4448protected: 
    4549 
    46         void FirstPass(FrameBufferObject *fbo, FrameBufferObject *fbo2); 
     50        void FirstPass(FrameBufferObject *fbo, float expFactor); 
    4751 
    48         void SecondPass(FrameBufferObject *fbo, FrameBufferObject *fbo2); 
     52        void SecondPass(FrameBufferObject *fbo); 
     53 
     54        void CreateNoiseTex2D(); 
     55        void ComputeViewVectors(Vector3 &tl, Vector3 &tr, Vector3 &bl, Vector3 &br); 
    4956 
    5057 
     
    5461        int mHeight; 
    5562 
    56         /// the temporal smoothing factor 
    57         float mExpFactor; 
    5863        /// this is just a scale factor for the scene depth in order to get better float precision in the shader 
    5964        float mScaleFactor; 
     
    6166        Camera *mCamera; 
    6267 
    63  
    64 private: 
    65  
    66         void CreateNoiseTex2D(); 
    67         void ComputeViewVectors(Vector3 &tl, Vector3 &tr, Vector3 &bl, Vector3 &br); 
    68  
     68        FrameBufferObject *mOldFbo; 
     69        FrameBufferObject *mNewFbo; 
    6970}; 
    7071 
Note: See TracChangeset for help on using the changeset viewer.