source: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreConvolvedCubeMapRenderTechnique.h @ 836

Revision 836, 3.1 KB checked in by szirmay, 18 years ago (diff)
Line 
1#pragma once
2
3//disable inheritance warning caused by multiple inheritance
4#if _WIN32
5#if _MSC_VER
6#pragma warning(disable: 4250)
7#endif
8#endif
9
10#include "ConvolvedCubeMapRenderTechnique.h"
11#include "OgreRenderTechnique.h"
12#include "Ogre.h"
13
14using namespace Ogre;
15
16/**
17        @brief ConvolvedCubeMapRenderTechnique used in an Ogre environment.
18*/
19class OgreConvolvedCubeMapRenderTechnique :     public ConvolvedCubeMapRenderTechnique,
20                                                                        public OgreRenderTechnique
21{
22public:
23
24        /**
25                @brief Constructor.
26
27                @param startFrame                                       adds an offset to the current frame number to help evenly distribute updates between frames
28                @param cubeMapUpdateInterval            update frequency
29                @param cubeMapResolution                        color cubemap resolution
30                @param reducedCubeMapResolution         reduced sized color cubemap resolution
31                @param reducedTexID                                     the id of the texture unit state the resulting cubemap should be bound to
32                @param useDistCalc                                      flag to skip cube face update if object is far away
33                @param useFaceAngleCalc                         flag to skip cube face update if face is neglible
34                @param distTolerance                            distance tolerance used in face skip
35                @param angleTolerance                           angle tolerance used in face skip
36                @param updateAllFace                            defines if all cubemap faces should be updated in a frame or only one face per frame
37                @param pass                                                     the pass to operate on                 
38                @param parentRenderable                         the object to operate on
39                @param parentTechniqueGroup                     the TechniqueGroup this RenderedTechnique is attached to
40        */
41        OgreConvolvedCubeMapRenderTechnique( unsigned long startFrame,
42                                                        unsigned long cubeMapUpdateInterval,
43                                                        unsigned int cubeMapResolution,
44                                                        unsigned int reducedCubeMapResolution,
45                                                        unsigned char reducedTexID,
46                                                        bool useDistCalc,
47                                                        bool useFaceAngleCalc,
48                                                        float distTolerance,
49                                                        float angleTolerance,
50                                                        bool updateAllFace,
51                                                        Pass* pass,
52                                                        OgreRenderable* parentRenderable,
53                                                        OgreTechniqueGroup* parentTechniqueGroup
54                                                        );
55        /**
56                @brief Destructor.
57        */
58        ~OgreConvolvedCubeMapRenderTechnique();
59       
60        //inherited
61        void update(unsigned long frameNum);
62       
63protected:     
64        /**
65                @brief the id of the texture unit state the resulting cubemap should be bound to
66        */
67        unsigned char reducedTexID;
68       
69        //inherited
70        void reducedCubeMapRunChanged(RenderingRun* run);
71        //inherited
72        void colorCubeMapRunChanged(RenderingRun* run);
73        //inherited
74        RenderingRun* createColorCubeMapRun();
75        //inherited
76        RenderingRun* createReducedCubeMapRun();
77       
78};
79
80
81
82class OgreConvoledCubeMapRenderTechniqueFactory : public RenderTechniqueFactory
83{
84public:
85       
86        OgreConvoledCubeMapRenderTechniqueFactory();
87
88        OgreRenderTechnique* createInstance(IllumTechniqueParams* params,
89                                                                                Pass* pass,
90                                                                                OgreRenderable* parentRenderable,
91                                                                                OgreTechniqueGroup* parentTechniqueGroup);
92
93
94        unsigned long startFrame;
95        unsigned long cubeMapUpdateInterval;
96        unsigned int cubeMapResolution;                                                                                         
97        unsigned int reducedCubeMapResolution;
98        unsigned char texID;
99        bool useDistCalc;
100        bool useFaceAngleCalc;
101        float distTolerance;
102        float angleTolerance;
103        bool updateAllFace;
104
105};
Note: See TracBrowser for help on using the repository browser.