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 "ReducedCubeMapRenderingRun.h"
|
---|
12 | #include "OgreSharedRuns.h"
|
---|
13 |
|
---|
14 |
|
---|
15 | /**
|
---|
16 | @brief ReducedCubeMapRenderingRun used in an OGRE environment.
|
---|
17 | */
|
---|
18 | class OgreReducedCubeMapRenderingRun : public OgreRenderingRun,
|
---|
19 | public ReducedCubeMapRenderingRun
|
---|
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 useDistCalc flag to skip cube face update if object is far away
|
---|
32 | @param useFaceAngleCalc flag to skip cube face update if face is neglible
|
---|
33 | @param distTolerance distance tolerance used in face skip
|
---|
34 | @param angleTolerance angle tolerance used in face skip
|
---|
35 | @param updateAllFace defines if all cubemap faces should be updated in a frame or only one face per frame
|
---|
36 | */
|
---|
37 | OgreReducedCubeMapRenderingRun(OgreSharedRuns* sharedRuns,
|
---|
38 | String name,
|
---|
39 | unsigned long startFrame,
|
---|
40 | unsigned long updateInterval,
|
---|
41 | unsigned int resolution,
|
---|
42 | bool useDistCalc = false,
|
---|
43 | bool useFaceAngleCalc = false,
|
---|
44 | float distTolerance = 15,
|
---|
45 | float angleTolerance = 10,
|
---|
46 | bool updateAllFace = false);
|
---|
47 |
|
---|
48 | virtual ~OgreReducedCubeMapRenderingRun(){}
|
---|
49 |
|
---|
50 | /**
|
---|
51 | @brief returns the name of the resulting downsampled color cubemap texture
|
---|
52 | */
|
---|
53 | String& getReducedCubeMapTextureName(){return name;}
|
---|
54 |
|
---|
55 | //inherited
|
---|
56 | void colorCubeMapChanged(String& newMapName);
|
---|
57 |
|
---|
58 | void freeAllResources();
|
---|
59 |
|
---|
60 | protected:
|
---|
61 | /**
|
---|
62 | @brief a pointer to the OgreSharedRuns this run belongs to
|
---|
63 | */
|
---|
64 | OgreSharedRuns* sharedRuns;
|
---|
65 | /**
|
---|
66 | @brief the name of the downsampled cubemap texture that was created by this run
|
---|
67 | */
|
---|
68 | String name;
|
---|
69 | /**
|
---|
70 | @brief a pointer to the downsampled cubemap texture that was created by this run
|
---|
71 | */
|
---|
72 | Texture* reducedCubemapTexture;
|
---|
73 |
|
---|
74 |
|
---|
75 | //inherited
|
---|
76 | inline void createReducedCubeMap();
|
---|
77 | //inherited
|
---|
78 | inline void updateCubeFace(int facenum);
|
---|
79 | //inherited
|
---|
80 | bool faceNeedsUpdate(int facenum);
|
---|
81 | };
|
---|