[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 "ConvolvedCubeMapRenderTechnique.h"
|
---|
[1711] | 11 | #include "OgreCubeMapRenderTechnique.h"
|
---|
[790] | 12 | #include "Ogre.h"
|
---|
| 13 |
|
---|
| 14 | using namespace Ogre;
|
---|
| 15 |
|
---|
| 16 | /**
|
---|
| 17 | @brief ConvolvedCubeMapRenderTechnique used in an Ogre environment.
|
---|
| 18 | */
|
---|
| 19 | class OgreConvolvedCubeMapRenderTechnique : public ConvolvedCubeMapRenderTechnique,
|
---|
[1711] | 20 | public OgreCubeMapRenderTechnique
|
---|
[790] | 21 | {
|
---|
| 22 | public:
|
---|
| 23 |
|
---|
| 24 | /**
|
---|
| 25 | @brief Constructor.
|
---|
| 26 |
|
---|
| 27 | @param startFrame adds an offset to the current frame number to help evenly distribute updates between frames
|
---|
| 28 | @param cubeMapUpdateInterval update frequency
|
---|
| 29 | @param cubeMapResolution color cubemap resolution
|
---|
| 30 | @param reducedCubeMapResolution reduced sized color cubemap resolution
|
---|
| 31 | @param reducedTexID the id of the texture unit state the resulting cubemap should be bound to
|
---|
| 32 | @param useDistCalc flag to skip cube face update if object is far away
|
---|
| 33 | @param useFaceAngleCalc flag to skip cube face update if face is neglible
|
---|
| 34 | @param distTolerance distance tolerance used in face skip
|
---|
| 35 | @param angleTolerance angle tolerance used in face skip
|
---|
| 36 | @param updateAllFace defines if all cubemap faces should be updated in a frame or only one face per frame
|
---|
[2240] | 37 | @param renderSelf sets if the object should be rendered to the cube map
|
---|
| 38 | @param renderEnvironment sets if the environment should be rendered to the cube map
|
---|
| 39 | @param selfMaterial the material that should be set for the object while rendering the cubemap
|
---|
| 40 | @param environmentMaterial the material that should be set for the environment while rendering the cubemap
|
---|
| 41 | @param getMinMax sets if the minimum and maximum values of the cubemap should be computed
|
---|
| 42 | @param attachToTexUnit sets if this cubemap should be attach to a texture unit of the pass
|
---|
| 43 | @param minVariableName sets the name of the gpu shader program parameter to which the minimum value should be bound to
|
---|
| 44 | @param maxVariableName sets the name of the gpu shader program parameter to which the maximum value should be bound to
|
---|
[790] | 45 | @param pass the pass to operate on
|
---|
| 46 | @param parentRenderable the object to operate on
|
---|
| 47 | @param parentTechniqueGroup the TechniqueGroup this RenderedTechnique is attached to
|
---|
| 48 | */
|
---|
| 49 | OgreConvolvedCubeMapRenderTechnique( unsigned long startFrame,
|
---|
| 50 | unsigned long cubeMapUpdateInterval,
|
---|
| 51 | unsigned int cubeMapResolution,
|
---|
| 52 | unsigned int reducedCubeMapResolution,
|
---|
[1711] | 53 | unsigned char texID,
|
---|
[790] | 54 | bool useDistCalc,
|
---|
| 55 | bool useFaceAngleCalc,
|
---|
| 56 | float distTolerance,
|
---|
| 57 | float angleTolerance,
|
---|
| 58 | bool updateAllFace,
|
---|
[1711] | 59 | bool renderSelf,
|
---|
[1722] | 60 | bool renderEnvironment,
|
---|
| 61 | String selfMaterial,
|
---|
| 62 | String environmentMaterial,
|
---|
[1886] | 63 | bool getMinMax,
|
---|
| 64 | bool attachToTexUnit,
|
---|
| 65 | String minVariableName,
|
---|
| 66 | String maxVariableName,
|
---|
[2355] | 67 | String triggerName,
|
---|
[790] | 68 | Pass* pass,
|
---|
| 69 | OgreRenderable* parentRenderable,
|
---|
| 70 | OgreTechniqueGroup* parentTechniqueGroup
|
---|
| 71 | );
|
---|
| 72 | /**
|
---|
| 73 | @brief Destructor.
|
---|
| 74 | */
|
---|
[2320] | 75 | virtual ~OgreConvolvedCubeMapRenderTechnique();
|
---|
[790] | 76 |
|
---|
| 77 | //inherited
|
---|
| 78 | void update(unsigned long frameNum);
|
---|
| 79 |
|
---|
| 80 | protected:
|
---|
| 81 |
|
---|
| 82 | //inherited
|
---|
| 83 | void reducedCubeMapRunChanged(RenderingRun* run);
|
---|
| 84 | //inherited
|
---|
| 85 | void colorCubeMapRunChanged(RenderingRun* run);
|
---|
| 86 | //inherited
|
---|
| 87 | RenderingRun* createReducedCubeMapRun();
|
---|
| 88 |
|
---|
[836] | 89 | };
|
---|
| 90 |
|
---|
[2240] | 91 | /**
|
---|
| 92 | @brief RenderTechniqueFactory to create OgreConvoledCubeMapRenderTechnique instances.
|
---|
| 93 | */
|
---|
[1711] | 94 | class OgreConvoledCubeMapRenderTechniqueFactory : public OgreCubeMapRenderTechniqueFactory
|
---|
[836] | 95 | {
|
---|
| 96 | public:
|
---|
| 97 |
|
---|
| 98 | OgreConvoledCubeMapRenderTechniqueFactory();
|
---|
| 99 |
|
---|
| 100 | OgreRenderTechnique* createInstance(IllumTechniqueParams* params,
|
---|
| 101 | Pass* pass,
|
---|
| 102 | OgreRenderable* parentRenderable,
|
---|
| 103 | OgreTechniqueGroup* parentTechniqueGroup);
|
---|
| 104 |
|
---|
| 105 |
|
---|
| 106 | unsigned int reducedCubeMapResolution;
|
---|
| 107 | };
|
---|