- Timestamp:
- 09/02/08 15:48:44 (16 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.h
r2891 r2896 1 #ifndef _ SsaoShader_H__2 #define _ SsaoShader_H__1 #ifndef _DeferredRenderer_H__ 2 #define _DeferredRenderer_H__ 3 3 4 4 #include "common.h" 5 5 #include "glInterface.h" 6 6 7 #include <Cg/cg.h> 7 8 #include <Cg/cgGL.h> … … 15 16 class Camera; 16 17 class Matrix4x4; 18 class ShadowMap; 19 17 20 18 21 /** This class implements a deferred shading algorithm that takes 19 22 a frame buffer object as input and outputs an image in the given size 20 23 */ 21 class SsaoShader24 class DeferredRenderer 22 25 { 23 26 public: … … 29 32 exact scene size that was scaled in order to improve floating point precision. 30 33 */ 31 SsaoShader(int w, int h, Camera *cam, float scaleFactor);34 DeferredRenderer(int w, int h, Camera *cam, float scaleFactor); 32 35 /** The algorithm renders the scene given an fbo consists of 1 color buffer, 33 36 1 position buffer, and 1 normal buffer. … … 35 38 a smoothing factor for temporal coherence 36 39 */ 37 void Render(FrameBufferObject *fbo, const Matrix4x4 &oldProjViewMatrix, float expFactor );40 void Render(FrameBufferObject *fbo, const Matrix4x4 &oldProjViewMatrix, float expFactor, ShadowMap *shadowMap = NULL); 38 41 39 42 /** Initialises the deferred shader and loads the required shaders: … … 42 45 static void Init(CGcontext context); 43 46 44 ~ SsaoShader();47 ~DeferredRenderer(); 45 48 46 void SetUseGlobIllum(bool useGlobIllum);47 49 void SetUseTemporalCoherence(bool temporal); 48 50 49 51 enum SAMPLING_METHOD {POISSON, GAUSS}; 52 enum SHADING_METHOD {DEFAULT, SSAO, GI}; 50 53 51 void SetSamplingMethod( int s) { mSampling = s;}54 void SetSamplingMethod(SAMPLING_METHOD s); 52 55 56 void SetShadingMethod(SHADING_METHOD s) { mShadingMethod = s; } 53 57 54 58 protected: … … 59 63 60 64 void FirstPass(FrameBufferObject *fbo); 65 66 void FirstPassShadow(FrameBufferObject *fbo, ShadowMap *shadowMap); 61 67 62 68 void CombineSsao(FrameBufferObject *fbo); … … 84 90 FrameBufferObject *mFbo; 85 91 86 bool mUseGlobIllum;87 92 bool mUseTemporalCoherence; 88 93 89 int mSampling ;94 int mSamplingMethod; 90 95 int mFboIndex; 96 97 int mShadingMethod; 98 99 bool mRegenerateSamples; 91 100 }; 92 101
Note: See TracChangeset
for help on using the changeset viewer.