Changeset 2306


Ignore:
Timestamp:
04/02/07 11:50:36 (17 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis/OnlineCullingCHC
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOctreeHierarchyInterface.h

    r2292 r2306  
    6363                                           GtpVisibility::HierarchyNodeContainer &nodes); 
    6464 
     65        void PullUpLastVisited(GtpVisibility::HierarchyNode *node, const int frameId) const; 
     66        void DetermineVisibilityRatio(GtpVisibility::HierarchyNode *node) const; 
     67        float GetNodeVisibilityRatio(GtpVisibility::HierarchyNode *node) const; 
     68 
    6569protected: 
    6670 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgrePlatformHierarchyInterface.h

    r2280 r2306  
    2626{ 
    2727public: 
    28         /** Construction taking the current scene manager and the current rendersystem as argument 
     28        /** Construction taking the current scene manager and the  
     29                current rendersystem as argument 
    2930                @param sm current scene manager 
    3031                @param rsys current render system  
     
    3637                @return the next occlusion query 
    3738        */ 
    38         GtpVisibility::OcclusionQuery *GetNextOcclusionQuery(); 
     39        virtual GtpVisibility::OcclusionQuery *GetNextOcclusionQuery(); 
    3940                 
    4041        /** Sets the current camera used for the rendering. 
     
    124125                                                                         bool includeChildren) = 0; 
    125126 
     127        void PullUpLastVisited(GtpVisibility::HierarchyNode *node, const int frameId) const {} 
     128        void DetermineVisibilityRatio(GtpVisibility::HierarchyNode *node) const {} 
     129 
     130        float GetNodeVisibilityRatio(GtpVisibility::HierarchyNode *node) const { return 1.0f;} 
     131 
    126132protected: 
    127133        /** Renders the given geometry  
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOctreeHierarchyInterface.cpp

    r2292 r2306  
    3131                Octree *nextChild; 
    3232 
    33                 if ((nextChild = octree->mChildren[0][0][0]) != NULL) 
    34                         mDistanceQueue->push(nextChild); 
    35                 if ((nextChild = octree->mChildren[0][0][1]) != NULL) 
    36                         mDistanceQueue->push(nextChild); 
    37                 if ((nextChild = octree->mChildren[0][1][0]) != NULL) 
    38                         mDistanceQueue->push(nextChild); 
    39                 if ((nextChild = octree->mChildren[0][1][1]) != NULL) 
    40                 mDistanceQueue->push(nextChild); 
    41                 if ((nextChild = octree->mChildren[1][0][0]) != NULL) 
    42                         mDistanceQueue->push(nextChild); 
    43                 if ((nextChild = octree->mChildren[1][0][1]) != NULL) 
    44                         mDistanceQueue->push(nextChild); 
    45                 if ((nextChild = octree->mChildren[1][1][0]) != NULL) 
    46                         mDistanceQueue->push(nextChild); 
    47                 if ((nextChild = octree->mChildren[1][1][1]) != NULL) 
    48                         mDistanceQueue->push(nextChild); 
     33                for (int z = 0; z < 2; ++ z) 
     34                {        
     35                        for (int y = 0; y < 2; ++ y) 
     36                        { 
     37                                for (int x = 0; x < 2; ++ x) 
     38                                { 
     39                                        nextChild = octree->mChildren[x][y][z]; 
     40         
     41                                        if (nextChild) 
     42                        GetQueue()->push(nextChild); 
     43                                } 
     44            } 
     45        } 
    4946        } 
    5047} 
     
    6360        nodes.reserve(8); 
    6461 
     62        for (int z = 0; z < 2; ++ z) 
     63        {        
     64                for (int y = 0; y < 2; ++ y) 
     65                { 
     66                        for (int x = 0; x < 2; ++ x) 
     67                        { 
     68                                if ((child = octree->mChildren[x][y][z]) != NULL) 
     69                                { 
     70                                        nodes.push_back(child); 
     71                                } 
     72                        } 
     73                } 
     74        } 
     75 
     76        if (nodes.empty()) 
     77                return NULL; 
     78 
     79        int r = (int)(((float)rand() / RAND_MAX) * ((float)nodes.size() - 0.5f)); 
     80 
     81        return GetRandomLeaf(nodes[r]); 
     82} 
     83//----------------------------------------------------------------------- 
     84bool OctreeHierarchyInterface::IsLeaf(GtpVisibility::HierarchyNode *node) const 
     85{ 
     86        Octree *octree = static_cast<Octree *>(node); 
     87 
     88        // HACK: if there are subtrees, they are empty => we are not interested in them 
     89        return octree->numNodes() == (int)octree->mNodes.size(); 
     90} 
     91//----------------------------------------------------------------------- 
     92bool OctreeHierarchyInterface::HasGeometry(GtpVisibility::HierarchyNode *node) const 
     93{ 
     94        return !(static_cast<Octree *>(node))->mNodes.empty(); 
     95} 
     96//----------------------------------------------------------------------- 
     97float OctreeHierarchyInterface::GetSquaredDistance(GtpVisibility::HierarchyNode *node) const 
     98{ 
     99        const Vector3 bmin = static_cast<Octree *>(node)->mBox.getMinimum(); 
     100        const Vector3 bmax = static_cast<Octree *>(node)->mBox.getMaximum(); 
     101 
     102        const Vector3 pos = (bmax - bmin) * 0.5f + bmin; 
     103         
     104        return (mCameraPosition - pos).squaredLength(); 
     105} 
     106//----------------------------------------------------------------------- 
     107void OctreeHierarchyInterface::SetNodeVisible(GtpVisibility::HierarchyNode *node,  
     108                                                                                          const bool visible) const 
     109{ 
     110#ifdef GTP_VISIBILITY_MODIFIED_OGRE 
     111        static_cast<Octree *>(node)->setOctreeVisible(visible); 
     112#endif 
     113} 
     114//----------------------------------------------------------------------- 
     115void OctreeHierarchyInterface::SetLastVisited(GtpVisibility::HierarchyNode *node,  
     116                                                                                          const unsigned int frameId) const 
     117{ 
     118#ifdef GTP_VISIBILITY_MODIFIED_OGRE 
     119        static_cast<Octree *>(node)->setLastVisited(frameId); 
     120#endif 
     121} 
     122//----------------------------------------------------------------------- 
     123void OctreeHierarchyInterface::PullUpVisibility(GtpVisibility::HierarchyNode *node) const 
     124{                
     125#ifdef GTP_VISIBILITY_MODIFIED_OGRE 
     126        Octree *octant = static_cast<Octree *>(node); 
     127 
     128        while (octant && !octant->isOctreeVisible()) 
     129        { 
     130                octant->setOctreeVisible(true); 
     131                octant = octant->getParent(); 
     132        } 
     133#endif 
     134} 
     135//----------------------------------------------------------------------- 
     136void OctreeHierarchyInterface::PullUpLastVisited(GtpVisibility::HierarchyNode *node, const int frameId) const 
     137{                
     138#ifdef GTP_VISIBILITY_MODIFIED_OGRE 
     139        Octree *octant = static_cast<Octree *>(node); 
     140 
     141        while (octant && (octant->lastVisited() != frameId)) 
     142        { 
     143                octant->setLastVisited(frameId); 
     144                octant = octant->getParent(); 
     145        } 
     146#endif 
     147} 
     148//----------------------------------------------------------------------- 
     149void OctreeHierarchyInterface::DetermineFullVisibility(GtpVisibility::HierarchyNode *node) const 
     150{                
     151        Octree *octant = static_cast<Octree *>(node); 
     152 
     153        // node not visited in this frame => no change 
     154        if (octant->lastVisited() != mFrameId)  
     155                return; 
     156 
     157        // leaf node: terminate recursion 
     158        if (IsLeaf(node)) 
     159        { 
     160                octant->setOctreeFullyVisible(octant->isOctreeVisible());        
     161                return; 
     162        } 
     163 
     164        octant->setOctreeFullyVisible(true); 
     165        Octree *nextChild; 
     166         
    65167        for (int i = 0; i < 8; ++ i) 
    66168        { 
     
    68170                int y = (i & 2) / 2; 
    69171                int z = i & 1; 
    70          
    71                 if ((child = octree->mChildren[x][y][z]) != NULL) 
     172 
     173                nextChild = octant->mChildren[x][y][z]; 
     174 
     175                if (!nextChild) 
     176                        continue; 
     177                 
     178                // recursive traversal 
     179                DetermineFullVisibility(nextChild); 
     180                 
     181                // this leaf is not fully visible 
     182                if (!nextChild->isOctreeFullyVisible()) 
    72183                { 
    73                         nodes.push_back(child); 
     184                        octant->setOctreeFullyVisible(false); 
    74185                } 
    75186        } 
    76  
    77         if (nodes.empty()) 
    78                 return NULL; 
    79  
    80         int r = (int)(((float)rand() / RAND_MAX) * ((float)nodes.size() - 0.5f)); 
    81  
    82         return GetRandomLeaf(nodes[r]); 
    83 } 
    84 //----------------------------------------------------------------------- 
    85 bool OctreeHierarchyInterface::IsLeaf(GtpVisibility::HierarchyNode *node) const 
    86 { 
    87         Octree *octree = static_cast<Octree *>(node); 
    88  
    89         // HACK: if there are subtrees, they are empty => we are not interested in them 
    90         return octree->numNodes() == (int)octree->mNodes.size(); 
    91 } 
    92 //----------------------------------------------------------------------- 
    93 bool OctreeHierarchyInterface::HasGeometry(GtpVisibility::HierarchyNode *node) const 
    94 { 
    95         return !(static_cast<Octree *>(node))->mNodes.empty(); 
    96 } 
    97 //----------------------------------------------------------------------- 
    98 float OctreeHierarchyInterface::GetSquaredDistance(GtpVisibility::HierarchyNode *node) const 
    99 { 
    100         const Vector3 bmin = static_cast<Octree *>(node)->mBox.getMinimum(); 
    101         const Vector3 bmax = static_cast<Octree *>(node)->mBox.getMaximum(); 
    102  
    103         const Vector3 pos = (bmax - bmin) * 0.5f + bmin; 
    104          
    105         return (mCameraPosition - pos).squaredLength(); 
    106 } 
    107 //----------------------------------------------------------------------- 
    108 void OctreeHierarchyInterface::SetNodeVisible(GtpVisibility::HierarchyNode *node,  
    109                                                                                           const bool visible) const 
    110 { 
    111 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 
    112         static_cast<Octree *>(node)->setOctreeVisible(visible); 
    113 #endif 
    114 } 
    115 //----------------------------------------------------------------------- 
    116 void OctreeHierarchyInterface::SetLastVisited(GtpVisibility::HierarchyNode *node,  
    117                                                                                           const unsigned int frameId) const 
    118 { 
    119 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 
    120         static_cast<Octree *>(node)->setLastVisited(frameId); 
    121 #endif 
    122 } 
    123 //----------------------------------------------------------------------- 
    124 void OctreeHierarchyInterface::PullUpVisibility(GtpVisibility::HierarchyNode *node) const 
     187} 
     188//----------------------------------------------------------------------- 
     189void OctreeHierarchyInterface::DetermineVisibilityRatio(GtpVisibility::HierarchyNode *node) const 
    125190{                
    126 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 
    127         Octree *octant = static_cast<Octree *>(node); 
    128  
    129         while (octant && !octant->isOctreeVisible()) 
    130         { 
    131                 octant->setOctreeVisible(true); 
    132                 octant = octant->getParent(); 
    133         } 
    134 #endif 
    135 } 
    136 //----------------------------------------------------------------------- 
    137 /*void OctreeHierarchyInterface::PullUpFullVisibility(GtpVisibility::HierarchyNode *node) const 
    138 {                
    139 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 
    140         Octree *octant = static_cast<Octree *>(node); 
    141  
     191        Octree *octant = static_cast<Octree *>(node); 
     192 
     193        // node not visited in this frame => no change 
     194        if (octant->lastVisited() != mFrameId) 
     195                return; 
     196         
     197        // leaf node: terminate recursion 
     198        if (IsLeaf(node)) 
     199        { 
     200                octant->setNumLeaves(1);         
     201                octant->setNumVisibleLeaves(octant->isOctreeVisible() ? 1 : 0);  
     202                return; 
     203        } 
     204 
     205        int numVisibleLeaves = 0; 
     206        int numLeaves = 0; 
     207 
     208        Octree *nextChild; 
     209         
    142210        for (int i = 0; i < 8; ++ i) 
    143211        { 
     
    145213                int y = (i & 2) / 2; 
    146214                int z = i & 1; 
     215 
     216                nextChild = octant->mChildren[x][y][z]; 
     217 
     218                if (!nextChild) 
     219                        continue; 
    147220                 
    148                 if ((nextChild = octant->mChildren[x][y][z]) != NULL) 
    149                 { 
    150                         DetermineFullVisibility(nextChild); 
    151                         // this leaf is not fully visible => break 
    152                         if (!nextChild->isOctreeFullyVisible()) 
    153                                 octant->setOctreeFullyVisible(false); 
    154                 } 
    155         } 
    156  
    157         while (octant && !octant->isOctreeVisible()) 
    158         { 
    159                 octant->setOctreeVisible(true); 
    160                 octant = octant->getParent(); 
    161         } 
    162 #endif 
    163 }*/ 
    164 //----------------------------------------------------------------------- 
    165 void OctreeHierarchyInterface::DetermineFullVisibility(GtpVisibility::HierarchyNode *node) const 
    166 {                
    167         Octree *octant = static_cast<Octree *>(node); 
    168  
    169         // leaf node: terminate recursion 
    170         if (IsLeaf(node)) 
    171         { 
    172                 octant->setOctreeFullyVisible(octant->isOctreeVisible());        
    173                 return; 
    174         } 
    175  
    176         octant->setOctreeFullyVisible(true); 
    177          
    178         Octree *nextChild; 
    179          
    180         for (int i = 0; i < 8; ++ i) 
    181         { 
    182                 int x = (i & 4) / 4; 
    183                 int y = (i & 2) / 2; 
    184                 int z = i & 1; 
     221                // recursive traversal 
     222                DetermineVisibilityRatio(nextChild); 
    185223                 
    186                 if ((nextChild = octant->mChildren[x][y][z]) != NULL) 
    187                 { 
    188                         DetermineFullVisibility(nextChild); 
    189                         // this leaf is not fully visible => break 
    190                         if (!nextChild->isOctreeFullyVisible()) 
    191                                 octant->setOctreeFullyVisible(false); 
    192                 } 
    193         } 
     224                // this leaf is not fully visible 
     225                numLeaves += nextChild->getNumLeaves(); 
     226                numVisibleLeaves += nextChild->getNumVisibleLeaves(); 
     227        } 
     228 
     229        octant->setNumLeaves(numLeaves); 
     230        octant->setNumVisibleLeaves(numVisibleLeaves); 
    194231} 
    195232//----------------------------------------------------------------------- 
     
    249286{ 
    250287#ifdef GTP_VISIBILITY_MODIFIED_OGRE 
     288        //return static_cast<Octree *>(node)->getVisibilityRatio() > 0.9f; 
    251289        return static_cast<Octree *>(node)->isOctreeFullyVisible(); 
     290#else 
     291        return true; 
     292#endif 
     293} 
     294//----------------------------------------------------------------------- 
     295float OctreeHierarchyInterface::GetNodeVisibilityRatio(GtpVisibility::HierarchyNode *node) const 
     296{ 
     297#ifdef GTP_VISIBILITY_MODIFIED_OGRE 
     298        return static_cast<Octree *>(node)->getVisibilityRatio(); 
     299        //return static_cast<Octree *>(node)->isOctreeFullyVisible(); 
    252300#else 
    253301        return true; 
     
    329377                        Octree *octree = static_cast<Octree *>(node); 
    330378                         
    331                         for (int i = 0; i < 8; ++ i) 
    332                         { 
    333                                 int x = (i & 4) / 4; 
    334                                 int y = (i & 2) / 2; 
    335                                 int z = i & 1; 
    336          
    337                                 if ((child = octree->mChildren[x][y][z]) != NULL) 
     379                        for (int z = 0; z < 2; ++ z) 
     380                        {        
     381                                for (int y = 0; y < 2; ++ y) 
    338382                                { 
    339                                         tStack.push(child); 
     383                                        for (int x = 0; x < 2; ++ x) 
     384                                        { 
     385                                                if ((child = octree->mChildren[x][y][z]) != NULL) 
     386                                                { 
     387                                                        tStack.push(child); 
     388                                                } 
     389                                        } 
    340390                                } 
    341391                        } 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgrePlatformHierarchyInterface.cpp

    r2278 r2306  
    141141} 
    142142//----------------------------------------------------------------------- 
    143 void PlatformHierarchyInterface::InitTraversal(Camera *cam, Camera *cullCam,  
     143void PlatformHierarchyInterface::InitTraversal(Camera *cam,  
     144                                                                                           Camera *cullCam,  
    144145                                                                                           int leavePassesInQueue) 
    145146{ 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/include/HierarchyInterface.h

    r2292 r2306  
    5858        virtual OcclusionQuery *IssueNodeOcclusionQuery(HierarchyNode *node,  
    5959                                                                                                        const bool wasVisible = false) = 0; 
    60         /** Sets the root of the scene hierarchy. 
    61                 @param root the hierarchy root 
    62         */ 
    63         void SetHierarchyRoot(HierarchyNode *root); 
    64     /** Get the root of the scene hierarchy. 
    65                 @return the hierarchy root 
    66         */ 
    67         HierarchyNode *GetHierarchyRoot() const; 
    68         /** Sets the scene root and initialises this hierarchy interface for a traversal.                
    69                 @remark also resets the statistics evaluated in the last traversal 
    70         */ 
    71         void InitTraversal(); 
    72         /** Returns current frame id. 
    73                 @returns frame id 
    74         */ 
    75         unsigned int GetFrameId() const; 
    76         /** Returns a pointer to the distance queue. 
    77                 @returns current distance queue. 
    78                 @remark the distance queue stores hierarchy nodes in a front-to-back order 
    79         */ 
    80         DistanceQueue *GetQueue(); 
    81          
    8260        /** Returns distance of the node to the view plane. 
    8361                @param node the hierarchy node 
     
    9068        virtual bool CheckFrustumVisible(HierarchyNode *node,  
    9169                                                                         bool &intersects) = 0; 
    92         /** Checks if the node is visible from the current view frustum. 
    93                 @param node the current node 
    94         */ 
    95         bool CheckFrustumVisible(HierarchyNode *node); 
    96         /** Returns next available occlusion query or creates new one. 
    97                 @return the next occlusion query 
    98         */ 
    99         virtual OcclusionQuery *GetNextOcclusionQuery() = 0; 
     70         
    10071        /** Returns true if there is renderable geometry attached to this node 
    10172                @param node the current node 
     
    11889        virtual void SetLastVisited(HierarchyNode *node,  
    11990                                                                const unsigned int frameId) const = 0; 
     91         
     92 
     93        virtual void DetermineFullVisibility(GtpVisibility::HierarchyNode *node) const = 0; 
     94 
     95        virtual HierarchyNode *GetRandomLeaf(HierarchyNode *root) = 0; 
     96        virtual bool IsNodeFullyVisible(GtpVisibility::HierarchyNode *node) const = 0; 
     97 
     98        virtual void CollectLeaves(HierarchyNode *root, HierarchyNodeContainer &nodes) = 0; 
     99 
     100        virtual void RenderNodeRecursive(HierarchyNode *node) = 0; 
     101 
    120102        /** Returns frame id when this node was last visited by the traverser. See set 
    121103        */ 
    122104        virtual unsigned int LastVisited(HierarchyNode *node) const = 0; 
    123         /** Returns number of traversed nodes. 
    124         */ 
    125         unsigned int GetNumTraversedNodes(); 
    126         /** Returns number of rendered nodes. 
    127         */ 
    128         unsigned int GetNumRenderedNodes(); 
    129105                 
    130         //bool mIsShadowPass; 
    131  
    132106        /** Visualization of a culled node, dependent on the culling type.  
    133107                @param node the hierarchy node to be visualized 
     
    137111                                                                         CullingType type) const = 0; 
    138112 
    139         /** Returns vector of visible hierarchy nodes from previous render. 
     113        /** Sets the root of the scene hierarchy. 
     114                @param root the hierarchy root 
    140115        */ 
    141         std::vector<HierarchyNode *> *GetVisibleNodes(); 
    142         /** Returns vector of previoulsy rendered geometry. 
     116        void SetHierarchyRoot(HierarchyNode *root); 
     117    /** Get the root of the scene hierarchy. 
     118                @return the hierarchy root 
    143119        */ 
    144          
     120        HierarchyNode *GetHierarchyRoot() const; 
    145121         
    146122        /** This is an optimization when issuing the occlusion test.  
     
    153129        void TestGeometryForVisibleLeaves(bool testGeometry); 
    154130 
     131        /** Sets the scene root and initialises this hierarchy interface for a traversal.                
     132                @remark also resets the statistics evaluated in the last traversal 
     133        */ 
     134        void InitTraversal(); 
     135        /** Returns current frame id. 
     136                @returns frame id 
     137        */ 
     138        unsigned int GetFrameId() const; 
     139        /** Returns a pointer to the distance queue. 
     140                @returns current distance queue. 
     141                @remark the distance queue stores hierarchy nodes in a front-to-back order 
     142        */ 
     143        DistanceQueue *GetQueue(); 
    155144 
    156         virtual void DetermineFullVisibility(GtpVisibility::HierarchyNode *node) const = 0; 
     145        /** Checks if the node is visible from the current view frustum. 
     146                @param node the current node 
     147        */ 
     148        bool CheckFrustumVisible(HierarchyNode *node); 
    157149 
    158         virtual HierarchyNode *GetRandomLeaf(HierarchyNode *root) = 0; 
    159         virtual bool IsNodeFullyVisible(GtpVisibility::HierarchyNode *node) const = 0; 
     150        /** Returns number of traversed nodes. 
     151        */ 
     152        unsigned int GetNumTraversedNodes(); 
     153        /** Returns number of rendered nodes. 
     154        */ 
     155        unsigned int GetNumRenderedNodes(); 
    160156 
    161         virtual void CollectLeaves(HierarchyNode *root, HierarchyNodeContainer &nodes) = 0; 
     157        /** Returns vector of visible hierarchy nodes from previous render. 
     158        */ 
     159        std::vector<HierarchyNode *> *GetVisibleNodes(); 
    162160 
    163         virtual void RenderNodeRecursive(HierarchyNode *node) = 0; 
     161        virtual void PullUpLastVisited(GtpVisibility::HierarchyNode *node, const int frameId) const = 0; 
     162        virtual void DetermineVisibilityRatio(GtpVisibility::HierarchyNode *node) const = 0; 
     163        virtual float GetNodeVisibilityRatio(GtpVisibility::HierarchyNode *node) const = 0; 
    164164 
    165165protected: 
     
    185185        /// buffer for a node pointer 
    186186        HierarchyNode *mSavedNode; 
     187 
    187188        /// list of rendered hierarchy nodes (e.g., useful for exact visibility queries) 
    188189        std::vector<HierarchyNode *> mVisibleNodes; 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/src/BatchedQueriesCullingManager.cpp

    r2280 r2306  
    100100                                                         
    101101                                // reset node's visibility classification 
    102                                 // set visibe if geometry in node so we only traverse once 
     102                                // set visible if geometry in node so we only traverse once 
    103103                                mHierarchyInterface->SetNodeVisible(node, wasVisible && issueQuery); 
    104104 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/src/CoherentHierarchicalCullingManager.cpp

    r2292 r2306  
    110110                                                         
    111111                                // reset node's visibility classification 
    112                                 // set visibe if geometry in node so we only traverse once 
     112                                // set visible if geometry in node so we only traverse once 
    113113                                mHierarchyInterface->SetNodeVisible(node, wasVisible && issueQuery); 
    114114 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/src/HierarchyInterface.cpp

    r938 r2306  
    2929void HierarchyInterface::InitTraversal() 
    3030{ 
    31         //-- initialise for front-to-back rendering 
     31        ////////////// 
     32        //-- initialise for hierarchical traversal 
    3233 
    3334        ++ mFrameId; 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/src/RandomUpdateCullingManager.cpp

    r2292 r2306  
    133133 
    134134                                                // update node's visited flag 
    135                                                 mHierarchyInterface->SetLastVisited(randomLeaf,  
    136                                                                                                                         mHierarchyInterface->GetFrameId()); 
     135                                                mHierarchyInterface->PullUpLastVisited(randomLeaf, mHierarchyInterface->GetFrameId()); 
    137136 
    138137                                                queryQueue.push(QueryPair(randomLeaf,  
     
    152151 
    153152                                                // update node's visited flag 
    154                                                 mHierarchyInterface->SetLastVisited(leaf, mHierarchyInterface->GetFrameId()); 
     153                                                mHierarchyInterface->PullUpLastVisited(leaf, mHierarchyInterface->GetFrameId()); 
    155154 
    156155                                                queryQueue.push(QueryPair(leaf,  
     
    168167                                                         
    169168                                // reset node's visibility classification 
    170                                 // set visibe if geometry in node => we only traverse the node once 
     169                                // set visible if geometry in node => we only traverse the node once 
    171170                                mHierarchyInterface->SetNodeVisible(node, wasVisible && issueQuery); 
    172171 
     
    193192        } 
    194193 
    195         //while (!mHierarchyInterface->GetQueue()->empty()) 
    196         //      mHierarchyInterface->GetQueue()->pop(); 
    197  
    198194        // update the fully visible classifications 
    199         // TODO: this should be done during traversal! 
    200195        mHierarchyInterface->DetermineFullVisibility(mHierarchyInterface->GetHierarchyRoot()); 
     196        //mHierarchyInterface->DetermineVisibilityRatio(mHierarchyInterface->GetHierarchyRoot()); 
    201197} 
    202198//----------------------------------------------------------------------- 
     
    210206        { 
    211207                mThreshold = RAND_MAX - RAND_MAX / mAssumedVisibility; 
    212                 if (mAssumedVisibility > 100) // fix visibility 
     208                if (mAssumedVisibility > 100) // no random decicion 
    213209                        mThreshold = RAND_MAX; 
    214210        } 
Note: See TracChangeset for help on using the changeset viewer.