Changeset 187


Ignore:
Timestamp:
07/31/05 11:16:09 (19 years ago)
Author:
mattausch
Message:

added animationbug fix (deleting while animation)fixed visibilityQueriesadditive shadow volumes fixed for octree
hack to fully empty queue after traversal
added demo for vienna model

Location:
trunk/VUT
Files:
7 added
2 deleted
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibility/src/CoherentHierarchicalCullingManager.cpp

    r175 r187  
    8383                                         
    8484                                // 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)) 
    8686                                { 
    8787                                        SkipQuery(node); 
  • trunk/VUT/Ogre/include/OgrePlatformHierarchyInterface.h

    r175 r187  
    108108        GtpVisibility::OcclusionQuery *IssuePatchOcclusionQuery(GtpVisibility::Patch *patch); 
    109109 
     110        /** Deletes all occlusion queries. 
     111        */ 
     112        void DeleteQueries(); 
     113 
    110114protected: 
    111115        /** Renders the given geometry  
     
    120124        */ 
    121125        void CreateNodeVizMaterials(); 
    122  
    123         /** Deletes all occlusion queries. 
    124         */ 
    125         void DeleteQueries(); 
    126126 
    127127        /** Returns pointer to current renderable bounding box geometry. 
  • trunk/VUT/Ogre/include/OgreVisibilityOctreeSceneManager.h

    r159 r187  
    8383        OctreeHierarchyInterface *GetHierarchyInterface(); 
    8484 
     85        void renderAdditiveStencilShadowedQueueGroupObjects(RenderQueueGroup* pGroup); 
     86        void renderModulativeStencilShadowedQueueGroupObjects(RenderQueueGroup* pGroup); 
    8587 
    8688protected: 
     
    146148        /// Always execute the vertex program of a pass, e.g., for the depth pass or item buffer 
    147149        bool mExecuteVertexProgramForAllPasses; 
     150 
     151        bool mIsHierarchicalCulling; 
    148152}; 
    149153 
  • trunk/VUT/Ogre/include/OgreVisibilityOptionsManager.h

    r130 r187  
    66#include <OgreStringVector.h> 
    77#include "VisibilityManager.h" 
    8 #include "HierarchyInterface.h" 
     8#include "OgrePlatformHierarchyInterface.h" 
    99 
    1010 
     
    2525        */ 
    2626        VisibilityOptionsManager(GtpVisibility::VisibilityManager *visManager,  
    27                                                          GtpVisibility::HierarchyInterface *hierarchyInterface); 
     27                                                         PlatformHierarchyInterface *hierarchyInterface); 
    2828         
    2929        /** Sets the given option for the scene traverser. 
     
    4242protected: 
    4343        GtpVisibility::VisibilityManager *mVisibilityManager; 
    44         GtpVisibility::HierarchyInterface *mHierarchyInterface; 
     44        PlatformHierarchyInterface *mHierarchyInterface; 
    4545}; 
    4646 
  • trunk/VUT/Ogre/src/OgrePlatformHierarchyInterface.cpp

    r183 r187  
    6868        DeleteQueries(); 
    6969 
    70         if (mSolidBoundingBox) 
    71                 delete mSolidBoundingBox; 
     70        OGRE_DELETE(mSolidBoundingBox); 
    7271} 
    7372//----------------------------------------------------------------------- 
    7473void PlatformHierarchyInterface::DeleteQueries() 
    7574{ 
    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(); 
    8080} 
    8181//----------------------------------------------------------------------- 
  • trunk/VUT/Ogre/src/OgreVisibilityOctreeSceneManager.cpp

    r175 r187  
    3333mSkipTransparents(false), 
    3434mSavedShadowTechnique(SHADOWTYPE_NONE), 
    35 mRenderTransparentsForItemBuffer(false), 
    36 mExecuteVertexProgramForAllPasses(false) 
     35mRenderTransparentsForItemBuffer(true), 
     36mExecuteVertexProgramForAllPasses(true), 
     37mIsHierarchicalCulling(false) 
    3738{ 
    3839        mHierarchyInterface = new OctreeHierarchyInterface(this, mDestRenderSystem); 
     
    318319                mRenderItemBuffer = false; 
    319320                mSkipTransparents = false; 
     321                mIsHierarchicalCulling = false; 
     322 
    320323                mLeavePassesInQueue = 0; 
    321324                mShadowTechnique = mSavedShadowTechnique; 
     
    342345         
    343346        getRenderQueue()->clear(); // finally clear render queue 
     347        OGRE_DELETE(mRenderQueue); // HACK: should be cleared before... 
    344348        //WriteLog(); // write out stats 
    345349} 
     
    422426                return true; 
    423427        } 
    424  
     428        if (key == "NodeVizScale") 
     429        {  
     430                OctreeNode::setVizScale(*static_cast<const float *>(val)); 
     431                return true; 
     432        } 
    425433        return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface). 
    426434                setOption(key, val) || OctreeSceneManager::setOption(key, val); 
     
    639647 
    640648        // render standard solids without shadows during hierarchical culling pass 
    641         if ((mShadowTechnique == SHADOWTYPE_STENCIL_ADDITIVE) || 
     649        /*if ((mShadowTechnique == SHADOWTYPE_STENCIL_ADDITIVE) || 
    642650            (mShadowTechnique == SHADOWTYPE_STENCIL_MODULATIVE)) 
    643651        {        
    644652                mShadowTechnique = SHADOWTYPE_NONE; 
    645         } 
     653        }*/ 
    646654 
    647655        // set depth pass flag before rendering 
    648656        mRenderDepthPass = mUseDepthPass; 
     657 
     658        mIsHierarchicalCulling = true; // during hierarchical culling 
    649659 
    650660        // item buffer needs full ambient lighting to use item colors as unique id 
     
    662672        mLeavePassesInQueue = 0; 
    663673 
    664         if (!mUseDepthPass || !mUseItemBuffer) 
    665         { 
    666                 if (mShadowTechnique == SHADOWTYPE_STENCIL_ADDITIVE) 
     674        if (!mUseDepthPass && !mUseItemBuffer) 
     675        { 
     676                if (mSavedShadowTechnique == SHADOWTYPE_STENCIL_ADDITIVE) 
    667677                { 
    668678                        // TODO: remove this pass because it should be processed during hierarchical culling 
    669                         mLeavePassesInQueue |= RenderPriorityGroup::SOLID_PASSES_NOSHADOW; 
     679                        //mLeavePassesInQueue |= RenderPriorityGroup::SOLID_PASSES_NOSHADOW; 
    670680 
    671681                        mLeavePassesInQueue |= RenderPriorityGroup::SOLID_PASSES_DECAL; 
     
    675685                        // just render ambient passes 
    676686                        mIlluminationStage = IRS_AMBIENT; 
    677                 } 
    678          
    679                 if (mShadowTechnique == SHADOWTYPE_STENCIL_MODULATIVE) 
     687                        getRenderQueue()->setSplitPassesByLightingType(true); 
     688                } 
     689         
     690                if (mSavedShadowTechnique == SHADOWTYPE_STENCIL_MODULATIVE) 
    680691                { 
    681692                        mLeavePassesInQueue |= RenderPriorityGroup::SOLID_PASSES_NOSHADOW; 
     
    712723} 
    713724//----------------------------------------------------------------------- 
    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); 
     725void 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); 
    733749                 
    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//----------------------------------------------------------------------- 
     824void 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} 
    740847}   // namespace Ogre 
  • trunk/VUT/Ogre/src/OgreVisibilityOptionsManager.cpp

    r155 r187  
    44//----------------------------------------------------------------------- 
    55VisibilityOptionsManager::VisibilityOptionsManager( 
    6         GtpVisibility::VisibilityManager *visManager,  
    7         GtpVisibility::HierarchyInterface *hierarchyInterface): 
     6                                                        GtpVisibility::VisibilityManager *visManager,  
     7                                                        PlatformHierarchyInterface *hierarchyInterface): 
    88mVisibilityManager(visManager),  
    99mHierarchyInterface(hierarchyInterface) 
     
    1111} 
    1212//----------------------------------------------------------------------- 
    13 bool VisibilityOptionsManager::setOption( const String & key, const void * val ) 
     13bool VisibilityOptionsManager::setOption(const String & key, const void * val) 
    1414{ 
    1515        if (key == "Algorithm") 
    1616        { 
     17                mHierarchyInterface->DeleteQueries(); 
    1718                mVisibilityManager->SetCullingManager(*static_cast<const  
    1819                        GtpVisibility::VisibilityEnvironment::CullingManagerType *>(val)); 
  • trunk/VUT/Ogre/src/OgreVisibilityTerrainSceneManager.cpp

    r175 r187  
    3232mSkipTransparents(false), 
    3333mSavedShadowTechnique(SHADOWTYPE_NONE), 
    34 mRenderTransparentsForItemBuffer(false), 
    35 mExecuteVertexProgramForAllPasses(false) 
     34mRenderTransparentsForItemBuffer(true), 
     35mExecuteVertexProgramForAllPasses(true) 
    3636{ 
    3737        mHierarchyInterface = new OctreeHierarchyInterface(this, mDestRenderSystem); 
    3838         
    39         //mDisplayNodes = true;//mShowBoundingBoxes = true;//mShowBoxes = true; 
     39        //mDisplayNodes = true; 
     40        //mShowBoundingBoxes = true; 
     41        //mShowBoxes = true; 
    4042 
    4143        // TODO: set maxdepth to reasonable value 
     
    209211} 
    210212//----------------------------------------------------------------------- 
    211 void VisibilityTerrainSceneManager::_findVisibleObjects(Camera* cam, bool onlyShadowCasters) 
     213void VisibilityTerrainSceneManager::_findVisibleObjects(Camera* cam, 
     214                                                                                                                bool onlyShadowCasters) 
    212215{ 
    213216        //-- show visible scene nodes and octree bounding boxes from last frame 
     
    345348 
    346349        getRenderQueue()->clear(); // finally clear render queue 
     350        OGRE_DELETE(mRenderQueue); // HACK: should be cleared before... 
    347351        //WriteLog(); // write out stats 
    348352} 
     
    423427        {  
    424428                mRenderTransparentsForItemBuffer  = (*static_cast<const bool *>(val)); 
     429                return true; 
     430        } 
     431        if (key == "NodeVizScale") 
     432        {  
     433                OctreeNode::setVizScale(*static_cast<const float *>(val)); 
    425434                return true; 
    426435        } 
     
    663672        if (!mUseDepthPass || !mUseItemBuffer) 
    664673        { 
    665                 if (mShadowTechnique == SHADOWTYPE_STENCIL_ADDITIVE) 
     674                if (mSavedShadowTechnique == SHADOWTYPE_STENCIL_ADDITIVE) 
    666675                { 
    667676                        // TODO: remove this pass because it should be processed during hierarchical culling 
     677                        //mLeavePassesInQueue |= RenderPriorityGroup::SOLID_PASSES; 
    668678                        mLeavePassesInQueue |= RenderPriorityGroup::SOLID_PASSES_NOSHADOW; 
    669679 
     
    676686                } 
    677687         
    678                 if (mShadowTechnique == SHADOWTYPE_STENCIL_MODULATIVE) 
     688                if (mSavedShadowTechnique == SHADOWTYPE_STENCIL_MODULATIVE) 
    679689                { 
    680690                        mLeavePassesInQueue |= RenderPriorityGroup::SOLID_PASSES_NOSHADOW; 
  • trunk/VUT/scripts/GtpVisibility.sln

    r183 r187  
    2121        EndProjectSection 
    2222EndProject 
    23 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_IV", "..\work\iv\scripts\Demo_IV.vcproj", "{640481BA-D8FE-41ED-B2F2-9844A8CA1E40}" 
    24         ProjectSection(ProjectDependencies) = postProject 
    25                 {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         EndProjectSection 
    29 EndProject 
    3023Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Preprocessor", "..\GtpVisibilityPreprocessor\scripts\Preprocessor.vcproj", "{EABCE292-D598-4600-A1C9-2591E7D62FDA}" 
    3124        ProjectSection(ProjectDependencies) = postProject 
     
    3427Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IVReader", "..\work\IVReader\scripts\IVReader.vcproj", "{7319E499-473D-4CE5-9983-725D6E68A55D}" 
    3528        ProjectSection(ProjectDependencies) = postProject 
     29        EndProjectSection 
     30EndProject 
     31Project("{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} 
    3636        EndProjectSection 
    3737EndProject 
     
    5858                {248F19A6-2FE0-4F5D-8928-E0EA10609887}.Release.ActiveCfg = Release|Win32 
    5959                {248F19A6-2FE0-4F5D-8928-E0EA10609887}.Release.Build.0 = Release|Win32 
    60                 {640481BA-D8FE-41ED-B2F2-9844A8CA1E40}.Debug.ActiveCfg = Debug|Win32 
    61                 {640481BA-D8FE-41ED-B2F2-9844A8CA1E40}.Debug.Build.0 = Debug|Win32 
    62                 {640481BA-D8FE-41ED-B2F2-9844A8CA1E40}.Release.ActiveCfg = Release|Win32 
    63                 {640481BA-D8FE-41ED-B2F2-9844A8CA1E40}.Release.Build.0 = Release|Win32 
    6460                {EABCE292-D598-4600-A1C9-2591E7D62FDA}.Debug.ActiveCfg = Debug|Win32 
    6561                {EABCE292-D598-4600-A1C9-2591E7D62FDA}.Debug.Build.0 = Debug|Win32 
     
    7066                {7319E499-473D-4CE5-9983-725D6E68A55D}.Release.ActiveCfg = Release|Win32 
    7167                {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 
    7272        EndGlobalSection 
    7373        GlobalSection(ExtensibilityGlobals) = postSolution 
  • trunk/VUT/work/IVReader/include/ivmeshdata.h

    r183 r187  
    55#include <Ogre.h> 
    66 
    7 enum IVRenderOperationType 
     7enum mIVReaderenderOperationType 
    88{ 
    99        IV_ROT_INVALID = -1, 
     
    2525                Ogre::Real *vertices, *normals, *texCoords, *indices, *normalIndices, *texCoordIndices; 
    2626                int vcnt, ncnt, tcnt, icnt, nicnt, ticnt; 
    27                 IVRenderOperationType roType; 
     27                mIVReaderenderOperationType roType; 
    2828                Ogre::AxisAlignedBox *boundingBox; 
    2929 
  • 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__ 
    33 
    44 
     
    120120                Ogre::Entity *createEntity(Ogre::SceneManager* sceneMgr, std::string name, IVMeshData *mData, Ogre::Vector3 *translation = NULL); 
    121121 
    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); 
    123123 
    124124                IVDefListNode *defList; 
  • trunk/VUT/work/IVReader/src/ivmanualmeshloader.cpp

    r183 r187  
    11#include "ivmanualmeshloader.h" 
    2 #include "IVReader.h" 
     2#include "ivreader.h" 
    33 
    44IVManualMeshLoader::IVManualMeshLoader() 
  • trunk/VUT/work/IVReader/src/ivmeshdata.cpp

    r183 r187  
    11#include "ivmeshdata.h" 
    2 #include "IVReader.h" 
     2#include "ivreader.h" 
    33 
    44 
  • trunk/VUT/work/IVReader/src/ivnode.cpp

    r183 r187  
    11#include "ivnode.h" 
    2 #include "IVReader.h" 
     2#include "ivreader.h" 
    33 
    44IVField::IVField() 
  • trunk/VUT/work/IVReader/src/ivreader.cpp

    r183 r187  
    1 #include "ivreader.h" 
     1#include "IVReader.h" 
    22#include <string> 
    33#include <stdlib.h> 
     
    571571} 
    572572 
    573 void IVReader::buildTree(Ogre::SceneManager* sceneMgr,  Ogre::SceneNode *sceneNodeRoot, IVNode *ivRoot, IVMeshData *mData, Ogre::Material *material) 
     573void IVReader::buildTree(Ogre::SceneManager* sceneMgr,  Ogre::SceneNode *sceneNodeRoot, IVNode *IVReaderoot, IVMeshData *mData, Ogre::Material *material) 
    574574{ 
    575575        using namespace Ogre; 
     
    586586        IVType t; int i; 
    587587         
    588         IVNode *help = ivRoot->getNextChildNode(true); 
     588        IVNode *help = IVReaderoot->getNextChildNode(true); 
    589589        while (help != NULL) 
    590590        {        
     
    766766                } 
    767767 
    768                 help = ivRoot->getNextChildNode(); 
     768                help = IVReaderoot->getNextChildNode(); 
    769769        } 
    770770        if (meshDataCreated) if (mData != NULL) delete mData; 
  • trunk/VUT/work/TestCullingTerrain/TerrainFrameListener.cpp

    r183 r187  
    169169 
    170170        // 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 
    178173        mSceneMgr->setOption("UseDepthPass", &mUseDepthPass); 
    179174         
     
    190185TerrainFrameListener::~TerrainFrameListener() 
    191186{ 
    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); 
    200190} 
    201191//----------------------------------------------------------------------- 
     
    858848} 
    859849//----------------------------------------------------------------------- 
    860 void TerrainFrameListener::toggleTestGeometryForVisibleLeaves() 
    861 { 
    862         mTestGeometryForVisibleLeaves = !mTestGeometryForVisibleLeaves; 
     850void TerrainFrameListener::setTestGeometryForVisibleLeaves(bool testGeometryForVisibleLeaves) 
     851{ 
    863852        mSceneMgr->setOption("TestGeometryForVisibleLeaves", &mTestGeometryForVisibleLeaves); 
    864853         
     
    1005994                break; 
    1006995        case KC_G: 
    1007                 toggleTestGeometryForVisibleLeaves(); 
     996                mTestGeometryForVisibleLeaves = !mTestGeometryForVisibleLeaves; 
     997                setTestGeometryForVisibleLeaves(mTestGeometryForVisibleLeaves); 
    1008998                break; 
    1009999        case KC_T: 
  • trunk/VUT/work/TestCullingTerrain/TerrainFrameListener.h

    r174 r187  
    119119    void changeThreshold(int incr); 
    120120        void changeAssumedVisibility(int incr); 
    121         void toggleTestGeometryForVisibleLeaves(); 
     121        void setTestGeometryForVisibleLeaves(bool testGeometryForVisibleLeaves); 
    122122        void toggleShowOctree(); 
    123123        void toggleUseDepthPass(); 
  • trunk/VUT/work/TestCullingTerrain/TestCullingTerrain.vcproj

    r136 r187  
    7373                        <Tool 
    7474                                Name="VCCLCompilerTool" 
    75                                 AdditionalIncludeDirectories="&quot;$(OGRE_PATH)\Dependencies\include&quot;;&quot;$(OGRE_PATH)\OgreMain\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include\CEGUI&quot;;&quot;$(OGRE_PATH)\ReferenceApplication\ReferenceAppLayer\include&quot;;&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\include&quot;;&quot;$(OGRE_ADDONS_PATH)\dotsceneoctree\PlugIns\DotSceneManager\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include&quot;;..\..\Ogre\include;..\..\GtpVisibility\include;..\include;..\TestCulling" 
     75                                AdditionalIncludeDirectories="&quot;$(OGRE_PATH)\Dependencies\include&quot;;&quot;$(OGRE_PATH)\OgreMain\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include\CEGUI&quot;;&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include&quot;;..\..\Ogre\include;..\..\GtpVisibility\include;..\include" 
    7676                                PreprocessorDefinitions="_WINDOWS;_STLP_USE_DYNAMIC_LIB;OGRE_LIBRARY_IMPORTS;_RELEASE;WIN32;_STLP_RELEASE;GTP_VISIBILITY_MODIFIED_OGRE" 
    7777                                RuntimeLibrary="2" 
     
    8888                                OutputFile="$(OGRE_PATH)/Samples/Common/bin/Release/TestCullingTerrain.exe" 
    8989                                LinkIncremental="1" 
    90                                 AdditionalLibraryDirectories="&quot;$(OGRE_PATH)\Dependencies\Lib\$(ConfigurationName)&quot;;&quot;$(OGRE_ADDONS_PATH)\dotsceneoctree\PlugIns\DotSceneManager\bin\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\OgreMain\Lib\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib&quot;;&quot;$(GAMETOOLS_PATH)\trunk\VUT\Ogre\lib\$(ConfigurationName)&quot;" 
     90                                AdditionalLibraryDirectories="&quot;$(OGRE_PATH)\Dependencies\Lib\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\OgreMain\Lib\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib&quot;;&quot;$(GAMETOOLS_PATH)\trunk\VUT\Ogre\lib\$(ConfigurationName)&quot;" 
    9191                                GenerateDebugInformation="TRUE" 
    9292                                SubSystem="2" 
  • trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.cpp

    r175 r187  
    227227void TestCullingTerrainApplication::createScene() 
    228228{ 
     229        Real scale = 3; 
     230        mSceneMgr->setOption("NodeVizScale", &scale); 
     231 
    229232        // Set ambient light 
    230233        mAmbientLight = ColourValue(0.5 , 0.5, 0.5); 
  • trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/src/OgreOctreeNode.cpp

    r183 r187  
    4646unsigned long green = 0xFFFFFFFF; 
    4747 
     48#ifdef GTP_VISIBILITY_MODIFIED_OGRE 
     49Real OctreeNode::msVizScale = 1; 
     50#endif // GTP_VISIBILITY_MODIFIED_OGRE 
     51 
    4852unsigned short OctreeNode::mIndexes[ 24 ] = {0, 1, 1, 2, 2, 3, 3, 0,       //back 
    4953        0, 6, 6, 5, 5, 1,             //left 
     
    187191        } 
    188192 
     193        //LogManager::getSingleton().logMessage("hagaaggaagag"); 
    189194        AxisAlignedBox box = mLocalAABB; 
     195         
    190196        // HACK: scale should not be done here 
    191         box.scale(Vector3(3, 3, 3)); 
     197        box.scale(Vector3(msVizScale, msVizScale, msVizScale)); 
     198 
    192199        mWireBoundingBox->setupBoundingBox(box); 
    193200        mWireBoundingBox->getRenderOperation(rend); 
     
    224231 
    225232} 
    226 } 
     233 
     234#ifdef GTP_VISIBILITY_MODIFIED_OGRE 
     235void 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.