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 "HierarchicalParticleSystemTechnique.h"
|
---|
12 |
|
---|
13 | /**
|
---|
14 | @brief HierarchicalParticleSystemTechnique used in an OGRE environment.
|
---|
15 | */
|
---|
16 | class OgreHierarchicalParticleSystemTechnique : public OgreRenderTechnique,
|
---|
17 | public HierarchicalParticleSystemTechnique
|
---|
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 impostorUpdateInterval update frequency of the impostor texture (image of the smaller system)
|
---|
25 | @param impostorResolution resolution of the impostor texture
|
---|
26 | @param impostorTexID the id of the texture unit state the impostor image should be bound to
|
---|
27 | @param useDistCalc flag to skip impostor update if object is far away (//not used)
|
---|
28 | @param perspectiveRendering sets if the impostor should be rendered with a perspective projection or orthogonal
|
---|
29 | @param childPSysScriptName name of the small particle system script
|
---|
30 | @param useOwnMaterial use the material for the smaller system that was defined in the particle script
|
---|
31 | @param impostorMaterialName use this specific material for the small particle system
|
---|
32 | @param useVParam bound particle radius to a gpu vertex program parameter
|
---|
33 | @param VParamRadius name of the gpu vertex program parameter the particle radius should be bound to
|
---|
34 | @param useFParam bound particle radius to a gpu fragment program parameter
|
---|
35 | @param FParamRadius name of the gpu fragment program parameter the particle radius should be bound to
|
---|
36 | @param pass the pass to operate on
|
---|
37 | @param parentRenderable the object to operate on
|
---|
38 | @param parentTechniqueGroup the TechniqueGroup this RenderedTechnique is attached to
|
---|
39 | */
|
---|
40 | OgreHierarchicalParticleSystemTechnique(unsigned long startFrame,
|
---|
41 | unsigned long impostorUpdateInterval,
|
---|
42 | unsigned int impostorResolution,
|
---|
43 | unsigned char impostorTexID,
|
---|
44 | bool useDistCalc,
|
---|
45 | bool perspectiveRendering,
|
---|
46 | String childPSysScriptName,
|
---|
47 | bool useOwnMaterial,
|
---|
48 | String impostorMaterialName,
|
---|
49 | bool useVParam,
|
---|
50 | String VParamRadius,
|
---|
51 | bool useFParam,
|
---|
52 | String FParamRadius,
|
---|
53 | Pass* pass,
|
---|
54 | OgreRenderable* parentRenderable,
|
---|
55 | OgreTechniqueGroup* parentTechniqueGroup
|
---|
56 | );
|
---|
57 | /**
|
---|
58 | @brief Destructor.
|
---|
59 | */
|
---|
60 | virtual ~OgreHierarchicalParticleSystemTechnique();
|
---|
61 |
|
---|
62 |
|
---|
63 | protected:
|
---|
64 | /**
|
---|
65 | @brief use this specific material for the small particle system
|
---|
66 | */
|
---|
67 | String impostorMaterialName;
|
---|
68 | /**
|
---|
69 | @brief name of the small particle system script
|
---|
70 | */
|
---|
71 | String childPSysScriptName;
|
---|
72 | /**
|
---|
73 | @brief name of the created child particle system
|
---|
74 | */
|
---|
75 | String childPSysName;
|
---|
76 | /**
|
---|
77 | @brief the id of the texture unit state the impostor image should be bound to
|
---|
78 | */
|
---|
79 | unsigned char impostorTexID;
|
---|
80 | /**
|
---|
81 | @brief use the material for the smaller system that was defined in the particle script
|
---|
82 | */
|
---|
83 | bool useOwnMaterial;
|
---|
84 | /**
|
---|
85 | @brief name of the gpu vertex program parameter the particle radius should be bound to
|
---|
86 | */
|
---|
87 | String VParamRadius;
|
---|
88 | /**
|
---|
89 | @brief name of the gpu fragment program parameter the particle radius should be bound to
|
---|
90 | */
|
---|
91 | String FParamRadius;
|
---|
92 | /**
|
---|
93 | @brief bound particle radius to a gpu vertex program parameter
|
---|
94 | */
|
---|
95 | bool useVParam;
|
---|
96 | /**
|
---|
97 | @brief bound particle radius to a gpu fragment program parameter
|
---|
98 | */
|
---|
99 | bool useFParam;
|
---|
100 |
|
---|
101 | //inherited
|
---|
102 | RenderingRun* createChildPSysRenderingRun();
|
---|
103 | //inherited
|
---|
104 | RenderingRun* createLightVolumeRenderingRun();
|
---|
105 | //inherited
|
---|
106 | virtual void impostorChanged(RenderingRun* run);
|
---|
107 | //inherited
|
---|
108 | virtual void impostorUpdated(RenderingRun* run);
|
---|
109 | };
|
---|
110 |
|
---|
111 | /**
|
---|
112 | @brief RenderTechniqueFactory to create OgreHierarchicalParticleSystemTechnique instances.
|
---|
113 | */
|
---|
114 | class OgreHierarchicalParticleSystemTechniqueFactory : public RenderTechniqueFactory
|
---|
115 | {
|
---|
116 | public:
|
---|
117 |
|
---|
118 | OgreHierarchicalParticleSystemTechniqueFactory();
|
---|
119 |
|
---|
120 | OgreRenderTechnique* createInstance(IllumTechniqueParams* params,
|
---|
121 | Pass* pass,
|
---|
122 | OgreRenderable* parentRenderable,
|
---|
123 | OgreTechniqueGroup* parentTechniqueGroup);
|
---|
124 |
|
---|
125 | virtual bool needMaterialCopy(IllumTechniqueParams* params){return true;}
|
---|
126 |
|
---|
127 | unsigned long impostorUpdateInterval;
|
---|
128 | unsigned int impostorResolution;
|
---|
129 | unsigned long startFrame;
|
---|
130 | bool useDistCalc;
|
---|
131 | unsigned char impostorTexID;
|
---|
132 | bool perspectiveRendering;
|
---|
133 | String impostorMaterialName;
|
---|
134 | String childPSysScriptName;
|
---|
135 | bool useOwnMaterial;
|
---|
136 | String VParamRadius;
|
---|
137 | String FParamRadius;
|
---|
138 | bool useVParam;
|
---|
139 | bool useFParam;
|
---|
140 |
|
---|
141 | };
|
---|