Ignore:
Timestamp:
09/02/08 15:48:44 (16 years ago)
Author:
mattausch
Message:
 
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__ 
    33 
    44#include "common.h" 
    55#include "glInterface.h" 
     6 
    67#include <Cg/cg.h> 
    78#include <Cg/cgGL.h> 
     
    1516class Camera; 
    1617class Matrix4x4; 
     18class ShadowMap; 
     19 
    1720 
    1821/** This class implements a deferred shading algorithm that takes 
    1922        a frame buffer object as input and outputs an image in the given size 
    2023*/ 
    21 class SsaoShader 
     24class DeferredRenderer 
    2225{ 
    2326public: 
     
    2932                exact scene size that was scaled in order to improve floating point precision. 
    3033        */ 
    31         SsaoShader(int w, int h, Camera *cam, float scaleFactor); 
     34        DeferredRenderer(int w, int h, Camera *cam, float scaleFactor); 
    3235        /** The algorithm renders the scene given an fbo consists of 1 color buffer,  
    3336                1 position buffer, and 1 normal buffer. 
     
    3538                a smoothing factor for temporal coherence 
    3639        */ 
    37         void Render(FrameBufferObject *fbo, const Matrix4x4 &oldProjViewMatrix, float expFactor); 
     40        void Render(FrameBufferObject *fbo, const Matrix4x4 &oldProjViewMatrix, float expFactor, ShadowMap *shadowMap = NULL); 
    3841 
    3942        /** Initialises the deferred shader and loads the required shaders: 
     
    4245        static void Init(CGcontext context); 
    4346 
    44         ~SsaoShader(); 
     47        ~DeferredRenderer(); 
    4548 
    46         void SetUseGlobIllum(bool useGlobIllum); 
    4749        void SetUseTemporalCoherence(bool temporal); 
    4850 
    4951        enum SAMPLING_METHOD {POISSON, GAUSS}; 
     52        enum SHADING_METHOD {DEFAULT, SSAO, GI}; 
    5053 
    51         void SetSamplingMethod(int s) { mSampling = s;} 
     54        void SetSamplingMethod(SAMPLING_METHOD s); 
    5255 
     56        void SetShadingMethod(SHADING_METHOD s) { mShadingMethod = s; } 
    5357 
    5458protected: 
     
    5963 
    6064        void FirstPass(FrameBufferObject *fbo); 
     65 
     66        void FirstPassShadow(FrameBufferObject *fbo, ShadowMap *shadowMap); 
    6167 
    6268        void CombineSsao(FrameBufferObject *fbo); 
     
    8490        FrameBufferObject *mFbo; 
    8591 
    86         bool mUseGlobIllum; 
    8792        bool mUseTemporalCoherence; 
    8893 
    89         int mSampling; 
     94        int mSamplingMethod; 
    9095        int mFboIndex; 
     96 
     97        int mShadingMethod; 
     98 
     99        bool mRegenerateSamples; 
    91100}; 
    92101 
Note: See TracChangeset for help on using the changeset viewer.