Changeset 145 for trunk/VUT/work


Ignore:
Timestamp:
06/22/05 10:05:06 (19 years ago)
Author:
mattausch
Message:

fixed bug when canceling login
fixed visibility queries using occlusion queries

Location:
trunk/VUT/work/TestCullingTerrain
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/work/TestCullingTerrain/TerrainFrameListener.cpp

    r144 r145  
    377377        for (geomIt = visibleGeometry.begin(); geomIt != geomIt_end; ++geomIt) 
    378378        { 
    379                 averageGeometryVis += (*geomIt).GetVisiblePixels(); 
    380  
    381                 std::stringstream d; d << "Geometry visibility: " << (*geomIt).GetVisiblePixels(); 
     379                float vis = relativeVisibility ?  
     380                        (*geomIt).ComputeRelativeVisibility() : (float)(*geomIt).GetVisiblePixels(); 
     381                 
     382                averageGeometryVis += vis; 
     383 
     384                std::stringstream d; d << "Geometry visibility: " << vis; 
    382385                LogManager::getSingleton().logMessage(d.str()); 
    383386        } 
     
    387390        for (nodesIt = visibleNodes.begin(); nodesIt != nodesIt_end; ++nodesIt) 
    388391        { 
    389                 averageNodeVis += (*nodesIt).GetVisiblePixels(); 
    390  
    391                 std::stringstream d; d << "Node visibility: " << (*nodesIt).GetVisiblePixels(); 
     392                float vis = relativeVisibility ?  
     393                        (*nodesIt).ComputeRelativeVisibility() : (float)(*nodesIt).GetVisiblePixels(); 
     394                 
     395                averageNodeVis += vis; 
     396                 
     397                std::stringstream d; d << "Node visibility: " << vis; 
    392398                LogManager::getSingleton().logMessage(d.str()); 
    393399        } 
    394400 
    395         if ((int)visibleNodes.size()) 
     401        if (visibleNodes.size()) 
    396402                averageNodeVis /= (float)visibleNodes.size(); 
    397         if ((int)visibleGeometry.size()) 
     403        if (visibleGeometry.size()) 
    398404                averageGeometryVis /= (float)visibleGeometry.size(); 
    399405 
  • trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.cpp

    r144 r145  
    1818/*     TestCullingTerrainApplication implementation    */ 
    1919/*******************************************************/ 
    20  
     20TestCullingTerrainApplication::TestCullingTerrainApplication(): 
     21mTerrainContentGenerator(NULL) 
     22{ 
     23} 
    2124//----------------------------------------------------------------------- 
    2225TestCullingTerrainApplication::~TestCullingTerrainApplication() 
     
    6972bool TestCullingTerrainApplication::setup() 
    7073{ 
    71         bool result = ExampleApplication::setup(); 
    72  
    73         if (mWindow) 
     74        bool carryOn = ExampleApplication::setup(); 
     75 
     76        if (carryOn) 
    7477                createRenderTargetListener(); 
    7578 
    76         return result; 
     79        return carryOn; 
    7780} 
    7881//----------------------------------------------------------------------- 
  • trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.h

    r139 r145  
    2828{ 
    2929public: 
     30        TestCullingTerrainApplication(); 
    3031        ~TestCullingTerrainApplication(); 
    3132 
Note: See TracChangeset for help on using the changeset viewer.