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 | */
|
---|
18 | class OgreCausticCubeMapRenderingRun : public OgreRenderingRun,
|
---|
19 | public CausticCubeMapRenderingRun
|
---|
20 | {
|
---|
21 | public:
|
---|
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 | );
|
---|
44 | /**
|
---|
45 | @brief returns the name of the resulting caustic cubemap texture
|
---|
46 | */
|
---|
47 | String& getCausticCubeMapTextureName(){return name;}
|
---|
48 |
|
---|
49 | //inherited
|
---|
50 | void photonMapChanged(RenderingRun* run);
|
---|
51 |
|
---|
52 | protected:
|
---|
53 | /**
|
---|
54 | @brief the texture unit state id of the caustic map generation material where the photonhit map should be bound to
|
---|
55 | */
|
---|
56 | unsigned char photonMapTexId;
|
---|
57 | /**
|
---|
58 | @brief a pointer to the OgreSharedRuns this run belongs to
|
---|
59 | */
|
---|
60 | OgreSharedRuns* sharedRuns;
|
---|
61 | /**
|
---|
62 | @brief the name of the cubemap texture that was created by this run
|
---|
63 | */
|
---|
64 | String name;
|
---|
65 | /**
|
---|
66 | @brief a pointer to the cubemap texture that was created by this run
|
---|
67 | */
|
---|
68 | Texture* causticCubemapTexture;
|
---|
69 | /**
|
---|
70 | @brief the name of the material that should be used when rendering the caustic cubemap
|
---|
71 | */
|
---|
72 | String materialName;
|
---|
73 |
|
---|
74 | //inherited
|
---|
75 | inline void createCausticCubeMap();
|
---|
76 | //inherited
|
---|
77 | inline void updateCubeFace(int facenum);
|
---|
78 | //inherited
|
---|
79 | bool faceNeedsUpdate(int facenum);
|
---|
80 |
|
---|
81 | };
|
---|