Changeset 2861 for GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SsaoShader.h
- Timestamp:
- 08/22/08 13:20:06 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SsaoShader.h
r2860 r2861 14 14 class Vector3; 15 15 class Camera; 16 16 class Matrix4x4; 17 17 18 18 /** This class implements a deferred shading algorithm that takes … … 23 23 public: 24 24 /** 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. 27 26 28 27 The parameter scaleFactor must be reciprocal value of the … … 30 29 exact scene size that was scaled in order to improve floating point precision. 31 30 */ 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 35 38 */ 36 void Render(FrameBufferObject *fbo, FrameBufferObject *fbo2);39 void Render(FrameBufferObject *fbo, const Matrix4x4 &oldProjViewMatrix, float expFactor); 37 40 38 41 /** Initialises the deferred shader and loads the required shaders: … … 41 44 static void Init(CGcontext context); 42 45 46 ~SsaoShader(); 43 47 44 48 protected: 45 49 46 void FirstPass(FrameBufferObject *fbo, FrameBufferObject *fbo2);50 void FirstPass(FrameBufferObject *fbo, float expFactor); 47 51 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); 49 56 50 57 … … 54 61 int mHeight; 55 62 56 /// the temporal smoothing factor57 float mExpFactor;58 63 /// this is just a scale factor for the scene depth in order to get better float precision in the shader 59 64 float mScaleFactor; … … 61 66 Camera *mCamera; 62 67 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; 69 70 }; 70 71
Note: See TracChangeset
for help on using the changeset viewer.