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 "IllumVolumeRenderTechnique.h"
|
---|
12 |
|
---|
13 | /**
|
---|
14 | @brief IllumVolumeRenderTechnique used in an OGRE environment.
|
---|
15 | */
|
---|
16 | class OgreIllumVolumeRenderTechnique : public OgreRenderTechnique,
|
---|
17 | public IllumVolumeRenderTechnique
|
---|
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 illumVolumeUpdateInterval the update frequency of the light volume
|
---|
25 | @param illumTextureResolution the resolution of the light volume texture
|
---|
26 | @param textureDepth the number of layers to use (should be set to 1)
|
---|
27 | @param illumTexID the id of the texture unit state the resulting illum volume should be bound to
|
---|
28 | @param useDistCalc flag to skip updates if the shaded particle system is far away (not used)
|
---|
29 | @param materialName the name of the material that is used while rendering the light volume
|
---|
30 | @param lightMatrixGPUParamName the name of the gpu program parameter where the light matrix should be bound to
|
---|
31 | @param useHierarchicalImpostor set this flag to true if the particle system is a hierarchical particle system
|
---|
32 | @param impostorTexID the id of the texture unit state where the impostor image of the smaller system should be bound to
|
---|
33 | @param pass the pass to operate on
|
---|
34 | @param parentRenderable the object to operate on
|
---|
35 | @param parentTechniqueGroup the TechniqueGroup this RenderedTechnique is attached to
|
---|
36 | */
|
---|
37 | OgreIllumVolumeRenderTechnique(unsigned long startFrame,
|
---|
38 | unsigned long illumVolumeUpdateInterval,
|
---|
39 | unsigned int illumTextureResolution,
|
---|
40 | unsigned int textureDepth,
|
---|
41 | unsigned char illumTexID,
|
---|
42 | bool useDistCalc,
|
---|
43 | String materialName,
|
---|
44 | String lightMatrixGPUParamName,
|
---|
45 | bool useHierarchicalImpostor,
|
---|
46 | unsigned char impostorTexID,
|
---|
47 | Pass* pass,
|
---|
48 | OgreRenderable* parentRenderable,
|
---|
49 | OgreTechniqueGroup* parentTechniqueGroup
|
---|
50 | );
|
---|
51 | /**
|
---|
52 | @brief Destructor.
|
---|
53 | */
|
---|
54 | virtual ~OgreIllumVolumeRenderTechnique();
|
---|
55 |
|
---|
56 | protected:
|
---|
57 | /**
|
---|
58 | @brief the name of the material that is used while rendering the light volume
|
---|
59 | */
|
---|
60 | String materialName;
|
---|
61 | /**
|
---|
62 | @brief the id of the texture unit state the resulting illumevolume should be bound to
|
---|
63 | */
|
---|
64 | unsigned char illumTexID;
|
---|
65 | /**
|
---|
66 | @brief the name of the gpu program parameter where the light matrix should be bound to
|
---|
67 | */
|
---|
68 | String lightMatrixGPUParamName;
|
---|
69 | /**
|
---|
70 | @brief the id of the texture unit state where the impostor image of the smaller system should be bound to
|
---|
71 | */
|
---|
72 | unsigned char impostorTexID;
|
---|
73 |
|
---|
74 | //inherited
|
---|
75 | RenderingRun* createLightVolumeRenderingRun();
|
---|
76 | //inherited
|
---|
77 | void lightVolumeChanged(RenderingRun* run);
|
---|
78 | //inherited
|
---|
79 | void lightVolumeUpdated(RenderingRun* run);
|
---|
80 | //inherited
|
---|
81 | void hierarchicalImpostorUpdated(RenderingRun* run);
|
---|
82 | };
|
---|
83 |
|
---|
84 | /**
|
---|
85 | @brief RenderTechniqueFactory to create OgreIllumVolumeRenderTechnique instances.
|
---|
86 | */
|
---|
87 | class OgreIllumVolumeRenderTechniqueFactory : public RenderTechniqueFactory
|
---|
88 | {
|
---|
89 | public:
|
---|
90 |
|
---|
91 | OgreIllumVolumeRenderTechniqueFactory();
|
---|
92 |
|
---|
93 | OgreRenderTechnique* createInstance(IllumTechniqueParams* params,
|
---|
94 | Pass* pass,
|
---|
95 | OgreRenderable* parentRenderable,
|
---|
96 | OgreTechniqueGroup* parentTechniqueGroup);
|
---|
97 |
|
---|
98 | virtual bool needMaterialCopy(IllumTechniqueParams* params){return true;}
|
---|
99 |
|
---|
100 | String materialName;
|
---|
101 | unsigned char illumTexID;
|
---|
102 | unsigned long startFrame;
|
---|
103 | unsigned long illumVolumeUpdateInterval;
|
---|
104 | unsigned int illumTextureResolution;
|
---|
105 | unsigned int textureDepth;
|
---|
106 | bool useDistCalc;
|
---|
107 | String lightMatrixGPUParamName;
|
---|
108 | unsigned char impostorTexID;
|
---|
109 | bool useHierarchicalImpostor;
|
---|
110 | };
|
---|