Changeset 2355 for GTP/trunk/Lib/Illum
- Timestamp:
- 05/08/07 14:37:19 (18 years ago)
- Location:
- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreRenderingRun.h
r2333 r2355 115 115 @param rq pointer to the filled Renderqueue instance to set material for 116 116 */ 117 void setMaterialForRenderables(String& materialName, RenderQueue* rq, bool solidsonly = false );117 void setMaterialForRenderables(String& materialName, RenderQueue* rq, bool solidsonly = false, String triggerName = ""); 118 118 /** 119 119 @brief Sets the given material for each Renderable visible from a given camera. … … 130 130 @param shadowcastersonly flag to search for only shadow casters 131 131 */ 132 void setMaterialForVisibles(String& materialName, Camera* cam, bool shadowcastersonly = false, bool solidsonly = false );132 void setMaterialForVisibles(String& materialName, Camera* cam, bool shadowcastersonly = false, bool solidsonly = false, String triggerName = ""); 133 133 /** 134 134 @brief Restores previously stored materials. -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreTechniqueGroup.h
r2320 r2355 29 29 parentSharedRuns->updateBounds(); 30 30 } 31 String getMaterialNameForTrigger(String trigger) 32 { 33 if(triggeredMaterials.find(trigger) == triggeredMaterials.end()) 34 return ""; 35 else return triggeredMaterials[trigger]; 36 } 31 37 32 38 protected: 39 std::map<String, String> triggeredMaterials; 33 40 /** 34 41 @brief Collection of OgreRenderTechniques -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreColorCubeMapRenderTechnique.h
r2320 r2355 65 65 String minVariableName, 66 66 String maxVariableName, 67 String triggerName, 67 68 Pass* pass, 68 69 OgreRenderable* parentRenderable, -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreConvolvedCubeMapRenderTechnique.h
r2320 r2355 65 65 String minVariableName, 66 66 String maxVariableName, 67 String triggerName, 67 68 Pass* pass, 68 69 OgreRenderable* parentRenderable, -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreCubeMapRenderTechnique.h
r2320 r2355 65 65 String minVariableName, 66 66 String maxVariableName, 67 String triggerName, 67 68 Pass* pass, 68 69 OgreRenderable* parentRenderable, … … 109 110 String maxVariableName; 110 111 112 String triggerName; 113 111 114 //inherited 112 115 RenderingRun* createCubeMapRun(); … … 152 155 String minVariableName; 153 156 String maxVariableName; 157 String triggerName; 154 158 }; -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreDistanceCubeMapRenderTechnique.h
r2320 r2355 65 65 String minVariableName, 66 66 String maxVariableName, 67 String triggerName, 67 68 Pass* pass, 68 69 OgreRenderable* parentRenderable, -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgreCubeMapRenderingRun.h
r2320 r2355 54 54 String selfMaterial, 55 55 String environmentMaterial, 56 String envTriggerName, 56 57 bool getMinMax, 57 58 RenderingRunType cubemapRunType); … … 104 105 Vector4 max; 105 106 107 String envTriggerName; 108 106 109 /** 107 110 @brief -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreRenderingRun.cpp
r2333 r2355 13 13 private: 14 14 String materialName; 15 String triggerName; 15 16 std::map<Renderable*, String>* visibleObjects; 16 17 public: 17 18 18 MaterialSetVisitor(String& materialName, std::map<Renderable*, String>* visibleObjects )19 MaterialSetVisitor(String& materialName, std::map<Renderable*, String>* visibleObjects, String trigger = "") 19 20 { 20 21 this->materialName = materialName; … … 29 30 { 30 31 (*visibleObjects)[rend] = rend->getMaterial().getPointer()->getName(); 31 rend->setMaterialName(materialName); 32 String materialToSet = materialName; 33 if(triggerName != "")//we have a trigger here 34 { 35 String triggeredMaterial = 36 ((OgreTechniqueGroup*)rend->getRenderTechniqueGroup()) 37 ->getMaterialNameForTrigger(triggerName); 38 if(triggeredMaterial != "")//a trigger is associated 39 materialToSet = triggeredMaterial; 40 } 41 rend->setMaterialName(materialToSet); 32 42 } 33 43 } … … 40 50 { 41 51 (*visibleObjects)[rend] = rend->getMaterial().getPointer()->getName(); 42 rend->setMaterialName(materialName); 52 String materialToSet = materialName; 53 if(triggerName != "")//we have a trigger here 54 { 55 String triggeredMaterial = 56 ((OgreTechniqueGroup*)rend->getRenderTechniqueGroup()) 57 ->getMaterialNameForTrigger(triggerName); 58 if(triggeredMaterial != "")//a trigger is associated 59 materialToSet = triggeredMaterial; 60 } 61 rend->setMaterialName(materialToSet); 43 62 } 44 63 } … … 127 146 } 128 147 129 void OgreRenderingRun::setMaterialForRenderables(String& materialName, RenderQueue* rq, bool solidsonly )148 void OgreRenderingRun::setMaterialForRenderables(String& materialName, RenderQueue* rq, bool solidsonly, String triggerName) 130 149 { 131 150 SceneManager* sm = Ogre::Root::getSingleton()._getCurrentSceneManager(); … … 144 163 const QueuedRenderableCollection& solids = pPriorityGrp->getSolidsBasic(); 145 164 const QueuedRenderableCollection& transparents = pPriorityGrp->getTransparents(); 146 MaterialSetVisitor visitor(materialName, &visibleObjects );165 MaterialSetVisitor visitor(materialName, &visibleObjects, triggerName); 147 166 solids.acceptVisitor(&visitor, QueuedRenderableCollection::OM_PASS_GROUP); 148 167 if(!solidsonly) … … 166 185 } 167 186 168 void OgreRenderingRun::setMaterialForVisibles(String& materialName, Camera* cam, bool shadowcastersonly, bool solidsonly )187 void OgreRenderingRun::setMaterialForVisibles(String& materialName, Camera* cam, bool shadowcastersonly, bool solidsonly, String triggerName) 169 188 { 170 189 SceneManager* sm = Ogre::Root::getSingleton()._getCurrentSceneManager(); … … 183 202 sm->_findVisibleObjects(cam, shadowcastersonly); 184 203 185 setMaterialForRenderables(materialName, sm->getRenderQueue(), solidsonly );204 setMaterialForRenderables(materialName, sm->getRenderQueue(), solidsonly, triggerName); 186 205 } 187 206 -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreCausticCasterRenderTechnique.cpp
r2320 r2355 132 132 true, 133 133 "", 134 "GameTools/DistanceShader", 134 "GTP/Basic/Distance", 135 "ILLUM_TRIGGER_DISTANCE", 135 136 false, 136 137 ILLUMRUN_DISTANCE_CUBEMAP); -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreColorCubeMapRenderTechnique.cpp
r1930 r2355 21 21 String minVariableName, 22 22 String maxVariableName, 23 String triggerName, 23 24 Pass* pass, 24 25 OgreRenderable* parentRenderable, 25 26 OgreTechniqueGroup* parentTechniqueGroup) 26 :OgreCubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, texID, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, renderEnvironment, selfMaterial, environmentMaterial, layer, getMinMax, attachToTexUnit, minVariableName, maxVariableName, pass, parentRenderable, parentTechniqueGroup),27 :OgreCubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, texID, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, renderEnvironment, selfMaterial, environmentMaterial, layer, getMinMax, attachToTexUnit, minVariableName, maxVariableName, triggerName, pass, parentRenderable, parentTechniqueGroup), 27 28 ColorCubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, renderEnvironment, layer, parentRenderable, parentTechniqueGroup), 28 29 CubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, renderEnvironment, layer, parentRenderable, parentTechniqueGroup), … … 128 129 minVariableName, 129 130 maxVariableName, 131 triggerName, 130 132 pass, 131 133 parentRenderable, -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreConvolvedCubeMapRenderTechnique.cpp
r1886 r2355 22 22 String minVariableName, 23 23 String maxVariableName, 24 String triggerName, 24 25 Pass* pass, 25 26 OgreRenderable* parentRenderable, 26 27 OgreTechniqueGroup* parentTechniqueGroup) 27 28 : 28 OgreCubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, texID, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, renderEnvironment, selfMaterial, environmentMaterial, layer, getMinMax, attachToTexUnit, minVariableName, maxVariableName, pass, parentRenderable, parentTechniqueGroup),29 OgreCubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, texID, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, renderEnvironment, selfMaterial, environmentMaterial, layer, getMinMax, attachToTexUnit, minVariableName, maxVariableName, triggerName, pass, parentRenderable, parentTechniqueGroup), 29 30 CubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, renderEnvironment, layer, parentRenderable, parentTechniqueGroup), 30 31 ConvolvedCubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, reducedCubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, renderEnvironment, parentRenderable, parentTechniqueGroup), … … 135 136 minVariableName, 136 137 maxVariableName, 138 triggerName, 137 139 pass, 138 140 parentRenderable, -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreCubeMapRenderTechnique.cpp
r1930 r2355 21 21 String minVariableName, 22 22 String maxVariableName, 23 String triggerName, 23 24 Pass* pass, 24 25 OgreRenderable* parentRenderable, … … 92 93 selfMaterial, 93 94 environmentMaterial, 95 triggerName, 94 96 getMinMax, 95 97 cubemapLayer); … … 221 223 OgreCubeMapRenderTechniqueFactory* f = (OgreCubeMapRenderTechniqueFactory*) factory; 222 224 f->attachToTexUnit = StringConverter::parseBool(params); 225 } 226 227 void parseTriggerName(String& params, RenderTechniqueFactory* factory) 228 { 229 OgreCubeMapRenderTechniqueFactory* f = (OgreCubeMapRenderTechniqueFactory*) factory; 230 f->triggerName = params; 223 231 } 224 232 … … 248 256 this->attributeParsers.insert(AttribParserList::value_type("min_var_name", (ILLUM_ATTRIBUTE_PARSER) parseMinVarName)); 249 257 this->attributeParsers.insert(AttribParserList::value_type("max_var_name", (ILLUM_ATTRIBUTE_PARSER) parseMaxVarName)); 258 this->attributeParsers.insert(AttribParserList::value_type("trigger_name", (ILLUM_ATTRIBUTE_PARSER) parseTriggerName)); 250 259 251 260 } … … 271 280 minVariableName = ""; 272 281 maxVariableName = ""; 282 triggerName = ""; 273 283 274 284 } … … 302 312 minVariableName, 303 313 maxVariableName, 314 triggerName, 304 315 pass, 305 316 parentRenderable, -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreDepthShadowReceiverRenderTechnique.cpp
r2333 r2355 58 58 Pass* newpass = techn->createPass(); 59 59 passes.push_back(newpass); 60 61 newpass->setVertexProgram(shadowVertexProgram);62 newpass->setFragmentProgram(shadowFragmentProgram);63 64 GpuProgramParameters* Vparams = newpass->getVertexProgramParameters().getPointer();65 Vparams->setNamedAutoConstant(WorldViewProjParamName,66 GpuProgramParameters::ACT_WORLDVIEWPROJ_MATRIX);67 Vparams->setNamedAutoConstant(WorldParamName,68 GpuProgramParameters::ACT_WORLD_MATRIX);69 GpuProgramParameters* Fparams = newpass->getFragmentProgramParameters().getPointer();70 60 71 61 TextureUnitState* st = newpass->createTextureUnitState(); … … 122 112 depthRun->getDepthMapTextureName()); 123 113 124 //TODO: set matrices 114 //TODO: ask programs from illummanager 115 passes.at(i)->setVertexProgram(shadowVertexProgram); 116 passes.at(i)->setFragmentProgram(shadowFragmentProgram); 117 125 118 GpuProgramParametersSharedPtr fpParams = passes.at(i)->getFragmentProgramParameters(); 126 119 GpuProgramParametersSharedPtr vpParams = passes.at(i)->getVertexProgramParameters(); 127 120 121 122 vpParams->setNamedAutoConstant(WorldViewProjParamName, 123 GpuProgramParameters::ACT_WORLDVIEWPROJ_MATRIX); 124 vpParams->setNamedAutoConstant(WorldParamName, 125 GpuProgramParameters::ACT_WORLD_MATRIX); 126 128 127 if(setLightViewProjMatrix) 129 128 vpParams->setNamedConstant(lightViewProjParamName, depthRun->getLightViewProjMatrix()); -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreDistanceCubeMapRenderTechnique.cpp
r2265 r2355 21 21 String minVariableName, 22 22 String maxVariableName, 23 String triggerName, 23 24 Pass* pass, 24 25 OgreRenderable* parentRenderable, 25 26 OgreTechniqueGroup* parentTechniqueGroup) 26 27 : 27 OgreCubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, texID, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, renderEnvironment, selfMaterial, environmentMaterial, layer, getMinMax, attachToTexUnit, minVariableName, maxVariableName, pass, parentRenderable, parentTechniqueGroup),28 OgreCubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, texID, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, renderEnvironment, selfMaterial, environmentMaterial, layer, getMinMax, attachToTexUnit, minVariableName, maxVariableName, triggerName, pass, parentRenderable, parentTechniqueGroup), 28 29 CubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, renderEnvironment, layer, parentRenderable, parentTechniqueGroup), 29 30 DistanceCubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, renderEnvironment, layer, parentRenderable, parentTechniqueGroup), … … 107 108 environmentMaterial = "GTP/Basic/Distance"; 108 109 selfMaterial = "GTP/Basic/Distance"; 110 triggerName = "ILLUM_TRIGGER_DISTANCE"; 109 111 OgreCubeMapRenderTechniqueFactory::parseParams(params); 110 112 parseParams(params); … … 129 131 minVariableName, 130 132 maxVariableName, 133 triggerName, 131 134 pass, 132 135 parentRenderable, -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreCubeMapRenderingRun.cpp
r2321 r2355 18 18 String selfMaterial, 19 19 String environmentMaterial, 20 String envTriggerName, 20 21 bool getMinMax, 21 22 RenderingRunType cubemapRunType) … … 25 26 26 27 { 28 this->envTriggerName = envTriggerName; 27 29 this->getMinMax = getMinMax; 28 30 this->cubemapRunType = cubemapRunType; … … 83 85 if(useEnvMaterial) 84 86 { 85 setMaterialForVisibles(environmentMaterial, cam );87 setMaterialForVisibles(environmentMaterial, cam, false, false, envTriggerName); 86 88 //sm->_queueSkiesForRendering(cam); 87 89 } -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreSceneCameraDepthRenderingRun.cpp
r2321 r2355 43 43 { 44 44 45 setMaterialForVisibles(String("GTP/Basic/CameraDepth"), playerCamera, false, true );45 setMaterialForVisibles(String("GTP/Basic/CameraDepth"), playerCamera, false, true, "ILLUM_TRIGGER_CAMERADEPTH"); 46 46 47 47 RenderTarget* rt = depthTexture->getBuffer().getPointer()->getRenderTarget();
Note: See TracChangeset
for help on using the changeset viewer.