Changeset 2183


Ignore:
Timestamp:
03/02/07 13:13:24 (17 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.cpp

    r2171 r2183  
    15371537        case KC_F5: 
    15381538                { 
     1539                        unsigned int pixels = 0; 
     1540                        mSceneMgr->getOption("VisibleObjects", &pixels); 
     1541 
     1542                        std::stringstream d; d << "visible objects: " << pixels; 
     1543                        LogManager::getSingleton().logMessage(d.str()); 
    15391544                        const bool fromPoint = false; 
    1540                         applyVisibilityQuery(fromPoint, mShiftPressed, mUseItemBuffer); 
     1545                        //applyVisibilityQuery(fromPoint, mShiftPressed, mUseItemBuffer); 
    15411546                        break; 
    15421547                } 
  • GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrain.vcproj

    r2171 r2183  
    2222                                Optimization="0" 
    2323                                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_ADDONS_PATH)\dotsceneoctree\PlugIns\DotSceneManager\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include&quot;;..\..\GtpVisibility\include;..\..\Ogre\include;..\include;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\include;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\OGRE\include;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\IVReader\include" 
    24                                 PreprocessorDefinitions="_WINDOWS;_STLP_USE_DYNAMIC_LIB;OGRE_LIBRARY_IMPORTS;_DEBUG;WIN32;_STLP_DEBUG;GTP_VISIBILITY_MODIFIED_OGRE" 
     24                                PreprocessorDefinitions="_WINDOWS;_STLP_USE_DYNAMIC_LIB;OGRE_LIBRARY_IMPORTS;_DEBUG;WIN32;_STLP_DEBUG;GTP_VISIBILITY_MODIFIED_OGRE;GAMETOOLS_ILLUMINATION_MODULE" 
    2525                                MinimalRebuild="TRUE" 
    2626                                BasicRuntimeChecks="3" 
     
    8383                                OptimizeForWindowsApplication="TRUE" 
    8484                                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;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\include;..\include;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\OGRE\include;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\IVReader\include" 
    85                                 PreprocessorDefinitions="_WINDOWS;_STLP_USE_DYNAMIC_LIB;OGRE_LIBRARY_IMPORTS;_RELEASE;WIN32;_STLP_RELEASE;GTP_VISIBILITY_MODIFIED_OGRE;GAMETOOLS_ILLUMINATION_MODULE1" 
     85                                PreprocessorDefinitions="_WINDOWS;_STLP_USE_DYNAMIC_LIB;OGRE_LIBRARY_IMPORTS;_RELEASE;WIN32;_STLP_RELEASE;GTP_VISIBILITY_MODIFIED_OGRE;GAMETOOLS_ILLUMINATION_MODULE" 
    8686                                RuntimeLibrary="2" 
    8787                                RuntimeTypeInfo="FALSE" 
  • GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrainApplication.cpp

    r2168 r2183  
    454454        ///////// 
    455455        //-- load parameters & scene 
    456         loadConfig("terrainCulling.cfg"); 
     456        //loadConfig("terrainCulling.cfg"); 
    457457         
    458458        ///////////////////////////////////// 
     
    534534        { 
    535535                // the objects are generated randomly distributed over the terrain 
    536                 if (1) generateScene(1500, 0); // create robots 
     536                if (1) generateScene(500, 0); // create robots 
    537537                if (0) generateScene(100, 1); // create trees 
    538                 if (0) generateScene(100, 2); // create ninjas 
     538                if (1) generateScene(1000, 2); // create ninjas 
    539539        } 
    540540} 
  • GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/scripts/TestKdTree.vcproj

    r2130 r2183  
    8585                                OptimizeForWindowsApplication="TRUE" 
    8686                                AdditionalIncludeDirectories="..\include;&quot;$(OGRE_PATH)\Samples\Common\include&quot;;&quot;$(OGRE_PATH)\OgreMain\include&quot;;..\..\..\..\..\..\Lib\Vis\OnlineCullingCHC\IVReader\include;..\..\..\..\..\..\Lib\Vis\OnlineCullingCHC\OGRE\include;..\..\..\..\..\..\Lib\Vis\OnlineCullingCHC\include" 
    87                                 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;GTP_VISIBILITY_MODIFIED_OGRE;USE_VERBOSE_PVS" 
     87                                PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;GTP_VISIBILITY_MODIFIED_OGRE;GAMETOOLS_ILLUMINATION_MODULE;USE_VERBOSE_PVS" 
    8888                                StringPooling="TRUE" 
    8989                                MinimalRebuild="TRUE" 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/IVReader/src/IVReader.vcproj

    r2130 r2183  
    2121                                Optimization="0" 
    2222                                AdditionalIncludeDirectories="&quot;$(OGRE_PATH)\Dependencies\include\CEGUI&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include&quot;;&quot;$(OGRE_PATH)\OgreMain\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\include&quot;;..\include" 
    23                                 PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;IVREADER_EXPORTS;GTP_VISIBILITY_MODIFIED_OGRE" 
     23                                PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;IVREADER_EXPORTS;GTP_VISIBILITY_MODIFIED_OGRE;GAMETOOLS_ILLUMINATION_MODULE" 
    2424                                MinimalRebuild="TRUE" 
    2525                                BasicRuntimeChecks="3" 
     
    7373                                Name="VCCLCompilerTool" 
    7474                                AdditionalIncludeDirectories="&quot;$(OGRE_PATH)\Dependencies\include\CEGUI&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include&quot;;&quot;$(OGRE_PATH)\OgreMain\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\include&quot;;..\include" 
    75                                 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;IVREADER_EXPORTS;GTP_VISIBILITY_MODIFIED_OGRE;GAMETOOLS_ILLUMINATION_MODULE1;USE_VERBOSE_PVS" 
     75                                PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;IVREADER_EXPORTS;GTP_VISIBILITY_MODIFIED_OGRE;GAMETOOLS_ILLUMINATION_MODULE;USE_VERBOSE_PVS" 
    7676                                RuntimeLibrary="2" 
    7777                                UsePrecompiledHeader="0" 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreMeshInstance.h

    r2115 r2183  
    5252                                                   GtpVisibilityPreprocessor::Vector3 &normal); 
    5353 
    54         ostream &Describe(ostream &s); 
     54        std::ostream &Describe(std::ostream &s); 
    5555         
    5656 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOcclusionCullingSceneManager.h

    r2171 r2183  
    1313#include "Containers.h" 
    1414#include "ViewCellsManager.h" 
     15#include "VisibilityInfo.h" 
    1516 
    1617 
     
    2021 
    2122class ObjReader; 
     23 
    2224 
    2325namespace Ogre { 
     
    126128        void RenderDepthForQuery(Camera* camera, Viewport* vp); 
    127129 
     130        void _findVisibleObjects(Camera* cam, bool onlyShadowCasters); 
     131 
    128132protected: 
    129133         
     
    191195                                                                const bool fromPoint, 
    192196                                                                const bool nodeVisibility);      
     197 
     198        void AddVisibleMeshGeometryToQueue(const GtpVisibility::MeshInfoContainer &visibleGeometry, Camera *cam); 
     199        void AddVisibleNodeGeometryToQueue(const GtpVisibility::NodeInfoContainer &visibleNodes, Camera *cam); 
    193200 
    194201        ////////////////////////////////////////// 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreMeshInstance.cpp

    r2115 r2183  
    7474        } 
    7575 
    76         ostream &OgreMeshInstance::Describe(ostream &s) 
     76        std::ostream &OgreMeshInstance::Describe(std::ostream &s) 
    7777        { 
    7878                s << mEntity; 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp

    r2176 r2183  
    2525#include "ObjReader.h" 
    2626#include "OgreOcclusionQueriesQueryManager.h" 
     27#include "VisibilityInfo.h" 
     28#include "Preprocessor.h" 
    2729 
    2830 
     
    706708 
    707709        // standard rendering in first pass 
    708         if (!mNormalExecution && mUseDepthPass) 
     710        // hierarchical culling interleaves identification  
     711        // and rendering of objects in _renderVisibibleObjects 
     712 
     713        // for the shadow pass we use only standard rendering 
     714        // because shadows have low occlusion anyway 
     715        if ((mShadowTechnique == SHADOWTYPE_TEXTURE_MODULATIVE &&  
     716                 mIlluminationStage == IRS_RENDER_TO_TEXTURE) || 
     717                mNormalExecution) 
     718        { 
     719                OctreeSceneManager::_findVisibleObjects(cam, onlyShadowCasters); 
     720        } 
     721        else if (mUseDepthPass) 
    709722        { 
    710723                RenderDepthPass(); 
    711724        } 
    712         else 
    713         { 
    714                 // hierarchical culling interleaves identification  
    715                 // and rendering of objects in _renderVisibibleObjects 
    716  
    717                 // for the shadow pass we use only standard rendering 
    718                 // because shadows have low occlusion anyway 
    719                 if ((mShadowTechnique == SHADOWTYPE_TEXTURE_MODULATIVE &&  
    720                          mIlluminationStage == IRS_RENDER_TO_TEXTURE) || 
    721                         mNormalExecution) 
    722                 { 
    723                         OctreeSceneManager::_findVisibleObjects(cam, onlyShadowCasters); 
    724                 } 
    725  
    726                 // only shadow casters will be rendered in shadow texture pass 
    727                 //if (0) mHierarchyInterface->SetOnlyShadowCasters(onlyShadowCasters); 
    728         } 
     725         
     726        // only shadow casters will be rendered in shadow texture pass 
     727        //if (0) mHierarchyInterface->SetOnlyShadowCasters(onlyShadowCasters); 
    729728} 
    730729//----------------------------------------------------------------------- 
     
    10871086                        return false; 
    10881087 
    1089                 const bool fromPoint = true; 
     1088                const bool fromPoint = false; 
    10901089                const bool nodeVisibility = true; 
    10911090                 
     
    13971396         
    13981397        // possible two cameras (one for culling, one for rendering) 
    1399         mHierarchyInterface->InitTraversal(mCameraInProgress,  
     1398        mHierarchyInterface->InitTraversal(cam,  
    14001399                                                                           mCullCamera ? getCamera("CullCamera") : NULL, 
    14011400                                                                           mLeavePassesInQueue); 
     
    23112310} 
    23122311//----------------------------------------------------------------------- 
     2312void OcclusionCullingSceneManager::AddVisibleMeshGeometryToQueue(const GtpVisibility::MeshInfoContainer &visibleGeometry, 
     2313                                                                                                                                 Camera *cam) 
     2314{ 
     2315        GtpVisibility::MeshInfoContainer::const_iterator geomIt, geomIt_end = visibleGeometry.end(); 
     2316 
     2317        for (geomIt = visibleGeometry.begin(); geomIt != geomIt_end; ++geomIt) 
     2318        { 
     2319                MovableObject *mo = (*geomIt).GetSource(); 
     2320 
     2321                // add if not 0 
     2322                if (!(*geomIt).GetVisiblePixels()) 
     2323                        continue; 
     2324 
     2325                mo->_notifyCurrentCamera(cam); 
     2326 
     2327                if (mo->isVisible()) 
     2328                { 
     2329                        mo->_updateRenderQueue(getRenderQueue()); 
     2330                } 
     2331        } 
     2332} 
     2333//----------------------------------------------------------------------- 
     2334void OcclusionCullingSceneManager::AddVisibleNodeGeometryToQueue(const GtpVisibility::NodeInfoContainer &visibleNodes, 
     2335                                                                                                                                 Camera *cam) 
     2336{ 
     2337        //////////////// 
     2338        //-- apply queries on node level 
     2339 
     2340        GtpVisibility::NodeInfoContainer::const_iterator nodesIt, nodesIt_end = visibleNodes.end(); 
     2341 
     2342        for (nodesIt = visibleNodes.begin(); nodesIt != nodesIt_end; ++ nodesIt) 
     2343        { 
     2344                if (!(*nodesIt).GetVisiblePixels()) 
     2345                        continue; 
     2346 
     2347                Octree *octree = static_cast<Octree *>((*nodesIt).GetSource()); 
     2348 
     2349                NodeList::iterator nIt, nIt_end = octree->mNodes.end(); 
     2350 
     2351                for (nIt = octree->mNodes.begin(); nIt != nIt_end; ++ nIt) 
     2352                { 
     2353                        (*nIt)->_addToRenderQueue(cam, getRenderQueue(), false); 
     2354                } 
     2355        } 
     2356} 
     2357//----------------------------------------------------------------------- 
     2358void OcclusionCullingSceneManager::_findVisibleObjects(Camera* cam, 
     2359                                                                                                           bool onlyShadowCasters)                                                                                
     2360{ 
     2361        // lists only used for visualization 
     2362        mVisible.clear(); 
     2363        mBoxes.clear(); 
     2364 
     2365        const bool fromPoint = false; 
     2366        const bool nodeVisibility = false; 
     2367 
     2368        const int itemBufferMode = 0; 
     2369        const bool relativeVisibility = false; 
     2370 
     2371        int queryModes = 0; 
     2372 
     2373        if (nodeVisibility) 
     2374                queryModes |= GtpVisibility::QueryManager::NODE_VISIBILITY; 
     2375        else 
     2376                queryModes |= GtpVisibility::QueryManager::GEOMETRY_VISIBILITY; 
     2377 
     2378        OcclusionQueriesQueryManager *queryManager =  
     2379                new OcclusionQueriesQueryManager(mHierarchyInterface, 
     2380                                                                                 mCurrentViewport, 
     2381                                                                                 queryModes,  
     2382                                                                                 itemBufferMode); 
     2383 
     2384        mVisibilityManager->SetQueryManager(queryManager); 
     2385 
     2386        GtpVisibility::NodeInfoContainer visibleNodes; 
     2387        GtpVisibility::MeshInfoContainer visibleGeometry; 
     2388        GtpVisibility::PatchInfoContainer visiblePatches; 
     2389 
     2390        if (fromPoint) 
     2391        { 
     2392                queryManager->ComputeFromPointVisibility(cam->getDerivedPosition(),  
     2393                                                                                                 &visibleNodes,  
     2394                                                                                                 &visibleGeometry,  
     2395                                                                                                 &visiblePatches,  
     2396                                                                                                 relativeVisibility); 
     2397        } 
     2398        else 
     2399        { 
     2400                queryManager->ComputeCameraVisibility(*cam, 
     2401                                                                                          &visibleNodes,  
     2402                                                                                          &visibleGeometry,  
     2403                                                                                          &visiblePatches,  
     2404                                                                                          relativeVisibility); 
     2405        } 
     2406                 
     2407        if (0) 
     2408        { 
     2409                std::stringstream d;  
     2410                d << "Query mode: " << queryModes  
     2411                  << " visible nodes: " << (int)visibleNodes.size()  
     2412                  << " visible geometry: " << (int)visibleGeometry.size(); 
     2413 
     2414                LogManager::getSingleton().logMessage(d.str()); 
     2415        } 
     2416 
     2417        /////////////////////// 
     2418        //-- put items in render queue 
     2419        ////////// 
     2420 
     2421        //getRenderQueue()->clear(); 
     2422 
     2423        ////////////////////// 
     2424        //-- apply queries on geometry level 
     2425 
     2426        if (!nodeVisibility) 
     2427        { 
     2428                AddVisibleMeshGeometryToQueue(visibleGeometry, cam); 
     2429        } 
     2430        else 
     2431        { 
     2432                AddVisibleNodeGeometryToQueue(visibleNodes, cam); 
     2433        } 
     2434                 
     2435        delete queryManager; 
     2436} 
     2437 
     2438//----------------------------------------------------------------------- 
    23132439void OcclusionCullingSceneManagerFactory::destroyInstance(SceneManager* instance) 
    23142440{ 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionQueriesQueryManager.cpp

    r2171 r2183  
    168168        { 
    169169                //-- queries for hierarchy nodes 
    170                 for (nodeIt = nodeList.begin(); nodeIt != nodeIt_end; ++nodeIt)          
     170                for (nodeIt = nodeList.begin(); nodeIt != nodeIt_end; ++ nodeIt)                 
    171171                { 
    172172                        // TODO: DELETE QUERIES FROM PREVIOUS RENDER 
    173                         queryList[i].push_back(mHierarchyInterface->IssueNodeOcclusionQuery(*nodeIt, false)); 
     173                        bool intersects = false; 
     174 
     175                        pfHierarchyInterface->CheckFrustumVisible(*nodeIt, intersects); 
     176 
     177                        // always push back if intersects 
     178                        if (1 && intersects) 
     179                        { 
     180                                // no more information available 
     181                                const int visPixels = 1; 
     182                                const int projPixels = 1; 
     183 
     184                                visibleNodes->push_back(GtpVisibility::NodeInfo(*nodeIt, visPixels, projPixels)); 
     185                                queryList[i].push_back(NULL); 
     186                        } 
     187                        else 
     188                        { 
     189                                queryList[i].push_back(mHierarchyInterface->IssueNodeOcclusionQuery(*nodeIt, false)); 
     190                        } 
    174191                } 
    175192 
     
    300317        for (nodeIt = nodeList->begin(); nodeIt != nodeList->end(); ++ nodeIt) 
    301318        { 
     319                if (!(*visQueryIt)) 
     320                { 
     321                        ++ visQueryIt; 
     322                        if (relativeVisibility) 
     323                                ++ projQueryIt; 
     324                        continue; 
     325                } 
     326 
    302327                unsigned int visiblePixels = 0; 
    303328                (*visQueryIt)->GetQueryResult(visiblePixels, true); 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/Plugin_VisibilitySceneManager.vcproj

    r2171 r2183  
    2121                                Optimization="0" 
    2222                                AdditionalIncludeDirectories="&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include\CEGUI&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include&quot;;&quot;$(OGRE_PATH)\OgreMain\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include&quot;;..\include;..\..\..\OnlineCullingCHC\include;..\..\..\Preprocessing\src;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\ObjReader\include;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\IVReader\include;..\..\..\Preprocessing\src\Timer" 
    23                                 PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;PLUGIN_KD_TERRAIN_EXPORTS;GTP_VISIBILITY_MODIFIED_OGRE" 
     23                                PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;PLUGIN_KD_TERRAIN_EXPORTS;GTP_VISIBILITY_MODIFIED_OGRE;GAMETOOLS_ILLUMINATION_MODULE" 
    2424                                MinimalRebuild="TRUE" 
    2525                                BasicRuntimeChecks="3" 
     
    9090                                OptimizeForWindowsApplication="TRUE" 
    9191                                AdditionalIncludeDirectories="&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include\CEGUI&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include&quot;;&quot;$(OGRE_PATH)\OgreMain\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include&quot;;..\include;..\..\..\OnlineCullingCHC\include;..\..\..\Preprocessing\src;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\IVReader\include;..\..\..\Preprocessing\src\Timer;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\ObjReader\include" 
    92                                 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PLUGIN_KD_TERRAIN_EXPORTS;GTP_VISIBILITY_MODIFIED_OGRE;GAMETOOLS_ILLUMINATION_MODULE1" 
     92                                PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PLUGIN_KD_TERRAIN_EXPORTS;GTP_VISIBILITY_MODIFIED_OGRE;GAMETOOLS_ILLUMINATION_MODULE" 
    9393                                StringPooling="TRUE" 
    9494                                RuntimeLibrary="2" 
     
    320320                                AdditionalLibraryDirectories="&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\Release&quot;;&quot;$(OGRE_PATH)\OgreMain\lib\Release&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib&quot;;..\..\GtpVisibility\lib\Release;..\..\lib\Release;..\lib\Release;&quot;$(OGRE_PATH)\Dependencies\lib\Release&quot;;..\..\..\Preprocessing\lib\Release;..\..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\Preprocessing\src\GL;&quot;$(CG_LIB_PATH)&quot;;..\..\..\..\..\..\..\NonGTP\Zlib\lib;..\..\..\..\..\Lib\Vis\Preprocessing\MultiLevelRayTracing\RTWorld\Release;..\..\..\..\..\Lib\Vis\Preprocessing\MultiLevelRayTracing\RTScene\Release;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\IVReader\lib\Release;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\ObjReader\lib\Release" 
    321321                                ModuleDefinitionFile="..\misc\OgreVisibilitySceneManager.def" 
    322                                 GenerateDebugInformation="FALSE" 
     322                                GenerateDebugInformation="TRUE" 
    323323                                SubSystem="2" 
    324324                                OptimizeReferences="2" 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/ObjReader/src/ObjReader.vcproj

    r2130 r2183  
    2121                                Optimization="0" 
    2222                                AdditionalIncludeDirectories="&quot;$(OGRE_PATH)\Dependencies\include\CEGUI&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include&quot;;&quot;$(OGRE_PATH)\OgreMain\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\include&quot;;..\include;..\..\..\Preprocessing\src" 
    23                                 PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;OBJREADER_EXPORTS;GTP_VISIBILITY_MODIFIED_OGRE" 
     23                                PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;OBJREADER_EXPORTS;GTP_VISIBILITY_MODIFIED_OGRE;GAMETOOLS_ILLUMINATION_MODULE" 
    2424                                MinimalRebuild="TRUE" 
    2525                                BasicRuntimeChecks="3" 
     
    7373                                Name="VCCLCompilerTool" 
    7474                                AdditionalIncludeDirectories="&quot;$(OGRE_PATH)\OgreMain\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\include&quot;;..\include;..\..\..\Preprocessing\src" 
    75                                 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OBJREADER_EXPORTS;GTP_VISIBILITY_MODIFIED_OGRE;GAMETOOLS_ILLUMINATION_MODULE1" 
     75                                PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OBJREADER_EXPORTS;GTP_VISIBILITY_MODIFIED_OGRE;GAMETOOLS_ILLUMINATION_MODULE" 
    7676                                RuntimeLibrary="2" 
    7777                                UsePrecompiledHeader="0" 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/src/GtpVisibility.vcproj

    r2100 r2183  
    2121                                Optimization="0" 
    2222                                AdditionalIncludeDirectories="&quot;$(OGRE_PATH)\OgreMain\include&quot;;..\include;..\..\Preprocessing\src" 
    23                                 PreprocessorDefinitions="WIN32;_DEBUG;_LIB;GTP_VISIBILITY_MODIFIED_OGRE" 
     23                                PreprocessorDefinitions="WIN32;_DEBUG;_LIB;GTP_VISIBILITY_MODIFIED_OGRE;GAMETOOLS_ILLUMINATION_MODULE" 
    2424                                MinimalRebuild="TRUE" 
    2525                                BasicRuntimeChecks="3" 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/src/VisibilityEnvironment.cpp

    r1267 r2183  
    2020} 
    2121//----------------------------------------------------------------------- 
    22 bool VisibilityEnvironment::LoadEnvironment(string filename) 
     22bool VisibilityEnvironment::LoadEnvironment(std::string filename) 
    2323{                
    2424        //-- parse environment 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Polygon3.cpp

    r2116 r2183  
    283283                if (GetArea() < AREA_LIMIT) 
    284284                { 
    285                         Debug << "area too small: " << GetArea() << endl; 
     285                        Debug << "area too small: " << GetArea() << std::endl; 
    286286                        return false; 
    287287                } 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp

    r2172 r2183  
    2222#include "InternalRayCaster.h" 
    2323#include "GlobalLinesRenderer.h" 
     24#include "ObjectsParser.h" 
    2425 
    2526 
     
    2728#define SHOW_RAYCAST_TIMING 1 
    2829 
     30using namespace std; 
    2931 
    3032namespace GtpVisibilityPreprocessor { 
     
    265267 
    266268 
    267 bool Preprocessor::LoadBinaryObj(const string filename, 
     269bool Preprocessor::LoadBinaryObj(const string &filename, 
    268270                                                                 SceneGraphNode *root, 
    269271                                                                 vector<FaceParentInfo> *parents) 
     
    277279        cout << "binary obj dump available, loading " << filename.c_str() << endl; 
    278280         
    279         // table for vertices 
    280         VertexContainer vertices;  
    281          
    282         if (parents) 
    283                 cout << "using face parents" << endl; 
    284         else 
    285                 cout << "not using face parents" << endl; 
    286  
    287281        // read in triangle size 
    288282        int numTriangles; 
     
    309303                root->mGeometry.push_back(obj); 
    310304                 
    311                 i ++; 
    312          
    313                 if (i % 500000 == 499999) 
     305                if ((i ++) % 500000 == 499999) 
    314306                         cout<<"\r"<<i<<"/"<<numTriangles<<"\r"; 
    315307        } 
     
    488480        const int files = SplitFilenames(filename, filenames); 
    489481        cout << "number of input files: " << files << endl; 
     482 
    490483        bool result = false; 
    491484        bool isObj = false; 
     
    547540                                                 
    548541                                cout << "loaded " << (int)mSceneGraph->GetRoot()->mGeometry.size() << " entities" << endl; 
     542 
    549543                                // only works for triangles 
    550544                                if (result && !mLoadMeshes) 
    551545                                { 
    552546                                        cout << "exporting binary obj to " << bnFile << "... " << endl; 
     547 
    553548                                        ExportBinaryObj(bnFile, mSceneGraph->GetRoot()); 
     549                                 
    554550                                        cout << "finished" << endl; 
    555551                                } 
    556552 
    557553                                delete parser; 
    558                         } 
    559                         else if (0) 
    560                         { 
    561                                 ExportBinaryObj("../data/test.bn", mSceneGraph->GetRoot()); 
    562554                        } 
    563555                } 
     
    740732        if (mLoadViewCells) 
    741733        {        
     734                 
     735#ifdef USE_BIT_PVS 
     736                // HACK: for kd pvs, set pvs size to maximal number of kd nodes 
     737                vector<KdLeaf *> leaves; 
     738                preprocessor->mKdTree->CollectLeaves(leaves); 
     739 
     740                ObjectPvs::SetPvsSize((int)leaves.size()); 
     741#endif 
     742 
    742743                Environment::GetSingleton()->GetStringValue("ViewCells.filename", buf); 
    743                 cout << "loading view cells from " << buf << endl<<flush; 
    744  
    745                 mViewCellsManager = ViewCellsManager::LoadViewCells(buf, &mObjects, true, NULL); 
     744                cout << "loading objects from " << buf << endl; 
     745 
     746                // load objects which will be used as pvs entries 
     747                ObjectContainer pvsObjects; 
     748                if (0) LoadObjects(buf, pvsObjects, mObjects); 
     749 
     750                const bool finalizeViewCells = true; 
     751                cout << "loading view cells from " << buf << endl; 
     752 
     753                mViewCellsManager = ViewCellsManager::LoadViewCells(buf,  
     754                                                                                                                        pvsObjects, 
     755                                                                                                                        mObjects,  
     756                                                                                                                        finalizeViewCells,  
     757                                                                                                                        NULL); 
    746758 
    747759                cout << "view cells loaded." << endl<<flush; 
     
    12621274        const long t1 = GetTime(); 
    12631275         
    1264         if (0 && (int)rays.size() > 10000) { 
     1276        if ((int)rays.size() > 10000) { 
    12651277         
    12661278                mRayCaster->SortRays(rays); 
     
    13561368         
    13571369                if ((int)rays.size() > 100000 && i % 100000 == 0) 
    1358                         //cout << "here2 " << vssRays.size()<<endl; 
    13591370                        cout<<"\r"<<i<<"/"<<(int)rays.size()<<"\r"; 
    13601371        } 
     
    16321643 
    16331644 
    1634 } 
     1645bool Preprocessor::LoadObjects(const string &filename, 
     1646                                                           ObjectContainer &pvsObjects,  
     1647                                                           const ObjectContainer &preprocessorObjects) 
     1648{ 
     1649        ObjectsParser parser; 
     1650 
     1651        const bool success = parser.ParseObjects(filename,  
     1652                                                                                         pvsObjects,  
     1653                                                                                         preprocessorObjects); 
     1654 
     1655        if (!success) 
     1656        { 
     1657                Debug << "Error: loading objects failed!" << endl; 
     1658        } 
     1659 
     1660        // hack: no bvh object could be found => take preprocessor objects 
     1661        if (pvsObjects.empty()) 
     1662        { 
     1663                Debug << "no objects" << endl; 
     1664                pvsObjects = preprocessorObjects; 
     1665        } 
     1666 
     1667        return success; 
     1668} 
     1669 
     1670 
     1671} 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h

    r2176 r2183  
    263263protected: 
    264264 
    265         bool LoadBinaryObj(const string &filename, 
     265        bool LoadBinaryObj(const std::string &filename, 
    266266                                           SceneGraphNode *root, 
    267                                            vector<FaceParentInfo> *parents); 
    268  
    269         bool ExportBinaryObj(const string filename, SceneGraphNode *root); 
     267                                           std::vector<FaceParentInfo> *parents); 
     268 
     269        bool ExportBinaryObj(const std::string filename, SceneGraphNode *root); 
    270270 
    271271        void SetupRay(Ray &ray, const Vector3 &point, const Vector3 &direction) const; 
Note: See TracChangeset for help on using the changeset viewer.