Changeset 949 for GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src
- Timestamp:
- 05/11/06 10:19:54 (19 years ago)
- Location:
- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreIlluminationManager.cpp
r874 r949 158 158 } 159 159 160 void OgreIlluminationManager::initTechniques(Entity* e) 161 { 162 OgreSharedRuns* sharedruns = 0; 163 164 for(unsigned int s = 0; s < e->getNumSubEntities(); s++) 165 { 166 SubEntity* sube = e->getSubEntity(s); 167 168 Material* mat = sube->getMaterial().getPointer(); 169 170 OgreRenderable* rend = 0; 171 OgreTechniqueGroup* group = 0; 172 173 for(unsigned int t = 0 ; t < mat->getNumTechniques() ; t++) 174 { 175 Technique* tech = mat->getTechnique(t); 176 177 for(unsigned int p = 0; p< tech->getNumPasses(); p++) 178 { 179 Pass* pass = tech->getPass(p); 180 181 std::vector<IllumTechniqueParams*>& techniques = pass->getIllumTechniques(); 182 std::vector<IllumTechniqueParams*>::iterator i = techniques.begin(); 183 std::vector<IllumTechniqueParams*>::iterator iend = techniques.end(); 184 185 while( i != iend) 186 { 187 IllumTechniqueParams* params = *i; 188 189 if(rend == 0) 190 { 191 rend = new OgreRenderable(e, s); 192 group = new OgreTechniqueGroup(); 193 sube->setRenderTechniqueGroup(group); 194 195 if( sharedruns == 0) 196 { 197 sharedruns = new OgreSharedRuns(); 198 addSharedRuns(sharedruns); 199 } 200 201 group->addSharedRun(sharedruns); 202 sharedruns->addRenderable(rend); 203 sharedruns->updateBounds(); 204 } 205 206 createTechnique(params, pass, rend, sharedruns); 207 208 i++; 209 } 210 } 211 } 212 } 213 214 215 } 160 216 161 217 void OgreIlluminationManager::initTechniques() … … 170 226 Entity* e = (Entity*) o; 171 227 172 OgreSharedRuns* sharedruns = 0;228 /* OgreSharedRuns* sharedruns = 0; 173 229 174 230 for(unsigned int s = 0; s < e->getNumSubEntities(); s++) … … 222 278 } 223 279 280 */ 281 initTechniques(e); 224 282 } 225 283 } -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreSharedRuns.cpp
r790 r949 36 36 sharedRuns[runType]->update(frameNum); 37 37 */ 38 getRun(runType)->update(frameNum); 38 RenderingRun* run = getRun(runType); 39 40 if(run->update(frameNum)) 41 runUpdated(runType, run); 39 42 } 40 43 -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreCausticCasterRenderTechnique.cpp
r874 r949 23 23 { 24 24 this->photonMapMaterialName = photonMapMaterialName; 25 this->causticMapMaterialName = causticMapMaterialName; 25 26 String newMaterialName = causticMapMaterialName + parentRenderable->getName() + "_clone"; 27 Material* mat = (Material*) MaterialManager::getSingleton().getByName(causticMapMaterialName).getPointer(); 28 Material* newMat = mat->clone(newMaterialName).getPointer(); 29 this->causticMapMaterialName = newMat->getName(); 30 //this->causticMapMaterialName =causticMapMaterialName; 31 26 32 this->photonMapTexID = photonMapTexID; 27 33 … … 63 69 } 64 70 } 65 71 void OgreCausticCasterRenderTechnique::distanceCubeMapRunUpdated(RenderingRun* run) 72 { 73 if(useDistance) 74 { 75 OgrePhotonMapRenderingRun* photonrun = (OgrePhotonMapRenderingRun*) 76 sharedRuns->getRun(ILLUMRUN_PHOTONMAP)->asOgreRenderingRun(); 77 photonrun->distanceCubeMapUpdated(sharedRuns->getRun(ILLUMRUN_DISTANCE_CUBEMAP)); 78 } 79 } 66 80 void OgreCausticCasterRenderTechnique::causticCubeMapRunChanged(RenderingRun* run) 67 81 { -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreCausticRecieverRenderTechnique.cpp
r836 r949 58 58 59 59 newpass->setSceneBlending(SBF_DEST_COLOUR, SBF_ONE); 60 newpass->setDepthBias(5); 60 61 //newpass->setSceneBlending(SBT_ADD); 61 62 -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreDepthShadowRecieverRenderTechnique.cpp
r836 r949 54 54 55 55 newpass->setSceneBlending(SBT_MODULATE); 56 56 newpass->setDepthBias(5); 57 57 techn->movePass(lastpass, index); 58 58 } -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreCausticCubeMapRenderingRun.cpp
r790 r949 21 21 this->materialName = materialName; 22 22 this->photonMapTexId = photonMapTexId; 23 24 spriteSetName = name + String("_pixelSpriteSet"); 23 25 24 26 createCausticCubeMap(); … … 40 42 String photonMapName = ((OgrePhotonMapRenderingRun*) run->asOgreRenderingRun())->getPhotonMapTextureName(); 41 43 mat->getTechnique(0)->getPass(0)->getTextureUnitState(photonMapTexId)->setTextureName(photonMapName); 44 45 //rt = TextureManager::getSingleton().getByName(photonMapName); 46 LogManager::getSingleton().logMessage(LML_NORMAL, name + " map: " + photonMapName + " material: " + mat->getName()); 42 47 } 43 48 … … 59 64 renderPixelSprites(materialName, rt, tex->getWidth(), tex->getHeight()); 60 65 61 //rt->writeContentsToFile("caucube" + StringConverter::toString(facenum) + ".dds");66 //rt->writeContentsToFile("caucube" + this->name + StringConverter::toString(facenum) + ".dds"); 62 67 } 63 68 -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgrePhotonMapRenderingRun.cpp
r808 r949 78 78 static int framecount = 0; 79 79 String filename = "photon"; 80 filename.append(StringConverter::toString(framecount)); 80 filename.append(this->name); 81 //filename.append(StringConverter::toString(framecount)); 81 82 filename.append(".png"); 82 83 rt->writeContentsToFile(filename); … … 135 136 mat->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureName(cubemapname); 136 137 } 138 139 void OgrePhotonMapRenderingRun::distanceCubeMapUpdated(RenderingRun* run) 140 { 141 Material* mat = (Material*) MaterialManager::getSingleton().getByName(materialName).getPointer(); 142 OgreDistanceCubeMapRenderingRun* cuberun =(OgreDistanceCubeMapRenderingRun*) (run->asOgreRenderingRun()); 143 String cubemapname = cuberun->getDistanceCubeMapTextureName(); 144 GpuProgramParametersSharedPtr fpParams = mat->getTechnique(0)->getPass(0)->getFragmentProgramParameters(); 145 Vector3 center = ((OgreSharedRuns*) sharedRuns)->getRootPosition(ILLUMRUN_DISTANCE_CUBEMAP); 146 fpParams->setNamedConstant("lastCenter",center); 147 } 137 148
Note: See TracChangeset
for help on using the changeset viewer.