Changeset 1425 for GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src
- Timestamp:
- 09/21/06 08:49:20 (18 years ago)
- Location:
- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src
- Files:
-
- 3 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreIlluminationManager.cpp
r1130 r1425 81 81 focusingMapSize = 32; 82 82 shadowMapSize = 512; 83 phaseTextureSize = 256; 83 84 84 85 for(int i = 0; i < RUN_TYPE_COUNT; i++) … … 106 107 OgreHierarchicalParticleSystemTechniqueFactory* HPSF = new OgreHierarchicalParticleSystemTechniqueFactory(); 107 108 addRenderTechniqueFactory(HPSF); 109 OgreIllumVolumeRenderTechniqueFactory* illumVolume = new OgreIllumVolumeRenderTechniqueFactory(); 110 addRenderTechniqueFactory(illumVolume); 108 111 } 109 112 … … 397 400 fillVisibleList(rq); 398 401 399 int l = visibleObjects.size(); //debug402 // int l = visibleObjects.size(); //debug 400 403 401 404 joinSharedRuns(); 402 405 403 int ll = sharedRunRoots.size(); //debug406 // int ll = sharedRunRoots.size(); //debug 404 407 405 408 //update precomputings … … 524 527 525 528 } 529 case ILLUMRUN_PHASE_TEXTURE: 530 if(globalSharedRuns.getRun(ILLUMRUN_PHASE_TEXTURE) == 0) 531 { 532 OgrePhaseTextureRenderingRun* run = new OgrePhaseTextureRenderingRun( 533 "PHASE_TEXTURE", 534 phaseTextureSize, 535 phaseTextureSize, 536 "Phase_HenyeyGreenStein"); 537 globalSharedRuns.addRun(ILLUMRUN_PHASE_TEXTURE, run); 538 } 526 539 break; 527 540 } 528 541 } 529 542 530 543 void OgreIlluminationManager::savePhaseTextureToFile(String filename) 544 { 545 OgrePhaseTextureRenderingRun* r = (OgrePhaseTextureRenderingRun*) 546 globalSharedRuns.getRun(ILLUMRUN_PHASE_TEXTURE)->asOgreRenderingRun(); 547 Texture* t = (Texture*) TextureManager::getSingleton().getByName(r->getPhaseTextureName()).getPointer(); 548 549 t->getBuffer()->getRenderTarget()->writeContentsToFile(filename); 550 } 531 551 532 552 RenderingRun* OgreIlluminationManager::getGlobalRun(RenderingRunType runType) -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreRenderable.cpp
r1062 r1425 140 140 boundingSphere = billboardSetRenderable->getWorldBoundingSphere(true);*/ 141 141 parentParticleSystem->getParentSceneNode()->_updateBounds(); 142 boundingBox = parentParticleSystem->getWorldBoundingBox(true); 143 boundingSphere = parentParticleSystem->getWorldBoundingSphere(true); 142 boundingBox = parentParticleSystem->getParentSceneNode()->_getWorldAABB(); 143 boundingSphere.setRadius( (boundingBox.getMaximum() - boundingBox.getMinimum()).length() / 2.0); 144 boundingSphere.setCenter( (boundingBox.getMaximum() + boundingBox.getMinimum()) / 2.0); 144 145 break; 145 146 default: … … 176 177 break; 177 178 case OGRE_RENDERABLETYPE_BILLBOARDSET: 178 billboardSetRenderable->_notifyCurrentCamera(cam);179 parentParticleSystem->_notifyCurrentCamera(cam); 179 180 break; 180 181 default: … … 184 185 } 185 186 } 187 188 189 void OgreRenderable::updateRenderQueue(RenderQueue* rq) 190 { 191 switch(renderableType) 192 { 193 case OGRE_RENDERABLETYPE_SUBENTITY: 194 parentEntity->_updateRenderQueue(rq); 195 break; 196 case OGRE_RENDERABLETYPE_BILLBOARDSET: 197 parentParticleSystem->_updateRenderQueue(rq); 198 break; 199 default: 200 OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, 201 "Unknown renderable type! Check RenderTechnique initializations!", 202 "OgreRenderable::notifyCamera"); 203 } 204 } -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreRenderingRun.cpp
r1351 r1425 29 29 } 30 30 bool visit(const Pass* p){return true;} 31 void visit(const RenderablePass* rp){} 31 void visit(const RenderablePass* rp) 32 { 33 Renderable* rend = rp->renderable; 34 35 if( visibleObjects->count(rend) == 0) 36 { 37 (*visibleObjects)[rend] = rend->getMaterial().getPointer()->getName(); 38 rend->setMaterialName(materialName); 39 } 40 } 32 41 33 42 }; … … 107 116 } 108 117 109 void OgreRenderingRun::setMaterialForRenderables(String& materialName, RenderQueue* rq )118 void OgreRenderingRun::setMaterialForRenderables(String& materialName, RenderQueue* rq, bool solidsonly) 110 119 { 111 120 RenderQueue::QueueGroupIterator queueIt = rq->_getQueueGroupIterator(); … … 124 133 MaterialSetVisitor visitor(materialName, &visibleObjects); 125 134 solids.acceptVisitor(&visitor, QueuedRenderableCollection::OM_PASS_GROUP); 126 transparents.acceptVisitor(&visitor, QueuedRenderableCollection::OM_SORT_ASCENDING); 135 if(!solidsonly) 136 transparents.acceptVisitor(&visitor, QueuedRenderableCollection::OM_SORT_ASCENDING); 127 137 } 128 138 } … … 144 154 } 145 155 146 void OgreRenderingRun::setMaterialForVisibles(String& materialName, Camera* cam, bool shadowcastersonly )156 void OgreRenderingRun::setMaterialForVisibles(String& materialName, Camera* cam, bool shadowcastersonly, bool solidsonly) 147 157 { 148 158 SceneManager* sm = Ogre::Root::getSingleton()._getCurrentSceneManager(); … … 160 170 sm->_findVisibleObjects (cam, shadowcastersonly); 161 171 162 setMaterialForRenderables(materialName, rq );172 setMaterialForRenderables(materialName, rq, solidsonly); 163 173 } 164 174 -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreSharedRuns.cpp
r1055 r1425 201 201 float MAXRAD = 0xffffffff; 202 202 //check bounds 203 for( int i = 0; i < commonruns.size(); i++)203 for(unsigned int i = 0; i < commonruns.size(); i++) 204 204 { 205 205 … … 238 238 } 239 239 240 void OgreSharedRuns::addRenderablesToQueue(RenderQueue* rq )240 void OgreSharedRuns::addRenderablesToQueue(RenderQueue* rq, bool checkVisible) 241 241 { 242 242 if(child1 != 0) //node … … 251 251 while(it != itend) 252 252 { 253 if((*it).first->isVisible()) 254 rq->addRenderable(((*it).first)->getRenderable()); 253 if(!checkVisible || (*it).first->isVisible()) 254 { 255 //rq->addRenderable(((*it).first)->getRenderable()); 256 ((*it).first)->updateRenderQueue(rq); 257 } 255 258 it++; 256 259 } -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreHierarchicalParticleSystemTechnique.cpp
r1330 r1425 3 3 #include "OgreHierarchicalParticleSystemTechnique.h" 4 4 #include "OgreChildPSystemRenderingRun.h" 5 #include "OgreLightVolumeRenderingRun.h" 5 6 6 7 OgreHierarchicalParticleSystemTechnique::OgreHierarchicalParticleSystemTechnique( … … 43 44 if(sharedRuns->getRun(ILLUMRUN_HPP_IMPOSTOR) == 0) 44 45 sharedRuns->addRun(ILLUMRUN_HPP_IMPOSTOR, createChildPSysRenderingRun()); 45 46 46 47 ((OgreChildPSystemRenderingRun*) sharedRuns->getRun(ILLUMRUN_HPP_IMPOSTOR)->asOgreRenderingRun())->setNode(node); 47 impostorChanged(sharedRuns->getRun(ILLUMRUN_HPP_IMPOSTOR)); 48 impostorChanged(sharedRuns->getRun(ILLUMRUN_HPP_IMPOSTOR)); 48 49 } 49 50 … … 74 75 } 75 76 76 void OgreHierarchicalParticleSystemTechnique::update(unsigned long frameNum) 77 { 78 HierarchicalParticleSystemTechnique::update(frameNum); 79 80 OgreChildPSystemRenderingRun* r = (OgreChildPSystemRenderingRun*) 81 sharedRuns->getRun(ILLUMRUN_HPP_IMPOSTOR)->asOgreRenderingRun(); 77 78 void OgreHierarchicalParticleSystemTechnique::impostorUpdated(RenderingRun* run) 79 { 80 OgreChildPSystemRenderingRun* r = (OgreChildPSystemRenderingRun*) run->asOgreRenderingRun(); 81 82 82 float radius = r->getSmallSysRadius(); 83 83 if(useVParam) … … 155 155 OgreHierarchicalParticleSystemTechniqueFactory* f = (OgreHierarchicalParticleSystemTechniqueFactory*) factory; 156 156 f->VParamRadius = params; 157 f->useVParam = true; 157 158 } 158 159 void parseFparamRadius(String& params, RenderTechniqueFactory* factory) … … 160 161 OgreHierarchicalParticleSystemTechniqueFactory* f = (OgreHierarchicalParticleSystemTechniqueFactory*) factory; 161 162 f->FParamRadius = params; 163 f->useFParam = true; 162 164 } 163 165 … … 180 182 this->attributeParsers.insert(AttribParserList::value_type("particle_script", (ILLUM_ATTRIBUTE_PARSER) parseScriptName)); 181 183 this->attributeParsers.insert(AttribParserList::value_type("material", (ILLUM_ATTRIBUTE_PARSER) parseMaterialName)); 182 this->attributeParsers.insert(AttribParserList::value_type("vparam_radius", (ILLUM_ATTRIBUTE_PARSER) parse FparamRadius));183 this->attributeParsers.insert(AttribParserList::value_type("fparam_radius", (ILLUM_ATTRIBUTE_PARSER) parse VparamRadius));184 this->attributeParsers.insert(AttribParserList::value_type("vparam_radius", (ILLUM_ATTRIBUTE_PARSER) parseVparamRadius)); 185 this->attributeParsers.insert(AttribParserList::value_type("fparam_radius", (ILLUM_ATTRIBUTE_PARSER) parseFparamRadius)); 184 186 185 187 } -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreChildParticlesystemRenderingRun.cpp
r1337 r1425 69 69 psysNode->setPosition(center); 70 70 ParticleSystem* psys = Root::getSingleton()._getCurrentSceneManager()->getParticleSystem(childParticleSystemName); 71 psys->_notifyCurrentCamera(impostorCamera);72 71 73 72 psysNode->_updateBounds(); … … 111 110 112 111 // 112 psys->_notifyCurrentCamera(impostorCamera); 113 113 psys->_updateRenderQueue(rq); 114 114 -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreFocusingMapRenderingRun.cpp
r1125 r1425 18 18 bool first = true; 19 19 20 for( int i = 0; i < buffersize; i+= 4)20 for(unsigned int i = 0; i < buffersize; i+= 4) 21 21 { 22 22 float x = floatbuffer[i]; -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreSceneCameraDepthRenderingRun.cpp
r874 r1425 43 43 { 44 44 45 setMaterialForVisibles(String("GameTools/SceneCameraDepthShader"), playerCamera );45 setMaterialForVisibles(String("GameTools/SceneCameraDepthShader"), playerCamera, false, true); 46 46 47 47 RenderTarget* rt = depthTexture->getBuffer().getPointer()->getRenderTarget();
Note: See TracChangeset
for help on using the changeset viewer.