Ignore:
Timestamp:
08/04/06 17:38:52 (18 years ago)
Author:
szydlowski
Message:

occlusion queries in kdtree scene manager working, but performance issues
many features still not implemented (e.g., visualization)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTreeSceneManager.cpp

    r1182 r1183  
    5959 
    6060mHierarchyInterface = new KdTreeHierarchyInterface(this, mDestRenderSystem); 
     61 
     62// test 
     63//String chc = "CHC"; 
     64//setOption("RenderMethod", &chc); 
    6165} 
    6266 
     
    240244                return true; 
    241245        } 
     246        else if (strKey == "ShowNodeAABB") 
     247        { 
     248                bool sn = *static_cast<const bool *>(pValue); 
     249                if (mKdTree) 
     250                        mKdTree->setShowNodeAABB(sn); 
     251                return true; 
     252        } 
     253        // options for CHC 
     254        if (strKey == "UseDepthPass") 
     255        { 
     256                mUseDepthPass = (*static_cast<const bool *>(pValue)); 
     257                return true; 
     258        } 
     259        if (strKey == "PrepareVisualization") 
     260        { 
     261                mShowVisualization = (*static_cast<const bool *>(pValue)); 
     262                return true; 
     263        } 
     264        if (strKey == "RenderNodesForViz") 
     265        { 
     266                mRenderNodesForViz = (*static_cast<const bool *>(pValue)); 
     267                return true; 
     268        } 
     269        if (strKey == "RenderNodesContentForViz") 
     270        { 
     271                mRenderNodesContentForViz = (*static_cast<const bool *>(pValue)); 
     272                return true; 
     273        } 
     274        if (strKey == "SkyBoxEnabled") 
     275        { 
     276                mSkyBoxEnabled = (*static_cast<const bool *>(pValue)); 
     277                return true; 
     278        } 
     279        if (strKey == "SkyPlaneEnabled") 
     280        { 
     281                mSkyPlaneEnabled = (*static_cast<const bool *>(pValue)); 
     282                return true; 
     283        } 
     284        if (strKey == "SkyDomeEnabled") 
     285        { 
     286                mSkyDomeEnabled = (*static_cast<const bool *>(pValue)); 
     287                return true; 
     288        } 
     289        if (strKey == "VisualizeCulledNodes") 
     290        { 
     291                mVisualizeCulledNodes = (*static_cast<const bool *>(pValue)); 
     292                return true; 
     293        } 
     294        if (strKey == "DelayRenderTransparents") 
     295        { 
     296                mDelayRenderTransparents = (*static_cast<const bool *>(pValue)); 
     297                return true; 
     298        } 
     299 
     300        if (strKey == "DepthWrite") 
     301        { 
     302                mEnableDepthWrite = (*static_cast<const bool *>(pValue)); 
     303                return true; 
     304        } 
     305        if (strKey == "UseItemBuffer") 
     306        { 
     307                mUseItemBuffer = (*static_cast<const bool *>(pValue)); 
     308                return true; 
     309        } 
     310        if (strKey == "ExecuteVertexProgramForAllPasses") 
     311        {  
     312                mExecuteVertexProgramForAllPasses  = (*static_cast<const bool *>(pValue)); 
     313                return true; 
     314        } 
     315        if (strKey == "RenderTransparentsForItemBuffer") 
     316        {  
     317                mRenderTransparentsForItemBuffer  = (*static_cast<const bool *>(pValue)); 
     318                return true; 
     319        } 
     320 
    242321 
    243322        return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface) 
     
    270349        else if (strKey == "ShowAllBoxes") 
    271350        { 
    272                 *static_cast<bool *>(pDestValue) = mShowAllBoxes; 
     351                if (mRenderMethod == KdTree::KDRM_INTERNAL) 
     352                        *static_cast<bool *>(pDestValue) = mShowAllBoxes; 
     353                else 
     354                        *static_cast<bool *>(pDestValue) = mVisualizeCulledNodes; 
    273355                return true; 
    274356        } 
     
    308390                        return false; 
    309391                } 
     392                return true; 
     393        } 
     394        else if (strKey == "ShowKdTree") 
     395        { 
     396                *static_cast<bool *>(pDestValue) = mShowBoxes; 
     397                return true; 
     398        } 
     399        else if (strKey == "ShowNodeAABB") 
     400        { 
     401                if (mKdTree) 
     402                        *static_cast<bool *>(pDestValue) = mKdTree->getShowNodeAABB(); 
     403                else 
     404                        *static_cast<bool *>(pDestValue) = false; 
    310405                return true; 
    311406        } 
     
    331426        refKeys.push_back("RenderMethod"); 
    332427        refKeys.push_back("ShowKdTree"); 
     428        refKeys.push_back("ShowNodeAABB"); 
    333429        refKeys.push_back("TreeBox"); 
    334430#ifdef KDTREE_DEBUG 
     
    639735        while (it != end) 
    640736        { 
    641                 (*it)->queueObjects(cam, getRenderQueue(), onlyShadowCasters); 
     737                if (!(*it)->isQueued(mHierarchyInterface->GetFrameId(), cam)) 
     738                { 
     739                        (*it)->queueObjects(cam, getRenderQueue(), onlyShadowCasters); 
     740                } 
    642741                it++; 
    643742        } 
     
    841940        } 
    842941        // add bounding boxes of rendered objects 
    843         if (0) 
     942        //if (0) 
    844943                //for (BoxList::iterator it = mBoxes.begin(); it != mBoxes.end(); ++it) 
    845944                //{ 
Note: See TracChangeset for help on using the changeset viewer.