- Timestamp:
- 03/09/07 10:32:11 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgrePMWeightComputeRenderingRun.cpp
r2214 r2218 2 2 #include "OgreIlluminationManager.h" 3 3 #include "OgrePMEntryPointMapRenderingRun.h" 4 #include "OgreDepthShadowMapRenderingRun.h" 4 5 5 6 OgrePMWeightComputeRenderingRun::OgrePMWeightComputeRenderingRun(String name, String LightName) … … 74 75 if(light->getType() == Light::LT_SPOTLIGHT) 75 76 { 77 OgreIlluminationManager::getSingleton().createPerLightRun(light->getName(), ILLUMRUN_DEPTH_SHADOWMAP); 78 OgreIlluminationManager::getSingleton().updatePerLightRun(light->getName(), ILLUMRUN_DEPTH_SHADOWMAP, frameNum); 79 OgreDepthShadowMapRenderingRun* SMrun = (OgreDepthShadowMapRenderingRun*) OgreIlluminationManager::getSingleton() 80 .getPerLightRun(light->getName(), ILLUMRUN_DEPTH_SHADOWMAP)->asOgreRenderingRun(); 81 76 82 MaterialPtr mat = MaterialManager::getSingleton().getByName("GTP/PathMap_ComputeWeights"); 77 78 83 GpuProgramParameters* Fparams = mat->getTechnique(0)->getPass(0)->getFragmentProgramParameters().getPointer(); 79 84 … … 82 87 // Radian lightAngle = light->getSpotlightOuterAngle(); 83 88 84 //Fparams->setNamedConstant("lightTransform", lightMatrix);85 89 Fparams->setNamedConstant("nRadionColumns", col); 86 90 Fparams->setNamedConstant("lightPos", lightPos); 87 91 Fparams->setNamedConstant("lightDir", lightDir); 92 Fparams->setNamedConstant("lightViewProj", SMrun->getLightViewProjMatrix()); 93 Fparams->setNamedConstant("lightFarPlane", SMrun->getLightFarPlane()); 88 94 89 95 mat->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureName( 90 96 PMEPrun->getEntryPointTextureName()); 97 mat->getTechnique(0)->getPass(0)->getTextureUnitState(1)->setTextureName( 98 SMrun->getDepthMapTextureName()); 91 99 92 100 RenderTarget* rt = allWeightsTexture->getBuffer().getPointer()->getRenderTarget(); 93 101 renderFullscreenQuad(mat->getName(), rt); 94 102 95 rt->writeContentsToFile("allweights.bmp");103 // rt->writeContentsToFile("allweights.bmp"); 96 104 // rt->writeContentsToFile("allweights.dds"); 97 105 98 float* allweights = new float[entryPointCnt / 4096 * 4096];106 /* float* allweights = new float[entryPointCnt / 4096 * 4096]; 99 107 PixelBox lockBox(entryPointCnt / 4096, 4096, 1, PF_FLOAT32_R, allweights); 100 108 allWeightsTexture->getBuffer()->blitToMemory(lockBox); … … 126 134 } 127 135 128 delete[] allweights; 136 delete[] allweights;*/ 129 137 130 138 ///////////////// … … 153 161 //rt->writeContentsToFile("weights.bmp"); 154 162 //rt->writeContentsToFile("weights.dds"); 155 163 /* 156 164 float* weights = new float[clustercount]; 157 165 PixelBox lockBox(clustercount, 1, 1, PF_FLOAT32_R, weights); 158 allWeightsTexture->getBuffer()->blitToMemory(lockBox);166 weightTexture->getBuffer()->blitToMemory(lockBox); 159 167 160 delete[] weights; 168 delete[] weights;*/ 161 169 } 162 170
Note: See TracChangeset
for help on using the changeset viewer.