- Timestamp:
- 04/24/07 14:04:48 (18 years ago)
- Location:
- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreDepthShadowReceiverRenderTechnique.cpp
r2299 r2333 125 125 GpuProgramParametersSharedPtr fpParams = passes.at(i)->getFragmentProgramParameters(); 126 126 GpuProgramParametersSharedPtr vpParams = passes.at(i)->getVertexProgramParameters(); 127 128 //fpParams->setNamedConstant("lightViewProj", depthRun->getLightViewProjMatrix()); 127 129 128 if(setLightViewProjMatrix) 130 129 vpParams->setNamedConstant(lightViewProjParamName, depthRun->getLightViewProjMatrix()); -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgrePathMapRenderTechnique.cpp
r2299 r2333 63 63 TextureUnitState* st = newpass->createTextureUnitState(); 64 64 st->setTextureFiltering(TFO_BILINEAR); 65 st->setTextureAddressingMode(TextureUnitState::TAM_ BORDER);65 st->setTextureAddressingMode(TextureUnitState::TAM_CLAMP); 66 66 st->setTextureBorderColour(ColourValue::Green); 67 67 st->setTextureName(clusters->pathMapTextureFilename); … … 71 71 st = newpass->createTextureUnitState(); 72 72 st->setTextureFiltering(TFO_NONE); 73 st->setTextureAddressingMode(TextureUnitState::TAM_ BORDER);73 st->setTextureAddressingMode(TextureUnitState::TAM_CLAMP); 74 74 st->setTextureBorderColour(ColourValue::Red); 75 75 st->setTextureName(weightIndexTexture->getName()); … … 77 77 st = newpass->createTextureUnitState(); 78 78 st->setTextureFiltering(TFO_NONE); 79 st->setTextureAddressingMode(TextureUnitState::TAM_ BORDER);79 st->setTextureAddressingMode(TextureUnitState::TAM_CLAMP); 80 80 st->setTextureBorderColour(ColourValue::Blue); 81 81 … … 122 122 LightList lights; 123 123 SceneManager* sm = Root::getSingleton()._getCurrentSceneManager(); 124 sm->_populateLightList(Vector3(0,0,0), 1000, lights); //TODO 125 //TODO set weights 126 /* 127 unsigned int entryPointCount = OgreIlluminationManager::getSingleton().getPathMapEntryPoints().size(); 128 PathMapClusters* clusters = OgreIlluminationManager::getSingleton().getPathMapClusters(parentOgreRenderable->getName()); 129 int weightTextureWidth = clusters->count / 4; 130 */ 131 for(int i = 0 ; i < 1; i++) 132 { 133 String lightName = lights.at(0)->getName(); 124 sm->_populateLightList(OgreIlluminationManager::getSingleton().getMainCamera()->getPosition(), 1000, lights); 125 126 for(int i = 0 ; i < 5 && i < lights.size(); i++) 127 { 128 String lightName = lights.at(i)->getName(); 134 129 OgreIlluminationManager::getSingleton().createPerLightRun(lightName, ILLUMRUN_PM_WEIGHTMAP); 135 OgreIlluminationManager::getSingleton().updatePerLightRun(lightName, ILLUMRUN_PM_WEIGHTMAP, frameNum); 136 OgrePMWeightComputeRenderingRun* PMWeightRun = (OgrePMWeightComputeRenderingRun*) 137 OgreIlluminationManager::getSingleton().getPerLightRun(lightName, ILLUMRUN_PM_WEIGHTMAP)->asOgreRenderingRun(); 138 139 TextureUnitState* st = pathMapPass->getTextureUnitState(2); 140 st->setTextureName(PMWeightRun->getPMWeightTetureName()); 141 142 /* 143 TexturePtr tex = TextureManager::getSingleton().getByName(PMWeightRun->getPMWeightTetureName()); 144 float *allClusterWeights = new float[entryPointCount]; 145 PixelBox lockBox(entryPointCount, 1, 1, PF_FLOAT32_R, allClusterWeights); 146 tex->getBuffer()->blitToMemory(lockBox); 147 148 float *weightIndices = new float[clusters->count]; 149 for(int j = 0; j< clusters->count; j++) 150 weightIndices[j] = allClusterWeights[clusters->clusters[j]]; 151 152 PixelBox lockBox2(weightTextureWidth, 1, 1, PF_FLOAT32_RGBA, weightIndices); 153 weightIndexTexture->getBuffer()->blitFromMemory(lockBox2); 154 155 TextureUnitState* st = pathMapPass->getTextureUnitState(1); 156 st->setTextureName(weightIndexTexture->getName()); */ 130 OgreIlluminationManager::getSingleton().updatePerLightRun(lightName, ILLUMRUN_PM_WEIGHTMAP, frameNum); 157 131 } 158 } 132 OgrePMWeightComputeRenderingRun::sumWeights(frameNum); 133 TextureUnitState* st = pathMapPass->getTextureUnitState(2); 134 st->setTextureName(OgrePMWeightComputeRenderingRun::getPMWeightTextureName()); 135 } 136 137 159 138 160 139 namespace PathMapParsers
Note: See TracChangeset
for help on using the changeset viewer.