Ignore:
Timestamp:
08/21/08 16:31:03 (16 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r2858 r2859  
    1 #ifndef _DeferredShader_H__ 
    2 #define _DeferredShader_H__ 
     1#ifndef _SsaoShader_H__ 
     2#define _SsaoShader_H__ 
    33 
    44#include "common.h" 
     5#include "glInterface.h" 
     6#include <Cg/cg.h> 
     7#include <Cg/cgGL.h> 
     8 
    59 
    610namespace CHCDemoEngine  
     
    913class FrameBufferObject; 
    1014 
    11 /** This class implements a deferred shading algorithm. 
     15 
     16/** This class implements a deferred shading algorithm that takes 
     17        a frame buffer object as input and outputs an image in the given size 
    1218*/ 
    13 class DeferredShader 
     19class SsaoShader 
    1420{ 
    1521public: 
    16         /** constructor requesting an opengl occlusion query. 
     22        /** constructor for a deferred shader taking the requested output image size, 
     23                the exponential smoothing factor for temporal reprojection. 
     24                 
     25                The last parameter is a just a scale factor 
     26                for the scene depth in order to get better floating point precision in the shader 
     27                This must be reciprocal value of the scale factor used in the mrt shader. 
    1728        */ 
    18         DeferredShader(); 
    19  
     29        SsaoShader(int w, int h, float expFactor, float scaleFactor); 
    2030        /** The algorithm renders the scene given an fbo. 
    2131                The fbo must have color buffer, position buffer, normal buffer. 
    2232        */ 
    23         void Render(FrameBufferObject *fbo); 
     33        void Render(FrameBufferObject *fbo, FrameBufferObject *fbo2); 
     34 
     35        /** Initialises the deferred shader and loads the required shaders: 
     36                This function has to be called only once. 
     37        */ 
     38        static void Init(CGcontext context); 
     39 
     40 
     41protected: 
     42 
     43        void FirstPass(FrameBufferObject *fbo, FrameBufferObject *fbo2); 
     44 
     45        void SecondPass(FrameBufferObject *fbo, FrameBufferObject *fbo2); 
     46 
     47 
     48        //////////// 
     49 
     50        int mWidth; 
     51        int mHeight; 
     52 
     53        /// the temporal smoothing factor 
     54        float mExpFactor; 
     55        /// this is just a scale factor for the scene depth in order to get better float precision in the shader 
     56        float mScaleFactor; 
    2457}; 
    2558 
    2659} // namespace  
    27 #endif // _DeferredShader_H__ 
     60#endif // _SsaoShader_H__ 
Note: See TracChangeset for help on using the changeset viewer.