Changeset 134


Ignore:
Timestamp:
06/15/05 08:57:24 (19 years ago)
Author:
mattausch
Message:

fixed some bugs

Location:
trunk/VUT
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/Ogre/src/OgrePlatformQueryManager.cpp

    r133 r134  
    4242 
    4343        /*  
    44                 Test again to get exact visibility with regard to the current camera. 
    45                 Issue all queries first to avoid starvation & stalls. 
     44                Two query lists: 
     45                We test two to get exact visibility with regard to the current camera and 
     46                issue all queries at once to avoid starvation & stalls. 
    4647        */ 
    4748        GtpVisibility::QueryList queryList[2]; 
     
    6768                        queryList[i].push_back(mHierarchyInterface->IssueOcclusionQuery(*nodeIt, false)); 
    6869                         
    69                         // store geometry of nodes in geometry list 
    70                         mHierarchyInterface->GetGeometry(*nodeIt, &geometryList, false); 
     70                        // store geometry of the hierarchy node in a geometry list (only once!) 
     71                        if (i == n - 2) 
     72                        { 
     73                                mHierarchyInterface->GetGeometry(*nodeIt, &geometryList, false); 
     74                        } 
    7175                } 
    7276 
     
    9397 
    9498                // to obtain the correct number of projected pixels, depth write must be disabled 
    95                 bool enableDepthCheck = (i != n - 2); 
     99                bool enableDepthWrite = (i != n - 2); 
    96100 
    97101                // this option must be provided by the scene manager 
    98                 pfHierarchyInterface->GetSceneManager()->setOption("DepthCheck", &enableDepthCheck); 
     102                pfHierarchyInterface->GetSceneManager()->setOption("DepthWrite", &enableDepthWrite); 
    99103        } 
    100104 
     
    103107        unsigned int visiblePixels; 
    104108 
    105         GtpVisibility::QueryList::iterator absQueryIt, relQueryIt; 
     109        GtpVisibility::QueryList::iterator visQueryIt, projQueryIt; 
    106110 
    107         absQueryIt = queryList[0].begin(); 
    108         relQueryIt = queryList[1].begin(); 
     111        visQueryIt = queryList[0].begin(); 
     112        projQueryIt = queryList[1].begin(); 
    109113         
    110114        for (nodeIt = nodeList->begin(); nodeIt != nodeIt_end; ++nodeIt) 
    111115        { 
    112                 (*absQueryIt)->GetQueryResult(visiblePixels, true); 
     116                (*visQueryIt)->GetQueryResult(visiblePixels, true); 
    113117 
    114118                float vis = (float)visiblePixels; 
     
    116120                if (relativeVisibility) 
    117121                { 
    118                         (*relQueryIt)->GetQueryResult(visiblePixels, true); 
     122                        (*projQueryIt)->GetQueryResult(visiblePixels, true); 
    119123                        std::stringstream d; d << "relativ " << visiblePixels; 
    120124                        LogManager::getSingleton().logMessage(d.str()); 
     
    124128                                vis /= (float) visiblePixels; 
    125129                        } 
    126                         ++relQueryIt; 
     130                        ++projQueryIt; 
    127131                } 
    128132 
    129                 ++absQueryIt; 
     133                ++visQueryIt; 
    130134 
    131135                // leave nodes with visibilty 0 in queue:  
  • trunk/VUT/Ogre/src/OgreVisibilityTerrainSceneManager.cpp

    r133 r134  
    389389                return true; 
    390390        } 
    391         if (key == "DepthCheck") 
     391        if (key == "DepthWrite") 
    392392        { 
    393393                mEnableDepthWrite = (*static_cast<const bool *>(val)); 
Note: See TracChangeset for help on using the changeset viewer.