[3255] | 1 | #pragma once
|
---|
| 2 | #include "RenderTechnique.h"
|
---|
| 3 |
|
---|
| 4 | /**
|
---|
| 5 | @brief Base abstract class __declspec( dllexport ) of a caustic caster.
|
---|
| 6 |
|
---|
| 7 | This technique defines that the given object needs a caustic photon map and a caustic cubemap.
|
---|
| 8 | The caustic cube map will be used by caustic receivers.
|
---|
| 9 | */
|
---|
| 10 | class __declspec( dllexport ) CausticCasterRenderTechnique : virtual public RenderTechnique
|
---|
| 11 | {
|
---|
| 12 | public:
|
---|
| 13 | /**
|
---|
| 14 | @brief Constructor.
|
---|
| 15 |
|
---|
| 16 | @param startFrame adds an offset to the current frame number to help evenly distribute updates between frames
|
---|
| 17 | @param photonMapUpdateInterval photon map and caustic cubemap update frequency
|
---|
| 18 | @param photonMapResolution photon map resolution
|
---|
| 19 | @param causticCubeMapResolution caustic cubemap resolution
|
---|
| 20 | @param updateAllFace defines if all cubemap faces should be updated in a frame or only one face per frame
|
---|
| 21 | @param useDistance tells if a distance cubemap impostor should be used in photon hit calculation (recommended)
|
---|
| 22 | @param parentRenderable the object to operate on
|
---|
| 23 | @param parentTechniqueGroup the TechniqueGroup this RenderedTechnique is attached to
|
---|
| 24 | */
|
---|
| 25 | CausticCasterRenderTechnique( unsigned long startFrame,
|
---|
| 26 | unsigned long photonMapUpdateInterval,
|
---|
| 27 | unsigned int photonMapResolution,
|
---|
| 28 | unsigned int causticCubeMapResolution,
|
---|
| 29 | bool updateAllFace,
|
---|
| 30 | bool useDistance,
|
---|
| 31 | ElementaryRenderable* parentRenderable,
|
---|
| 32 | TechniqueGroup* parentTechniqueGroup
|
---|
| 33 | );
|
---|
| 34 | virtual ~CausticCasterRenderTechnique();
|
---|
| 35 |
|
---|
| 36 | //inherited
|
---|
| 37 | void runChanged(RenderingRunType runType, RenderingRun* run);
|
---|
| 38 | //inherited
|
---|
| 39 | virtual void runUpdated(RenderingRunType runType, RenderingRun* run);
|
---|
| 40 |
|
---|
| 41 | protected:
|
---|
| 42 | /**
|
---|
| 43 | @brief defines if all cubemap faces should be updated in a frame or only one face per frame
|
---|
| 44 | */
|
---|
| 45 | bool updateAllFace;
|
---|
| 46 | /**
|
---|
| 47 | @brief tells if a distance cubemap impostor should be used in photon hit calculation (recommended)
|
---|
| 48 | */
|
---|
| 49 | bool useDistance;
|
---|
| 50 |
|
---|
| 51 | /**
|
---|
| 52 | @brief photonmap update frequency
|
---|
| 53 | */
|
---|
| 54 | unsigned long photonMapUpdateInterval;
|
---|
| 55 | /**
|
---|
| 56 | @brief photonmap resolution
|
---|
| 57 | */
|
---|
| 58 | unsigned int photonMapResolution;
|
---|
| 59 | /**
|
---|
| 60 | @brief caustic cubemap resolution
|
---|
| 61 | */
|
---|
| 62 | unsigned int causticCubeMapResolution;
|
---|
| 63 | /**
|
---|
| 64 | @brief offset in frame number used during update
|
---|
| 65 | */
|
---|
| 66 | unsigned long startFrame;
|
---|
| 67 |
|
---|
| 68 | /**
|
---|
| 69 | @brief Called if the changed run is a PhotonMapRenderingRun.
|
---|
| 70 |
|
---|
| 71 | @param run pointer to the changed PhotonMapRenderingRun
|
---|
| 72 | */
|
---|
| 73 | virtual void photonMapRunChanged(RenderingRun* run) = 0;
|
---|
| 74 | /**
|
---|
| 75 | @brief Called if the changed run is a CausticCubeMapRenderingRun.
|
---|
| 76 |
|
---|
| 77 | @param run pointer to the changed CausticCubeMapRenderingRun
|
---|
| 78 | */
|
---|
| 79 | virtual void causticCubeMapRunChanged(RenderingRun* run) = 0;
|
---|
| 80 | /**
|
---|
| 81 | @brief Called if the changed run is a DistanceCubeMapRenderingRun.
|
---|
| 82 |
|
---|
| 83 | @param run pointer to the changed DistanceCubeMapRenderingRun
|
---|
| 84 | */
|
---|
| 85 | virtual void distanceCubeMapRunChanged(RenderingRun* run) = 0;
|
---|
| 86 | /**
|
---|
| 87 | @brief Called if the updated run is a DistanceCubeMapRenderingRun.
|
---|
| 88 |
|
---|
| 89 | @param run pointer to the updated DistanceCubeMapRenderingRun
|
---|
| 90 | */
|
---|
| 91 | virtual void distanceCubeMapRunUpdated(RenderingRun* run) = 0;
|
---|
| 92 | /**
|
---|
| 93 | @brief Creates a PhotonMapRenderingRun.
|
---|
| 94 |
|
---|
| 95 | @return the new PhotonMapRenderingRun instance.
|
---|
| 96 | */
|
---|
| 97 | virtual RenderingRun* createPhotonMapRun() = 0;
|
---|
| 98 | /**
|
---|
| 99 | @brief Creates a CausticCubeMapRenderingRun.
|
---|
| 100 |
|
---|
| 101 | @return the new CausticCubeMapRenderingRun instance.
|
---|
| 102 | */
|
---|
| 103 | virtual RenderingRun* createCausticCubeMapRun() = 0;
|
---|
| 104 | /**
|
---|
| 105 | @brief Creates a DistanceCubeMapRenderingRun.
|
---|
| 106 |
|
---|
| 107 | @return the new DistanceCubeMapRenderingRun instance.
|
---|
| 108 | */
|
---|
| 109 | virtual RenderingRun* createDistanceCubeMapRun() = 0;
|
---|
| 110 | }; |
---|