- Timestamp:
- 03/09/07 10:32:11 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgrePathMapRenderTechnique.cpp
r2200 r2218 50 50 Vector4 pathMapParameters(prmnt[0],prmnt[1],halfPixel[0],halfPixel[1]); 51 51 Fparams->setNamedConstant("prmAtlasTilesHalfPixel",pathMapParameters); 52 unsigned int clustercount = OgreIlluminationManager::getSingleton().getPathMapClusterLengthsSize(); 52 53 unsigned int clustercount = OgreIlluminationManager::getSingleton().getPathMapClusterLengthsSize(); 53 54 Fparams->setNamedConstant("allClusterCount", (float) clustercount); 54 55 PathMapClusters* clusters = OgreIlluminationManager::getSingleton().getPathMapClusters(parentOgreRenderable->getName()); … … 74 75 st->setTextureBorderColour(ColourValue::Blue); 75 76 76 //newpass->setSceneBlending(SBT_MODULATE);77 newpass->setSceneBlending(SBF_ONE, SBF_ZERO);77 newpass->setSceneBlending(SBT_MODULATE); 78 //newpass->setSceneBlending(SBF_ONE, SBF_ZERO); 78 79 newpass->setDepthBias(1); 79 80 … … 90 91 { 91 92 PathMapClusters* clusters = OgreIlluminationManager::getSingleton().getPathMapClusters(parentOgreRenderable->getName()); 92 int width = clusters->count / 4;93 int width = clusters->count; 93 94 TexturePtr texPtr = Ogre::TextureManager::getSingleton().createManual(this->parentOgreRenderable->getName() + "_PMWeightIndexTexture", 94 95 "default", 95 TEX_TYPE_ 1D,96 TEX_TYPE_2D, 96 97 width, 97 98 1, 98 99 0, 99 100 0, 100 PF_FLOAT32_R GBA,101 PF_FLOAT32_R, 101 102 TU_DYNAMIC_WRITE_ONLY); 102 103 weightIndexTexture = texPtr.getPointer(); 103 104 104 float *weightIndices = new float[ clusters->count];105 PixelBox lockBox(width, 1, 1, PF_FLOAT32_R GBA, weightIndices);105 float *weightIndices = new float[width]; 106 PixelBox lockBox(width, 1, 1, PF_FLOAT32_R, weightIndices); 106 107 for(int j = 0; j< clusters->count; j++) 107 108 weightIndices[j] = clusters->clusters[j]; … … 116 117 sm->_populateLightList(Vector3(0,0,0), 1000, lights); //TODO 117 118 //TODO set weights 118 119 119 /* 120 unsigned int entryPointCount = OgreIlluminationManager::getSingleton().getPathMapEntryPoints().size(); 121 PathMapClusters* clusters = OgreIlluminationManager::getSingleton().getPathMapClusters(parentOgreRenderable->getName()); 122 int weightTextureWidth = clusters->count / 4; 123 */ 120 124 for(int i = 0 ; i < 1; i++) 121 125 { … … 126 130 OgreIlluminationManager::getSingleton().getPerLightRun(lightName, ILLUMRUN_PM_WEIGHTMAP)->asOgreRenderingRun(); 127 131 128 TextureUnitState* st =pathMapPass->getTextureUnitState(2); 129 st->setTextureName(PMWeightRun->getPMWeightTetureName()); 132 TextureUnitState* st = pathMapPass->getTextureUnitState(2); 133 st->setTextureName(PMWeightRun->getPMWeightTetureName()); 134 135 /* 136 TexturePtr tex = TextureManager::getSingleton().getByName(PMWeightRun->getPMWeightTetureName()); 137 float *allClusterWeights = new float[entryPointCount]; 138 PixelBox lockBox(entryPointCount, 1, 1, PF_FLOAT32_R, allClusterWeights); 139 tex->getBuffer()->blitToMemory(lockBox); 140 141 float *weightIndices = new float[clusters->count]; 142 for(int j = 0; j< clusters->count; j++) 143 weightIndices[j] = allClusterWeights[clusters->clusters[j]]; 144 145 PixelBox lockBox2(weightTextureWidth, 1, 1, PF_FLOAT32_RGBA, weightIndices); 146 weightIndexTexture->getBuffer()->blitFromMemory(lockBox2); 147 148 TextureUnitState* st = pathMapPass->getTextureUnitState(1); 149 st->setTextureName(weightIndexTexture->getName()); */ 130 150 } 131 151 }
Note: See TracChangeset
for help on using the changeset viewer.