1 | #pragma once
|
---|
2 | #include "CubeMapRenderTechnique.h"
|
---|
3 |
|
---|
4 | /**
|
---|
5 | @brief Base abstract class of rendering a distance cube map.
|
---|
6 |
|
---|
7 | This technique defines that the final rendering of an object needs a cubmap of the distance of the surrounding environment from the cubemap center.
|
---|
8 | */
|
---|
9 | class DistanceCubeMapRenderTechnique : virtual public CubeMapRenderTechnique
|
---|
10 | {
|
---|
11 | public:
|
---|
12 | /**
|
---|
13 | @brief Constructor.
|
---|
14 |
|
---|
15 | @param startFrame adds an offset to the current frame number to help evenly distribute updates between frames
|
---|
16 | @param cubeMapUpdateInterval update frequency
|
---|
17 | @param cubeMapResolution distance cubemap resolution
|
---|
18 | @param useDistCalc flag to skip cube face update if object is far away
|
---|
19 | @param useFaceAngleCalc flag to skip cube face update if face is neglible
|
---|
20 | @param distTolerance distance tolerance used in face skip
|
---|
21 | @param angleTolerance angle tolerance used in face skip
|
---|
22 | @param updateAllFace defines if all cubemap faces should be updated in a frame or only one face per frame
|
---|
23 | @param parentRenderable the object to operate on
|
---|
24 | @param parentTechniqueGroup the TechniqueGroup this RenderedTechnique is attached to
|
---|
25 | */
|
---|
26 | DistanceCubeMapRenderTechnique( unsigned long startFrame,
|
---|
27 | unsigned long cubeMapUpdateInterval,
|
---|
28 | unsigned int cubeMapResolution,
|
---|
29 | bool useDistCalc,
|
---|
30 | bool useFaceAngleCalc,
|
---|
31 | float distTolerance,
|
---|
32 | float angleTolerance,
|
---|
33 | bool updateAllFace,
|
---|
34 | bool renderSelf,
|
---|
35 | ElementaryRenderable* parentRenderable,
|
---|
36 | TechniqueGroup* parentTechniqueGroup
|
---|
37 | );
|
---|
38 | ~DistanceCubeMapRenderTechnique();
|
---|
39 |
|
---|
40 | /**
|
---|
41 | @brief Updates the resources in the given frame.
|
---|
42 |
|
---|
43 | @param frameNum the actual framenumber
|
---|
44 | */
|
---|
45 | virtual void update(unsigned long frameNum);
|
---|
46 |
|
---|
47 | //inherited
|
---|
48 | virtual void runUpdated(RenderingRunType runType, RenderingRun* run);
|
---|
49 | //inherited
|
---|
50 | void runChanged(RenderingRunType runType, RenderingRun* run);
|
---|
51 |
|
---|
52 | protected:
|
---|
53 | /**
|
---|
54 | @brief Called if the changed run is a ColorCubeMapRenderingRun.
|
---|
55 |
|
---|
56 | @param run pointer to the changed ColorCubeMapRenderingRun
|
---|
57 | */
|
---|
58 | virtual void distanceCubeMapRunChanged(RenderingRun* run) = 0;
|
---|
59 | /**
|
---|
60 | @brief Called if the changed run is a ColorCubeMapRenderingRun.
|
---|
61 |
|
---|
62 | @param run pointer to the changed ColorCubeMapRenderingRun
|
---|
63 | */
|
---|
64 | virtual void distanceCubeMapRunUpdated(RenderingRun* run) = 0;
|
---|
65 | /**
|
---|
66 | @brief Creates a ColorCubeMapRenderingRun.
|
---|
67 |
|
---|
68 | @return the new ColorCubeMapRenderingRun instance.
|
---|
69 | */
|
---|
70 | virtual RenderingRun* createDistanceCubeMapRun() = 0;
|
---|
71 | }; |
---|