- Timestamp:
- 10/17/06 09:21:50 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreDepthShadowRecieverRenderTechnique.cpp
r1130 r1628 51 51 52 52 TextureUnitState* st = newpass->createTextureUnitState(); 53 st->setTextureFiltering(TFO_ANISOTROPIC); 53 st->setTextureFiltering(TFO_ANISOTROPIC); 54 st->setTextureAddressingMode(TextureUnitState::TAM_BORDER); 55 st->setTextureBorderColour(ColourValue::White); 54 56 55 57 newpass->setSceneBlending(SBT_MODULATE); … … 73 75 100000.0, 74 76 lights); 75 77 76 78 //fill passes 79 unsigned int l = 0; 77 80 for(unsigned int i = 0; i < passes.size(); i++) 78 81 { 79 if(lights.size() > i) 82 while(lights.size() != l && !lights.at(l)->getCastShadows()) 83 l++; 84 85 if(lights.size() > l) 80 86 { 81 //create run if not exists82 OgreIlluminationManager::getSingleton().createPerLightRun(lights.at(i)->getName(),83 ILLUMRUN_DEPTH_SHADOWMAP);84 //update light depth map85 OgreIlluminationManager::getSingleton().updatePerLightRun(lights.at(i)->getName(),86 ILLUMRUN_DEPTH_SHADOWMAP,87 frameNum);88 87 89 //set texture to pass 90 OgreDepthShadowMapRenderingRun* depthRun = 91 (OgreDepthShadowMapRenderingRun*) OgreIlluminationManager::getSingleton() 92 .getPerLightRun(lights.at(i)->getName(), 93 ILLUMRUN_DEPTH_SHADOWMAP)->asOgreRenderingRun(); 94 95 passes.at(i)->getTextureUnitState(0)->setTextureName( 96 depthRun->getDepthMapTextureName()); 97 98 //TODO: set matrices 99 GpuProgramParametersSharedPtr fpParams = passes.at(i)->getFragmentProgramParameters(); 100 GpuProgramParametersSharedPtr vpParams = passes.at(i)->getVertexProgramParameters(); 101 102 //fpParams->setNamedConstant("lightViewProj", depthRun->getLightViewProjMatrix()); 103 vpParams->setNamedConstant("lightViewProj", depthRun->getLightViewProjMatrix()); 88 //create run if not exists 89 OgreIlluminationManager::getSingleton().createPerLightRun(lights.at(l)->getName(), 90 ILLUMRUN_DEPTH_SHADOWMAP); 91 //update light depth map 92 OgreIlluminationManager::getSingleton().updatePerLightRun(lights.at(l)->getName(), 93 ILLUMRUN_DEPTH_SHADOWMAP, 94 frameNum); 95 96 //set texture to pass 97 OgreDepthShadowMapRenderingRun* depthRun = 98 (OgreDepthShadowMapRenderingRun*) OgreIlluminationManager::getSingleton() 99 .getPerLightRun(lights.at(l)->getName(), 100 ILLUMRUN_DEPTH_SHADOWMAP)->asOgreRenderingRun(); 101 102 passes.at(i)->getTextureUnitState(0)->setTextureName( 103 depthRun->getDepthMapTextureName()); 104 104 105 passes.at(i)->setActive(true); 105 //TODO: set matrices 106 GpuProgramParametersSharedPtr fpParams = passes.at(i)->getFragmentProgramParameters(); 107 GpuProgramParametersSharedPtr vpParams = passes.at(i)->getVertexProgramParameters(); 108 109 //fpParams->setNamedConstant("lightViewProj", depthRun->getLightViewProjMatrix()); 110 vpParams->setNamedConstant("lightViewProj", depthRun->getLightViewProjMatrix()); 111 112 passes.at(i)->setActive(true); 113 106 114 } 107 115 else
Note: See TracChangeset
for help on using the changeset viewer.