Changeset 1062 for GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src
- Timestamp:
- 06/27/06 10:21:48 (19 years ago)
- Location:
- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreIlluminationManager.cpp
r1055 r1062 102 102 OgreFireRenderTechniqueFactory* fire = new OgreFireRenderTechniqueFactory(); 103 103 addRenderTechniqueFactory(fire); 104 OgreHierarchicalParticleSystemTechniqueFactory* HPSF = new OgreHierarchicalParticleSystemTechniqueFactory(); 105 addRenderTechniqueFactory(HPSF); 104 106 } 105 107 -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreRenderable.cpp
r1055 r1062 35 35 parentParticleSystem = sys; 36 36 updateBounds(); 37 name = billboardset->getName();37 name = sys->getName(); 38 38 } 39 39 … … 136 136 break; 137 137 case OGRE_RENDERABLETYPE_BILLBOARDSET: 138 billboardSetRenderable->getParentSceneNode()->_updateBounds();138 /* billboardSetRenderable->getParentSceneNode()->_updateBounds(); 139 139 boundingBox = billboardSetRenderable->getWorldBoundingBox(true); 140 boundingSphere = billboardSetRenderable->getWorldBoundingSphere(true); 140 boundingSphere = billboardSetRenderable->getWorldBoundingSphere(true);*/ 141 parentParticleSystem->getParentSceneNode()->_updateBounds(); 142 boundingBox = parentParticleSystem->getWorldBoundingBox(true); 143 boundingSphere = parentParticleSystem->getWorldBoundingSphere(true); 141 144 break; 142 145 default: -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreHierarchicalParticleSystemTechnique.cpp
r1055 r1062 24 24 this->childPSysScriptName = childPSysScriptName; 25 25 this->impostorMaterialName = impostorMaterialName; 26 26 this->useOwnMaterial = useOwnMaterial; 27 28 //create the Particle system 29 childPSysName = parentOgreRenderable->getName() + "_small_PSYS"; 30 ParticleSystem* psys = Root::getSingleton()._getCurrentSceneManager()->createParticleSystem(childPSysName, childPSysScriptName); 31 SceneNode* node = Root::getSingleton()._getCurrentSceneManager()->getRootSceneNode()->createChildSceneNode(); 32 node->attachObject(psys); 33 psys->setVisible(false); 27 34 28 35 if(sharedRuns->getRun(ILLUMRUN_HPP_IMPOSTOR) == 0) 29 36 sharedRuns->addRun(ILLUMRUN_HPP_IMPOSTOR, createChildPSysRenderingRun()); 30 37 31 //create the Particle system 32 String name = parentOgreRenderable->getName() + "_small_PSYS"; 33 ParticleSystem* psys = Root::getSingleton()._getCurrentSceneManager()->createParticleSystem(name, childPSysScriptName); 34 SceneNode* node = Root::getSingleton()._getCurrentSceneManager()->getRootSceneNode()->createChildSceneNode(); 35 node->attachObject(psys); 36 psys->setVisible(false); 38 impostorChanged(sharedRuns->getRun(ILLUMRUN_HPP_IMPOSTOR)); 37 39 } 38 40 … … 41 43 { 42 44 45 } 46 47 void OgreHierarchicalParticleSystemTechnique::impostorChanged(RenderingRun* run) 48 { 49 OgreChildPSystemRenderingRun* r = (OgreChildPSystemRenderingRun*) run->asOgreRenderingRun(); 50 pass->getTextureUnitState(impostorTexID)->setTextureName(r->getImpostorTextureName()); 43 51 } 44 52 … … 178 186 } 179 187 188 -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreChildParticlesystemRenderingRun.cpp
r1055 r1062 47 47 RenderTarget* rt = hpb->getRenderTarget(); 48 48 Viewport* v = rt->addViewport(impostorCamera); 49 v->setBackgroundColour(ColourValue(0,1,0,0)); 49 50 v->setOverlaysEnabled(false); 50 51 rt->setAutoUpdated(false); … … 60 61 rq->clear(); 61 62 63 sharedRuns->getRoot()->updateBounds(); 62 64 Sphere boundSphere = ((OgreSharedRuns*)sharedRuns->getRoot(ILLUMRUN_HPP_IMPOSTOR))->getBoundingSphere(); 63 65 Camera* mainCam = OgreIlluminationManager::getSingleton().getMainCamera(); … … 65 67 Vector3 dir = boundSphere.getCenter() - mainCam->getPosition(); 66 68 float r = boundSphere.getRadius(); 69 r = 200; 67 70 float d = dir.normalise(); 68 71 impostorCamera->setDirection(dir); … … 72 75 impostorCamera->setProjectionType(PT_PERSPECTIVE); 73 76 impostorCamera->setAspectRatio(1.0); 74 Radian a = Math::ASin(r / d) ;75 impostorCamera->setFOVy( a * 2.0);76 impostorCamera->setNearClipDistance( std::max(0.01f, d - r));77 impostorCamera->setFarClipDistance( r + d);77 Radian a = Math::ASin(r / d) * 2.0; 78 impostorCamera->setFOVy(/*a*/ Radian(Degree(90))); 79 impostorCamera->setNearClipDistance(/*std::max(0.01f, d - r)*/0.1); 80 impostorCamera->setFarClipDistance(/*r + d*/1000); 78 81 } 79 82 else … … 100 103 rt->update(); 101 104 102 /* 103 static int framecount = 0; 104 String filename = "photon"; 105 filename.append(this->name); 106 //filename.append(StringConverter::toString(framecount)); 107 filename.append(".png"); 108 rt->writeContentsToFile(filename); 109 framecount++; 110 */ 105 106 static int framecount = 0; 107 String filename = "impostor"; 108 filename.append(this->name); 109 //filename.append(StringConverter::toString(framecount)); 110 filename.append(".dds"); 111 rt->writeContentsToFile(filename); 112 framecount++; 111 113 112 114 if(!useOwnMaterial)
Note: See TracChangeset
for help on using the changeset viewer.