Changeset 187
- Timestamp:
- 07/31/05 11:16:09 (19 years ago)
- Location:
- trunk/VUT
- Files:
-
- 7 added
- 2 deleted
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibility/src/CoherentHierarchicalCullingManager.cpp
r175 r187 83 83 84 84 // if we assume node to be visible in this frame => skip query 85 if (wasVisible && (mAssumedVisibility > 0) && DecideVisible(node) )//&& mHierarchyInterface->HasGeometry(node))85 if (wasVisible && (mAssumedVisibility > 0) && DecideVisible(node) && mHierarchyInterface->HasGeometry(node)) 86 86 { 87 87 SkipQuery(node); -
trunk/VUT/Ogre/include/OgrePlatformHierarchyInterface.h
r175 r187 108 108 GtpVisibility::OcclusionQuery *IssuePatchOcclusionQuery(GtpVisibility::Patch *patch); 109 109 110 /** Deletes all occlusion queries. 111 */ 112 void DeleteQueries(); 113 110 114 protected: 111 115 /** Renders the given geometry … … 120 124 */ 121 125 void CreateNodeVizMaterials(); 122 123 /** Deletes all occlusion queries.124 */125 void DeleteQueries();126 126 127 127 /** Returns pointer to current renderable bounding box geometry. -
trunk/VUT/Ogre/include/OgreVisibilityOctreeSceneManager.h
r159 r187 83 83 OctreeHierarchyInterface *GetHierarchyInterface(); 84 84 85 void renderAdditiveStencilShadowedQueueGroupObjects(RenderQueueGroup* pGroup); 86 void renderModulativeStencilShadowedQueueGroupObjects(RenderQueueGroup* pGroup); 85 87 86 88 protected: … … 146 148 /// Always execute the vertex program of a pass, e.g., for the depth pass or item buffer 147 149 bool mExecuteVertexProgramForAllPasses; 150 151 bool mIsHierarchicalCulling; 148 152 }; 149 153 -
trunk/VUT/Ogre/include/OgreVisibilityOptionsManager.h
r130 r187 6 6 #include <OgreStringVector.h> 7 7 #include "VisibilityManager.h" 8 #include " HierarchyInterface.h"8 #include "OgrePlatformHierarchyInterface.h" 9 9 10 10 … … 25 25 */ 26 26 VisibilityOptionsManager(GtpVisibility::VisibilityManager *visManager, 27 GtpVisibility::HierarchyInterface *hierarchyInterface);27 PlatformHierarchyInterface *hierarchyInterface); 28 28 29 29 /** Sets the given option for the scene traverser. … … 42 42 protected: 43 43 GtpVisibility::VisibilityManager *mVisibilityManager; 44 GtpVisibility::HierarchyInterface *mHierarchyInterface;44 PlatformHierarchyInterface *mHierarchyInterface; 45 45 }; 46 46 -
trunk/VUT/Ogre/src/OgrePlatformHierarchyInterface.cpp
r183 r187 68 68 DeleteQueries(); 69 69 70 if (mSolidBoundingBox) 71 delete mSolidBoundingBox; 70 OGRE_DELETE(mSolidBoundingBox); 72 71 } 73 72 //----------------------------------------------------------------------- 74 73 void PlatformHierarchyInterface::DeleteQueries() 75 74 { 76 for (int i=0; i < (int)mOcclusionQueries.size(); ++i) 77 delete mOcclusionQueries[i]; 78 79 mOcclusionQueries.clear(); 75 for (int i = 0; i < (int)mOcclusionQueries.size(); ++ i) 76 OGRE_DELETE(mOcclusionQueries[i]); 77 78 mCurrentTestIdx = 0; 79 mOcclusionQueries.clear(); 80 80 } 81 81 //----------------------------------------------------------------------- -
trunk/VUT/Ogre/src/OgreVisibilityOctreeSceneManager.cpp
r175 r187 33 33 mSkipTransparents(false), 34 34 mSavedShadowTechnique(SHADOWTYPE_NONE), 35 mRenderTransparentsForItemBuffer(false), 36 mExecuteVertexProgramForAllPasses(false) 35 mRenderTransparentsForItemBuffer(true), 36 mExecuteVertexProgramForAllPasses(true), 37 mIsHierarchicalCulling(false) 37 38 { 38 39 mHierarchyInterface = new OctreeHierarchyInterface(this, mDestRenderSystem); … … 318 319 mRenderItemBuffer = false; 319 320 mSkipTransparents = false; 321 mIsHierarchicalCulling = false; 322 320 323 mLeavePassesInQueue = 0; 321 324 mShadowTechnique = mSavedShadowTechnique; … … 342 345 343 346 getRenderQueue()->clear(); // finally clear render queue 347 OGRE_DELETE(mRenderQueue); // HACK: should be cleared before... 344 348 //WriteLog(); // write out stats 345 349 } … … 422 426 return true; 423 427 } 424 428 if (key == "NodeVizScale") 429 { 430 OctreeNode::setVizScale(*static_cast<const float *>(val)); 431 return true; 432 } 425 433 return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface). 426 434 setOption(key, val) || OctreeSceneManager::setOption(key, val); … … 639 647 640 648 // render standard solids without shadows during hierarchical culling pass 641 if ((mShadowTechnique == SHADOWTYPE_STENCIL_ADDITIVE) ||649 /*if ((mShadowTechnique == SHADOWTYPE_STENCIL_ADDITIVE) || 642 650 (mShadowTechnique == SHADOWTYPE_STENCIL_MODULATIVE)) 643 651 { 644 652 mShadowTechnique = SHADOWTYPE_NONE; 645 } 653 }*/ 646 654 647 655 // set depth pass flag before rendering 648 656 mRenderDepthPass = mUseDepthPass; 657 658 mIsHierarchicalCulling = true; // during hierarchical culling 649 659 650 660 // item buffer needs full ambient lighting to use item colors as unique id … … 662 672 mLeavePassesInQueue = 0; 663 673 664 if (!mUseDepthPass ||!mUseItemBuffer)665 { 666 if (mS hadowTechnique == SHADOWTYPE_STENCIL_ADDITIVE)674 if (!mUseDepthPass && !mUseItemBuffer) 675 { 676 if (mSavedShadowTechnique == SHADOWTYPE_STENCIL_ADDITIVE) 667 677 { 668 678 // TODO: remove this pass because it should be processed during hierarchical culling 669 mLeavePassesInQueue |= RenderPriorityGroup::SOLID_PASSES_NOSHADOW;679 //mLeavePassesInQueue |= RenderPriorityGroup::SOLID_PASSES_NOSHADOW; 670 680 671 681 mLeavePassesInQueue |= RenderPriorityGroup::SOLID_PASSES_DECAL; … … 675 685 // just render ambient passes 676 686 mIlluminationStage = IRS_AMBIENT; 677 } 678 679 if (mShadowTechnique == SHADOWTYPE_STENCIL_MODULATIVE) 687 getRenderQueue()->setSplitPassesByLightingType(true); 688 } 689 690 if (mSavedShadowTechnique == SHADOWTYPE_STENCIL_MODULATIVE) 680 691 { 681 692 mLeavePassesInQueue |= RenderPriorityGroup::SOLID_PASSES_NOSHADOW; … … 712 723 } 713 724 //----------------------------------------------------------------------- 714 /*void VisibilityOctreeSceneManager::renderBasicQueueGroupObjects(RenderQueueGroup* pGroup) 715 { 716 // Basic render loop: Iterate through priorities 717 RenderQueueGroup::PriorityMapIterator groupIt = pGroup->getIterator(); 718 719 while (groupIt.hasMoreElements()) 720 { 721 RenderPriorityGroup* pPriorityGrp = groupIt.getNext(); 722 723 // Sort the queue first 724 pPriorityGrp->sort(mCameraInProgress); 725 726 // Do solids 727 // TODO: render other solid passes for shadows 728 renderObjects(pPriorityGrp->_getSolidPassesNoShadows(), true); 729 730 // do solid passes no shadows if addititive stencil shadows 731 if (mSavedShadowTechnique == SHADOWTYPE_STENCIL_ADDITIVE) 732 renderObjects(pPriorityGrp->_getSolidPassesNoShadows(), true); 725 void VisibilityOctreeSceneManager::renderAdditiveStencilShadowedQueueGroupObjects(RenderQueueGroup* pGroup) 726 { 727 // only render solid passes during hierarchical culling 728 if (mIsHierarchicalCulling) 729 { 730 RenderQueueGroup::PriorityMapIterator groupIt = pGroup->getIterator(); 731 LightList lightList; 732 733 while (groupIt.hasMoreElements()) 734 { 735 RenderPriorityGroup* pPriorityGrp = groupIt.getNext(); 736 737 // Sort the queue first 738 pPriorityGrp->sort(mCameraInProgress); 739 740 // Clear light list 741 lightList.clear(); 742 743 // Render all the ambient passes first, no light iteration, no lights 744 mIlluminationStage = IRS_AMBIENT; 745 746 OctreeSceneManager::renderObjects(pPriorityGrp->_getSolidPasses(), false, &lightList); 747 // Also render any objects which have receive shadows disabled 748 OctreeSceneManager::renderObjects(pPriorityGrp->_getSolidPassesNoShadow(), true); 733 749 734 // Do transparents 735 renderObjects(pPriorityGrp->_getTransparentPasses(), true); 736 737 738 }// for each priority 739 }*/ 750 /*std::stringstream d; 751 d << " solid size: " << (int)pPriorityGrp->_getSolidPasses().size() 752 << " solid no shadow size: " << (int)pPriorityGrp->_getSolidPassesNoShadow().size() 753 << "difspec size: " << (int)pPriorityGrp->_getSolidPassesDiffuseSpecular().size() 754 << " decal size: " << (int)pPriorityGrp->_getSolidPassesDecal().size(); 755 LogManager::getSingleton().logMessage(d.str());*/ 756 } 757 } 758 else 759 { 760 OctreeSceneManager::renderAdditiveStencilShadowedQueueGroupObjects(pGroup); 761 762 /*RenderQueueGroup::PriorityMapIterator groupIt = pGroup->getIterator(); 763 LightList lightList; 764 765 while (groupIt.hasMoreElements()) 766 { 767 768 RenderPriorityGroup* pPriorityGrp = groupIt.getNext(); 769 770 // Sort the queue first 771 pPriorityGrp->sort(mCameraInProgress); 772 773 // Clear light list 774 lightList.clear(); 775 776 // Now iterate per light 777 mIlluminationStage = IRS_PER_LIGHT; 778 779 // Iterate over lights, render all volumes to stencil 780 LightList::const_iterator li, liend; 781 liend = mLightsAffectingFrustum.end(); 782 783 for (li = mLightsAffectingFrustum.begin(); li != liend; ++li) 784 { 785 LogManager::getSingleton().logMessage("iterating over lights"); 786 Light* l = *li; 787 // Set light state 788 789 if (l->getCastShadows()) 790 { 791 // Clear stencil 792 mDestRenderSystem->clearFrameBuffer(FBT_STENCIL); 793 renderShadowVolumesToStencil(l, mCameraInProgress); 794 // turn stencil check on 795 mDestRenderSystem->setStencilCheckEnabled(true); 796 // NB we render where the stencil is equal to zero to render lit areas 797 mDestRenderSystem->setStencilBufferParams(CMPF_EQUAL, 0); 798 } 799 800 // render lighting passes for this light 801 if (lightList.empty()) 802 lightList.push_back(l); 803 else 804 lightList[0] = l; 805 OctreeSceneManager::renderObjects(pPriorityGrp->_getSolidPassesDiffuseSpecular(), false, &lightList); 806 807 // Reset stencil params 808 mDestRenderSystem->setStencilBufferParams(); 809 mDestRenderSystem->setStencilCheckEnabled(false); 810 mDestRenderSystem->_setDepthBufferParams(); 811 812 }// for each light 813 814 // Now render decal passes, no need to set lights as lighting will be disabled 815 mIlluminationStage = IRS_DECAL; 816 OctreeSceneManager::renderObjects(pPriorityGrp->_getSolidPassesDecal(), false); 817 }// for each priority 818 819 // reset lighting stage 820 mIlluminationStage = IRS_NONE;*/ 821 } 822 } 823 //----------------------------------------------------------------------- 824 void VisibilityOctreeSceneManager::renderModulativeStencilShadowedQueueGroupObjects(RenderQueueGroup* pGroup) 825 { 826 if (mIsHierarchicalCulling) 827 { 828 // Iterate through priorities 829 RenderQueueGroup::PriorityMapIterator groupIt = pGroup->getIterator(); 830 831 while (groupIt.hasMoreElements()) 832 { 833 RenderPriorityGroup* pPriorityGrp = groupIt.getNext(); 834 835 // Sort the queue first 836 pPriorityGrp->sort(mCameraInProgress); 837 838 // Do (shadowable) solids 839 OctreeSceneManager::renderObjects(pPriorityGrp->_getSolidPasses(), true); 840 } 841 } 842 else 843 { 844 SceneManager::renderModulativeStencilShadowedQueueGroupObjects(pGroup); 845 } 846 } 740 847 } // namespace Ogre -
trunk/VUT/Ogre/src/OgreVisibilityOptionsManager.cpp
r155 r187 4 4 //----------------------------------------------------------------------- 5 5 VisibilityOptionsManager::VisibilityOptionsManager( 6 GtpVisibility::VisibilityManager *visManager,7 GtpVisibility::HierarchyInterface *hierarchyInterface):6 GtpVisibility::VisibilityManager *visManager, 7 PlatformHierarchyInterface *hierarchyInterface): 8 8 mVisibilityManager(visManager), 9 9 mHierarchyInterface(hierarchyInterface) … … 11 11 } 12 12 //----------------------------------------------------------------------- 13 bool VisibilityOptionsManager::setOption( const String & key, const void * val)13 bool VisibilityOptionsManager::setOption(const String & key, const void * val) 14 14 { 15 15 if (key == "Algorithm") 16 16 { 17 mHierarchyInterface->DeleteQueries(); 17 18 mVisibilityManager->SetCullingManager(*static_cast<const 18 19 GtpVisibility::VisibilityEnvironment::CullingManagerType *>(val)); -
trunk/VUT/Ogre/src/OgreVisibilityTerrainSceneManager.cpp
r175 r187 32 32 mSkipTransparents(false), 33 33 mSavedShadowTechnique(SHADOWTYPE_NONE), 34 mRenderTransparentsForItemBuffer( false),35 mExecuteVertexProgramForAllPasses( false)34 mRenderTransparentsForItemBuffer(true), 35 mExecuteVertexProgramForAllPasses(true) 36 36 { 37 37 mHierarchyInterface = new OctreeHierarchyInterface(this, mDestRenderSystem); 38 38 39 //mDisplayNodes = true;//mShowBoundingBoxes = true;//mShowBoxes = true; 39 //mDisplayNodes = true; 40 //mShowBoundingBoxes = true; 41 //mShowBoxes = true; 40 42 41 43 // TODO: set maxdepth to reasonable value … … 209 211 } 210 212 //----------------------------------------------------------------------- 211 void VisibilityTerrainSceneManager::_findVisibleObjects(Camera* cam, bool onlyShadowCasters) 213 void VisibilityTerrainSceneManager::_findVisibleObjects(Camera* cam, 214 bool onlyShadowCasters) 212 215 { 213 216 //-- show visible scene nodes and octree bounding boxes from last frame … … 345 348 346 349 getRenderQueue()->clear(); // finally clear render queue 350 OGRE_DELETE(mRenderQueue); // HACK: should be cleared before... 347 351 //WriteLog(); // write out stats 348 352 } … … 423 427 { 424 428 mRenderTransparentsForItemBuffer = (*static_cast<const bool *>(val)); 429 return true; 430 } 431 if (key == "NodeVizScale") 432 { 433 OctreeNode::setVizScale(*static_cast<const float *>(val)); 425 434 return true; 426 435 } … … 663 672 if (!mUseDepthPass || !mUseItemBuffer) 664 673 { 665 if (mS hadowTechnique == SHADOWTYPE_STENCIL_ADDITIVE)674 if (mSavedShadowTechnique == SHADOWTYPE_STENCIL_ADDITIVE) 666 675 { 667 676 // TODO: remove this pass because it should be processed during hierarchical culling 677 //mLeavePassesInQueue |= RenderPriorityGroup::SOLID_PASSES; 668 678 mLeavePassesInQueue |= RenderPriorityGroup::SOLID_PASSES_NOSHADOW; 669 679 … … 676 686 } 677 687 678 if (mS hadowTechnique == SHADOWTYPE_STENCIL_MODULATIVE)688 if (mSavedShadowTechnique == SHADOWTYPE_STENCIL_MODULATIVE) 679 689 { 680 690 mLeavePassesInQueue |= RenderPriorityGroup::SOLID_PASSES_NOSHADOW; -
trunk/VUT/scripts/GtpVisibility.sln
r183 r187 21 21 EndProjectSection 22 22 EndProject 23 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_IV", "..\work\iv\scripts\Demo_IV.vcproj", "{640481BA-D8FE-41ED-B2F2-9844A8CA1E40}"24 ProjectSection(ProjectDependencies) = postProject25 {80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}26 {101A7691-74F3-48B4-96A3-CF35578F5900} = {101A7691-74F3-48B4-96A3-CF35578F5900}27 {7319E499-473D-4CE5-9983-725D6E68A55D} = {7319E499-473D-4CE5-9983-725D6E68A55D}28 EndProjectSection29 EndProject30 23 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Preprocessor", "..\GtpVisibilityPreprocessor\scripts\Preprocessor.vcproj", "{EABCE292-D598-4600-A1C9-2591E7D62FDA}" 31 24 ProjectSection(ProjectDependencies) = postProject … … 34 27 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IVReader", "..\work\IVReader\scripts\IVReader.vcproj", "{7319E499-473D-4CE5-9983-725D6E68A55D}" 35 28 ProjectSection(ProjectDependencies) = postProject 29 EndProjectSection 30 EndProject 31 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_IV", "..\work\iv\Demo_IV.vcproj", "{640481BA-D8FE-41ED-B2F2-9844A8CA1E40}" 32 ProjectSection(ProjectDependencies) = postProject 33 {80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436} 34 {101A7691-74F3-48B4-96A3-CF35578F5900} = {101A7691-74F3-48B4-96A3-CF35578F5900} 35 {7319E499-473D-4CE5-9983-725D6E68A55D} = {7319E499-473D-4CE5-9983-725D6E68A55D} 36 36 EndProjectSection 37 37 EndProject … … 58 58 {248F19A6-2FE0-4F5D-8928-E0EA10609887}.Release.ActiveCfg = Release|Win32 59 59 {248F19A6-2FE0-4F5D-8928-E0EA10609887}.Release.Build.0 = Release|Win32 60 {640481BA-D8FE-41ED-B2F2-9844A8CA1E40}.Debug.ActiveCfg = Debug|Win3261 {640481BA-D8FE-41ED-B2F2-9844A8CA1E40}.Debug.Build.0 = Debug|Win3262 {640481BA-D8FE-41ED-B2F2-9844A8CA1E40}.Release.ActiveCfg = Release|Win3263 {640481BA-D8FE-41ED-B2F2-9844A8CA1E40}.Release.Build.0 = Release|Win3264 60 {EABCE292-D598-4600-A1C9-2591E7D62FDA}.Debug.ActiveCfg = Debug|Win32 65 61 {EABCE292-D598-4600-A1C9-2591E7D62FDA}.Debug.Build.0 = Debug|Win32 … … 70 66 {7319E499-473D-4CE5-9983-725D6E68A55D}.Release.ActiveCfg = Release|Win32 71 67 {7319E499-473D-4CE5-9983-725D6E68A55D}.Release.Build.0 = Release|Win32 68 {640481BA-D8FE-41ED-B2F2-9844A8CA1E40}.Debug.ActiveCfg = Debug|Win32 69 {640481BA-D8FE-41ED-B2F2-9844A8CA1E40}.Debug.Build.0 = Debug|Win32 70 {640481BA-D8FE-41ED-B2F2-9844A8CA1E40}.Release.ActiveCfg = Release|Win32 71 {640481BA-D8FE-41ED-B2F2-9844A8CA1E40}.Release.Build.0 = Release|Win32 72 72 EndGlobalSection 73 73 GlobalSection(ExtensibilityGlobals) = postSolution -
trunk/VUT/work/IVReader/include/ivmeshdata.h
r183 r187 5 5 #include <Ogre.h> 6 6 7 enum IVRenderOperationType7 enum mIVReaderenderOperationType 8 8 { 9 9 IV_ROT_INVALID = -1, … … 25 25 Ogre::Real *vertices, *normals, *texCoords, *indices, *normalIndices, *texCoordIndices; 26 26 int vcnt, ncnt, tcnt, icnt, nicnt, ticnt; 27 IVRenderOperationType roType;27 mIVReaderenderOperationType roType; 28 28 Ogre::AxisAlignedBox *boundingBox; 29 29 -
trunk/VUT/work/IVReader/include/ivreader.h
r183 r187 1 #ifndef __ IVReader_H__2 #define __ IVReader_H__1 #ifndef __mIVReader_H__ 2 #define __mIVReader_H__ 3 3 4 4 … … 120 120 Ogre::Entity *createEntity(Ogre::SceneManager* sceneMgr, std::string name, IVMeshData *mData, Ogre::Vector3 *translation = NULL); 121 121 122 void buildTree(Ogre::SceneManager *sceneMgr, Ogre::SceneNode *sceneNodeRoot, IVNode * ivRoot, IVMeshData *mData = NULL, Ogre::Material *material = NULL);122 void buildTree(Ogre::SceneManager *sceneMgr, Ogre::SceneNode *sceneNodeRoot, IVNode *mIVReaderoot, IVMeshData *mData = NULL, Ogre::Material *material = NULL); 123 123 124 124 IVDefListNode *defList; -
trunk/VUT/work/IVReader/src/ivmanualmeshloader.cpp
r183 r187 1 1 #include "ivmanualmeshloader.h" 2 #include " IVReader.h"2 #include "ivreader.h" 3 3 4 4 IVManualMeshLoader::IVManualMeshLoader() -
trunk/VUT/work/IVReader/src/ivmeshdata.cpp
r183 r187 1 1 #include "ivmeshdata.h" 2 #include " IVReader.h"2 #include "ivreader.h" 3 3 4 4 -
trunk/VUT/work/IVReader/src/ivnode.cpp
r183 r187 1 1 #include "ivnode.h" 2 #include " IVReader.h"2 #include "ivreader.h" 3 3 4 4 IVField::IVField() -
trunk/VUT/work/IVReader/src/ivreader.cpp
r183 r187 1 #include " ivreader.h"1 #include "IVReader.h" 2 2 #include <string> 3 3 #include <stdlib.h> … … 571 571 } 572 572 573 void IVReader::buildTree(Ogre::SceneManager* sceneMgr, Ogre::SceneNode *sceneNodeRoot, IVNode * ivRoot, IVMeshData *mData, Ogre::Material *material)573 void IVReader::buildTree(Ogre::SceneManager* sceneMgr, Ogre::SceneNode *sceneNodeRoot, IVNode *IVReaderoot, IVMeshData *mData, Ogre::Material *material) 574 574 { 575 575 using namespace Ogre; … … 586 586 IVType t; int i; 587 587 588 IVNode *help = ivRoot->getNextChildNode(true);588 IVNode *help = IVReaderoot->getNextChildNode(true); 589 589 while (help != NULL) 590 590 { … … 766 766 } 767 767 768 help = ivRoot->getNextChildNode();768 help = IVReaderoot->getNextChildNode(); 769 769 } 770 770 if (meshDataCreated) if (mData != NULL) delete mData; -
trunk/VUT/work/TestCullingTerrain/TerrainFrameListener.cpp
r183 r187 169 169 170 170 // set scene manager options 171 mSceneMgr->setOption("TestGeometryForVisibleLeaves", &mTestGeometryForVisibleLeaves); 172 173 // apply delayed rendering (i.e., transparents after hierarchical culling pass) 174 // only if optimization is not used 175 bool delayRenderTransparents = !mTestGeometryForVisibleLeaves; 176 177 mSceneMgr->setOption("DelayRenderTransparents", &delayRenderTransparents); 171 setTestGeometryForVisibleLeaves(mTestGeometryForVisibleLeaves); 172 178 173 mSceneMgr->setOption("UseDepthPass", &mUseDepthPass); 179 174 … … 190 185 TerrainFrameListener::~TerrainFrameListener() 191 186 { 192 delete mRayQueryExecutor; 193 delete mEventProcessor; 194 195 if (mQueryManager) 196 { 197 delete mQueryManager; 198 mQueryManager = NULL; 199 } 187 OGRE_DELETE(mRayQueryExecutor); 188 OGRE_DELETE(mEventProcessor); 189 OGRE_DELETE(mQueryManager); 200 190 } 201 191 //----------------------------------------------------------------------- … … 858 848 } 859 849 //----------------------------------------------------------------------- 860 void TerrainFrameListener::toggleTestGeometryForVisibleLeaves() 861 { 862 mTestGeometryForVisibleLeaves = !mTestGeometryForVisibleLeaves; 850 void TerrainFrameListener::setTestGeometryForVisibleLeaves(bool testGeometryForVisibleLeaves) 851 { 863 852 mSceneMgr->setOption("TestGeometryForVisibleLeaves", &mTestGeometryForVisibleLeaves); 864 853 … … 1005 994 break; 1006 995 case KC_G: 1007 toggleTestGeometryForVisibleLeaves(); 996 mTestGeometryForVisibleLeaves = !mTestGeometryForVisibleLeaves; 997 setTestGeometryForVisibleLeaves(mTestGeometryForVisibleLeaves); 1008 998 break; 1009 999 case KC_T: -
trunk/VUT/work/TestCullingTerrain/TerrainFrameListener.h
r174 r187 119 119 void changeThreshold(int incr); 120 120 void changeAssumedVisibility(int incr); 121 void toggleTestGeometryForVisibleLeaves();121 void setTestGeometryForVisibleLeaves(bool testGeometryForVisibleLeaves); 122 122 void toggleShowOctree(); 123 123 void toggleUseDepthPass(); -
trunk/VUT/work/TestCullingTerrain/TestCullingTerrain.vcproj
r136 r187 73 73 <Tool 74 74 Name="VCCLCompilerTool" 75 AdditionalIncludeDirectories=""$(OGRE_PATH)\Dependencies\include";"$(OGRE_PATH)\OgreMain\include";"$(OGRE_PATH)\Samples\Common\include";"$(OGRE_PATH)\Dependencies\include\CEGUI";"$(OGRE_PATH)\ ReferenceApplication\ReferenceAppLayer\include";"$(OGRE_PATH)\PlugIns\OctreeSceneManager\include";"$(OGRE_ADDONS_PATH)\dotsceneoctree\PlugIns\DotSceneManager\include";"$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include";..\..\Ogre\include;..\..\GtpVisibility\include;..\include;..\TestCulling"75 AdditionalIncludeDirectories=""$(OGRE_PATH)\Dependencies\include";"$(OGRE_PATH)\OgreMain\include";"$(OGRE_PATH)\Samples\Common\include";"$(OGRE_PATH)\Dependencies\include\CEGUI";"$(OGRE_PATH)\PlugIns\OctreeSceneManager\include";"$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include";..\..\Ogre\include;..\..\GtpVisibility\include;..\include" 76 76 PreprocessorDefinitions="_WINDOWS;_STLP_USE_DYNAMIC_LIB;OGRE_LIBRARY_IMPORTS;_RELEASE;WIN32;_STLP_RELEASE;GTP_VISIBILITY_MODIFIED_OGRE" 77 77 RuntimeLibrary="2" … … 88 88 OutputFile="$(OGRE_PATH)/Samples/Common/bin/Release/TestCullingTerrain.exe" 89 89 LinkIncremental="1" 90 AdditionalLibraryDirectories=""$(OGRE_PATH)\Dependencies\Lib\$(ConfigurationName)";"$(OGRE_ ADDONS_PATH)\dotsceneoctree\PlugIns\DotSceneManager\bin\$(ConfigurationName)";"$(OGRE_PATH)\OgreMain\Lib\$(ConfigurationName)";"$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)";"$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib";"$(GAMETOOLS_PATH)\trunk\VUT\Ogre\lib\$(ConfigurationName)""90 AdditionalLibraryDirectories=""$(OGRE_PATH)\Dependencies\Lib\$(ConfigurationName)";"$(OGRE_PATH)\OgreMain\Lib\$(ConfigurationName)";"$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)";"$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib";"$(GAMETOOLS_PATH)\trunk\VUT\Ogre\lib\$(ConfigurationName)"" 91 91 GenerateDebugInformation="TRUE" 92 92 SubSystem="2" -
trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.cpp
r175 r187 227 227 void TestCullingTerrainApplication::createScene() 228 228 { 229 Real scale = 3; 230 mSceneMgr->setOption("NodeVizScale", &scale); 231 229 232 // Set ambient light 230 233 mAmbientLight = ColourValue(0.5 , 0.5, 0.5); -
trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/src/OgreOctreeNode.cpp
r183 r187 46 46 unsigned long green = 0xFFFFFFFF; 47 47 48 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 49 Real OctreeNode::msVizScale = 1; 50 #endif // GTP_VISIBILITY_MODIFIED_OGRE 51 48 52 unsigned short OctreeNode::mIndexes[ 24 ] = {0, 1, 1, 2, 2, 3, 3, 0, //back 49 53 0, 6, 6, 5, 5, 1, //left … … 187 191 } 188 192 193 //LogManager::getSingleton().logMessage("hagaaggaagag"); 189 194 AxisAlignedBox box = mLocalAABB; 195 190 196 // HACK: scale should not be done here 191 box.scale(Vector3(3, 3, 3)); 197 box.scale(Vector3(msVizScale, msVizScale, msVizScale)); 198 192 199 mWireBoundingBox->setupBoundingBox(box); 193 200 mWireBoundingBox->getRenderOperation(rend); … … 224 231 225 232 } 226 } 233 234 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 235 void OctreeNode::setVizScale(Real scale) 236 { 237 msVizScale = scale; 238 } 239 #endif // GTP_VISIBILITY_MODIFIED_OGRE 240 }
Note: See TracChangeset
for help on using the changeset viewer.