- Timestamp:
- 09/11/06 15:30:44 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreHierarchicalParticleSystemTechnique.cpp
r1062 r1330 14 14 bool useOwnMaterial, 15 15 String impostorMaterialName, 16 bool useVParam, 17 String VParamRadius, 18 bool useFParam, 19 String FParamRadius, 16 20 Pass* pass, 17 21 OgreRenderable* parentRenderable, … … 25 29 this->impostorMaterialName = impostorMaterialName; 26 30 this->useOwnMaterial = useOwnMaterial; 31 this->VParamRadius = VParamRadius; 32 this->FParamRadius = FParamRadius; 33 this->useVParam = useVParam; 34 this->useFParam = useFParam; 27 35 28 36 //create the Particle system … … 36 44 sharedRuns->addRun(ILLUMRUN_HPP_IMPOSTOR, createChildPSysRenderingRun()); 37 45 46 ((OgreChildPSystemRenderingRun*) sharedRuns->getRun(ILLUMRUN_HPP_IMPOSTOR)->asOgreRenderingRun())->setNode(node); 38 47 impostorChanged(sharedRuns->getRun(ILLUMRUN_HPP_IMPOSTOR)); 39 48 } … … 65 74 } 66 75 76 void OgreHierarchicalParticleSystemTechnique::update(unsigned long frameNum) 77 { 78 HierarchicalParticleSystemTechnique::update(frameNum); 79 80 OgreChildPSystemRenderingRun* r = (OgreChildPSystemRenderingRun*) 81 sharedRuns->getRun(ILLUMRUN_HPP_IMPOSTOR)->asOgreRenderingRun(); 82 float radius = r->getSmallSysRadius(); 83 if(useVParam) 84 pass->getVertexProgramParameters()->setNamedConstant(VParamRadius, radius); 85 if(useFParam) 86 pass->getFragmentProgramParameters()->setNamedConstant(FParamRadius, radius); 87 } 88 67 89 ///Technique Parsers 68 90 namespace HPSParsers … … 129 151 f->childPSysScriptName = params; 130 152 } 153 void parseVparamRadius(String& params, RenderTechniqueFactory* factory) 154 { 155 OgreHierarchicalParticleSystemTechniqueFactory* f = (OgreHierarchicalParticleSystemTechniqueFactory*) factory; 156 f->VParamRadius = params; 157 } 158 void parseFparamRadius(String& params, RenderTechniqueFactory* factory) 159 { 160 OgreHierarchicalParticleSystemTechniqueFactory* f = (OgreHierarchicalParticleSystemTechniqueFactory*) factory; 161 f->FParamRadius = params; 162 } 131 163 132 164 … … 148 180 this->attributeParsers.insert(AttribParserList::value_type("particle_script", (ILLUM_ATTRIBUTE_PARSER) parseScriptName)); 149 181 this->attributeParsers.insert(AttribParserList::value_type("material", (ILLUM_ATTRIBUTE_PARSER) parseMaterialName)); 182 this->attributeParsers.insert(AttribParserList::value_type("vparam_radius", (ILLUM_ATTRIBUTE_PARSER) parseFparamRadius)); 183 this->attributeParsers.insert(AttribParserList::value_type("fparam_radius", (ILLUM_ATTRIBUTE_PARSER) parseVparamRadius)); 150 184 151 185 } … … 165 199 impostorMaterialName = ""; 166 200 childPSysScriptName = ""; 167 bool useOwnMaterial = true; 201 useOwnMaterial = true; 202 VParamRadius = ""; 203 FParamRadius = ""; 204 useVParam = false; 205 useFParam = false; 168 206 169 207 parseParams(params); … … 179 217 useOwnMaterial, 180 218 impostorMaterialName, 219 useVParam, 220 VParamRadius, 221 useFParam, 222 FParamRadius, 181 223 pass, 182 224 parentRenderable,
Note: See TracChangeset
for help on using the changeset viewer.