- Timestamp:
- 06/26/06 09:52:08 (19 years ago)
- Location:
- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreCausticCasterRenderTechnique.cpp
r949 r1055 15 15 bool updateAllFace, 16 16 bool useDistance, 17 float attenuation, 17 18 Pass* pass, 18 19 OgreRenderable* parentRenderable, … … 22 23 RenderTechnique( parentRenderable, parentTechniqueGroup) 23 24 { 25 this->attenuation = attenuation; 24 26 this->photonMapMaterialName = photonMapMaterialName; 25 27 … … 103 105 causticMapMaterialName, 104 106 photonMapTexID, 105 updateAllFace 107 updateAllFace, 108 attenuation 106 109 ); 107 110 … … 185 188 OgreCausticCasterRenderTechniqueFactory* f = (OgreCausticCasterRenderTechniqueFactory*) factory; 186 189 f->causticMapMaterialName = params; 190 } 191 192 void parseAttenuation(String& params, RenderTechniqueFactory* factory) 193 { 194 OgreCausticCasterRenderTechniqueFactory* f = (OgreCausticCasterRenderTechniqueFactory*) factory; 195 f->attenuation = StringConverter::parseReal(params); 187 196 } 188 197 } … … 206 215 this->attributeParsers.insert(AttribParserList::value_type("distance_impostor", (ILLUM_ATTRIBUTE_PARSER) parseUseDistance)); 207 216 this->attributeParsers.insert(AttribParserList::value_type("update_all_face", (ILLUM_ATTRIBUTE_PARSER) parseUpdateAllFace)); 208 217 this->attributeParsers.insert(AttribParserList::value_type("attenuation", (ILLUM_ATTRIBUTE_PARSER) parseAttenuation)); 218 209 219 } 210 220 … … 216 226 { 217 227 //reset parameters 228 attenuation = 1.0; 218 229 startFrame = 1; 219 230 photonMapUpdateInterval = 1; … … 237 248 photonMapTexID, 238 249 updateAllFace, 239 useDistance, 250 useDistance, 251 attenuation, 240 252 pass, 241 253 parentRenderable, -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreCausticRecieverRenderTechnique.cpp
r949 r1055 106 106 Fparams->setNamedConstant("cubeMapCameraPosition", 107 107 causticCasters.at(i)->getRootPosition(ILLUMRUN_CAUSTIC_CUBEMAP)); 108 Fparams->setNamedConstant("attenuation", cauCubeRun->getAttenuation()); 108 109 passes.at(i)->setActive(true); 109 110 } … … 135 136 f->causticFragmentProgram = params; 136 137 } 138 137 139 } 138 140 OgreCausticRecieverRenderTechniqueFactory::OgreCausticRecieverRenderTechniqueFactory() … … 145 147 this->attributeParsers.insert(AttribParserList::value_type("vertex_program_name", (ILLUM_ATTRIBUTE_PARSER) parseVertexProgram)); 146 148 this->attributeParsers.insert(AttribParserList::value_type("fragment_program_name", (ILLUM_ATTRIBUTE_PARSER) parseFragmentProgram)); 149 147 150 } 148 151 -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreDepthShadowRecieverRenderTechnique.cpp
r949 r1055 52 52 TextureUnitState* st = newpass->createTextureUnitState(); 53 53 st->setTextureFiltering(TFO_BILINEAR); 54 st = newpass->createTextureUnitState(); 55 st->setTextureFiltering(TFO_BILINEAR); 54 56 55 57 newpass->setSceneBlending(SBT_MODULATE); 56 newpass->setDepthBias( 5);58 newpass->setDepthBias(7); 57 59 techn->movePass(lastpass, index); 58 60 } … … 93 95 94 96 passes.at(i)->getTextureUnitState(0)->setTextureName( 95 depthRun->getDepthMapTextureName()); 97 depthRun->getDepthMapTextureName(0)); 98 passes.at(i)->getTextureUnitState(1)->setTextureName( 99 depthRun->getDepthMapTextureName(1)); 96 100 97 101 //TODO: set matrices 98 102 GpuProgramParametersSharedPtr fpParams = passes.at(i)->getFragmentProgramParameters(); 99 fpParams->setNamedConstant("lightView", depthRun->getLightViewMatrix()); 100 fpParams->setNamedConstant("lightViewProj", depthRun->getLightViewProjMatrix()); 103 fpParams->setNamedConstant("lightView", depthRun->getLightViewMatrix(0)); 104 fpParams->setNamedConstant("lightViewProj", depthRun->getLightViewProjMatrix(0)); 105 fpParams->setNamedConstant("lightView2", depthRun->getLightViewMatrix(1)); 106 fpParams->setNamedConstant("lightViewProj2", depthRun->getLightViewProjMatrix(1)); 101 107 102 108 passes.at(i)->setActive(true); -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreSBBRenderTechnique.cpp
r874 r1055 13 13 { 14 14 this->depthTexID = depthTexID; 15 OgreIlluminationManager::getSingleton().createGlobalRun(ILLUMRUN_SCENE_CAMERA_DEPTH);16 15 16 OgreIlluminationManager::getSingleton().createGlobalRun(ILLUMRUN_SCENE_CAMERA_DEPTH); 17 17 18 18 OgreSceneCameraDepthRenderingRun* run = (OgreSceneCameraDepthRenderingRun*) 19 19 OgreIlluminationManager::getSingleton().getGlobalRun(ILLUMRUN_SCENE_CAMERA_DEPTH)->asOgreRenderingRun(); 20 21 Root::getSingleton().addFrameListener(this); 22 OgreIlluminationManager::getSingleton().getMainViewport() 23 ->getTarget()->addListener(this); 24 OgreIlluminationManager::getSingleton().addUpdateListener(this); 20 25 21 26 pass->getTextureUnitState(depthTexID)->setTextureName(run->getDepthTextureName()); 22 27 28 } 29 30 void OgreSBBRenderTechnique::preAllUpdates() 31 { 32 lastVisibility = parentOgreRenderable->isVisible(); 33 parentOgreRenderable->setVisible(false); 34 } 35 void OgreSBBRenderTechnique::preRenderTargetUpdate (const RenderTargetEvent &evt) 36 { 37 //parentOgreRenderable->setVisible(lastVisibility); 38 } 39 void OgreSBBRenderTechnique::postRenderTargetUpdate (const RenderTargetEvent &evt) 40 { 41 //parentOgreRenderable->setVisible(false); 42 } 43 bool OgreSBBRenderTechnique::frameEnded (const FrameEvent &evt) 44 { 45 46 return true; 47 } 48 void OgreSBBRenderTechnique::postAllUpdates() 49 { 50 parentOgreRenderable->setVisible(lastVisibility); 23 51 } 24 52
Note: See TracChangeset
for help on using the changeset viewer.