[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 "OgreRenderTechnique.h"
|
---|
| 11 | #include "CausticCasterRenderTechnique.h"
|
---|
| 12 |
|
---|
| 13 | /**
|
---|
| 14 | @brief CausticCasterRenderTechnique used in an OGRE environment.
|
---|
| 15 | */
|
---|
| 16 | class OgreCausticCasterRenderTechnique : public OgreRenderTechnique,
|
---|
| 17 | public CausticCasterRenderTechnique
|
---|
| 18 | {
|
---|
| 19 | public:
|
---|
| 20 | /**
|
---|
| 21 | @brief Constructor.
|
---|
| 22 |
|
---|
| 23 | @param startFrame adds an offset to the current frame number to help evenly distribute updates between frames
|
---|
| 24 | @param photonMapUpdateInterval photon map and caustic cubemap update frequency
|
---|
| 25 | @param photonMapResolution photon map resolution
|
---|
| 26 | @param causticCubeMapResolution caustic cubemap resolution
|
---|
| 27 | @param photonMapMaterialName the name of the material should be used when rendering the choton hit map
|
---|
| 28 | @param causticMapMaterialName the name of the material that should be used when rendering the caustic cubemap
|
---|
| 29 | @param photonMapTexID the texture unit state id of the caustic map generation material where the photonhit map should be bound to
|
---|
| 30 | @param updateAllFace defines if all cubemap faces should be updated in a frame or only one face per frame
|
---|
| 31 | @param useDistance tells if a distance cubemap impostor should be used in photon hit calculation (recommended)
|
---|
| 32 | @param pass the pass to operate on
|
---|
| 33 | @param parentRenderable the object to operate on
|
---|
| 34 | @param parentTechniqueGroup the TechniqueGroup this RenderedTechnique is attached to
|
---|
| 35 | */
|
---|
| 36 | OgreCausticCasterRenderTechnique( unsigned long startFrame,
|
---|
| 37 | unsigned long photonMapUpdateInterval,
|
---|
| 38 | unsigned int photonMapResolution,
|
---|
| 39 | unsigned int custicCubeMapResolution,
|
---|
| 40 | String photonMapMaterialName,
|
---|
| 41 | String causticMapMaterialName,
|
---|
| 42 | unsigned char photonMapTexID,
|
---|
| 43 | bool updateAllFace,
|
---|
| 44 | bool useDistance,
|
---|
[1055] | 45 | float attenuation,
|
---|
[1351] | 46 | bool useTriangles,
|
---|
[790] | 47 | Pass* pass,
|
---|
| 48 | OgreRenderable* parentRenderable,
|
---|
| 49 | OgreTechniqueGroup* parentTechniqueGroup
|
---|
| 50 | );
|
---|
| 51 | /**
|
---|
| 52 | @brief Destructor.
|
---|
| 53 | */
|
---|
| 54 | ~OgreCausticCasterRenderTechnique();
|
---|
| 55 | /**
|
---|
| 56 | @brief Returns the name of the created caustic cubemap.
|
---|
| 57 |
|
---|
| 58 | @return name of the caustic cubemap texture
|
---|
| 59 | */
|
---|
| 60 | String& getCausticCubeMapName();
|
---|
[1055] | 61 | float getAttenuation(){return attenuation;}
|
---|
[790] | 62 |
|
---|
| 63 | protected:
|
---|
[1055] | 64 |
|
---|
[790] | 65 | /**
|
---|
| 66 | @brief name of the created photon hit map texture
|
---|
| 67 | */
|
---|
| 68 | String photonMapMaterialName;
|
---|
| 69 | /**
|
---|
| 70 | @brief name of the created caustic cubemap texture
|
---|
| 71 | */
|
---|
| 72 | String causticMapMaterialName;
|
---|
| 73 | /**
|
---|
| 74 | @brief the texture unit state id of the caustic map generation material where the photonhit map should be bound to.
|
---|
| 75 | */
|
---|
| 76 | unsigned char photonMapTexID;
|
---|
[1055] | 77 | float attenuation;
|
---|
[1351] | 78 | bool useTriangles;
|
---|
[790] | 79 |
|
---|
| 80 | //inherited
|
---|
[1055] | 81 | void photonMapRunChanged(RenderingRun* run);
|
---|
[790] | 82 | //inherited
|
---|
[1055] | 83 | void causticCubeMapRunChanged(RenderingRun* run);
|
---|
[790] | 84 | //inherited
|
---|
[1055] | 85 | void distanceCubeMapRunChanged(RenderingRun* run);
|
---|
[790] | 86 | //inherited
|
---|
[949] | 87 | void distanceCubeMapRunUpdated(RenderingRun* run);
|
---|
| 88 | //inherited
|
---|
[1055] | 89 | RenderingRun* createPhotonMapRun();
|
---|
[790] | 90 | //inherited
|
---|
[1055] | 91 | RenderingRun* createCausticCubeMapRun();
|
---|
[790] | 92 | //inherited
|
---|
[1055] | 93 | RenderingRun* createDistanceCubeMapRun();
|
---|
[836] | 94 | };
|
---|
| 95 |
|
---|
| 96 |
|
---|
| 97 | class OgreCausticCasterRenderTechniqueFactory : public RenderTechniqueFactory
|
---|
| 98 | {
|
---|
| 99 | public:
|
---|
| 100 |
|
---|
| 101 | OgreCausticCasterRenderTechniqueFactory();
|
---|
| 102 |
|
---|
| 103 | OgreRenderTechnique* createInstance(IllumTechniqueParams* params,
|
---|
| 104 | Pass* pass,
|
---|
| 105 | OgreRenderable* parentRenderable,
|
---|
| 106 | OgreTechniqueGroup* parentTechniqueGroup);
|
---|
| 107 |
|
---|
| 108 |
|
---|
[1055] | 109 | float attenuation;
|
---|
[836] | 110 | unsigned long startFrame;
|
---|
| 111 | unsigned long photonMapUpdateInterval;
|
---|
| 112 | unsigned int photonMapResolution;
|
---|
| 113 | unsigned int causticCubeMapResolution;
|
---|
| 114 | String photonMapMaterialName;
|
---|
| 115 | String causticMapMaterialName;
|
---|
| 116 | unsigned char photonMapTexID;
|
---|
| 117 | bool updateAllFace;
|
---|
| 118 | bool useDistance;
|
---|
[1351] | 119 | bool useTriangles;
|
---|
[836] | 120 |
|
---|
| 121 |
|
---|
| 122 | };
|
---|