source: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgreCausticCubeMapRenderingRun.h @ 1722

Revision 1722, 3.0 KB checked in by szirmay, 18 years ago (diff)
RevLine 
[790]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 "OgreRenderingRun.h"
11#include "CausticCubeMapRenderingRun.h"
12#include "OgreSharedRuns.h"
13
14
15/**
16        @brief ColorCubeMapRenderingRun used in an OGRE environment.
17*/
18class OgreCausticCubeMapRenderingRun : public OgreRenderingRun,
19                                                                        public CausticCubeMapRenderingRun
20{       
21public:
22
23        /**
24                @brief Constructor.
25
26                @param sharedRuns                               a pointer to the OgreSharedRuns this run belongs to
27                @param name                                             the name of the cubemap texture to be created
28                @param startFrame                               adds an offset to the current frame number to help evenly distribute updates between frames
29                @param updateInterval                   update frequency
30                @param resolution                               cubemap resolution
31                @param materialName                             the name of the material that should be used when rendering the caustic cubemap
32                @param photonMapTexId                   the texture unit state id of the caustic map generation material where the photonhit map should be bound to
33                @param updateAllFace                    defines if all cubemap faces should be updated in a frame or only one face per frame
34        */     
35        OgreCausticCubeMapRenderingRun(OgreSharedRuns* sharedRuns,
36                                                                String name,
37                                                                  unsigned long startFrame,
38                                                                unsigned long updateInterval,
39                                                                unsigned int resolution,
40                                                                 String materialName,
41                                                                 unsigned char photonMapTexId,
[1055]42                                                                 bool updateAllFace,
[1351]43                                                                 float attenuation,
[1688]44                                                                 bool useTriangles,
45                                                                 bool blurMap
[790]46                                                                 );
47        /**
48                @brief returns the name of the resulting caustic cubemap texture
49        */
[1688]50        const String& getCausticCubeMapTextureName()
51        {
52                if(blurMap)
53                        return bluredCausticCubemapTexture->getName();
54                else
55                        return name;
56        }
[790]57
58        //inherited
59        void photonMapChanged(RenderingRun* run);
[1055]60        float getAttenuation(){return attenuation;}
[790]61       
[1722]62        bool canJoin(RenderingRun* run)
[1055]63        {
[1722]64                OgreCausticCubeMapRenderingRun* r = (OgreCausticCubeMapRenderingRun*) run->asOgreRenderingRun();
[1055]65                if(r->materialName == materialName)
66                        return true;
67                return false;
68        }
69
[790]70protected:
71        /**
72                @brief the texture unit state id of the caustic map generation material where the photonhit map should be bound to
73        */
74        unsigned char photonMapTexId;
75        /**
76                @brief a pointer to the OgreSharedRuns this run belongs to
77        */
78        OgreSharedRuns* sharedRuns;
79        /**
80                @brief the name of the cubemap texture that was created by this run
81        */
82        String name;
83        /**
84                @brief a pointer to the cubemap texture that was created by this run
85        */
86        Texture* causticCubemapTexture;
87        /**
[1688]88                @brief a pointer to the blurred cubemap texture that was created by this run
89        */
90        Texture* bluredCausticCubemapTexture;
91        /**
[790]92                @brief the name of the material that should be used when rendering the caustic cubemap
93        */
94        String materialName;
[1055]95        float attenuation;
[1351]96        bool useTriangles;
[1688]97        bool blurMap;
[790]98       
99        //inherited
100        inline void createCausticCubeMap();
101        //inherited
102        inline void updateCubeFace(int facenum);
103        //inherited
104    bool faceNeedsUpdate(int facenum); 
105       
106};
Note: See TracBrowser for help on using the repository browser.