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

Revision 1351, 2.8 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 "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,
42                                                                 bool updateAllFace,
43                                                                 float attenuation,
44                                                                 bool useTriangles
45                                                                 );
46        /**
47                @brief returns the name of the resulting caustic cubemap texture
48        */
49        String& getCausticCubeMapTextureName(){return name;}
50
51        //inherited
52        void photonMapChanged(RenderingRun* run);
53        float getAttenuation(){return attenuation;}
54       
55        bool canJoin(OgreRenderingRun* run)
56        {
57                OgreCausticCubeMapRenderingRun* r = (OgreCausticCubeMapRenderingRun*) run;
58                if(r->materialName == materialName)
59                        return true;
60                return false;
61        }
62
63protected:
64        /**
65                @brief the texture unit state id of the caustic map generation material where the photonhit map should be bound to
66        */
67        unsigned char photonMapTexId;
68        /**
69                @brief a pointer to the OgreSharedRuns this run belongs to
70        */
71        OgreSharedRuns* sharedRuns;
72        /**
73                @brief the name of the cubemap texture that was created by this run
74        */
75        String name;
76        /**
77                @brief a pointer to the cubemap texture that was created by this run
78        */
79        Texture* causticCubemapTexture;
80        /**
81                @brief the name of the material that should be used when rendering the caustic cubemap
82        */
83        String materialName;
84        float attenuation;
85        bool useTriangles;
86       
87        //inherited
88        inline void createCausticCubeMap();
89        //inherited
90        inline void updateCubeFace(int facenum);
91        //inherited
92    bool faceNeedsUpdate(int facenum); 
93       
94};
Note: See TracBrowser for help on using the repository browser.