- Timestamp:
- 06/18/08 23:32:43 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/CHC_revisited
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/CHC_revisited/Bvh.cpp
r2773 r2774 765 765 766 766 for (int i = node->mFirst; i <= node->mLast; ++ i) 767 { 767 768 numTriangles += mGeometry[i]->GetGeometry()->GetNumTriangles(); 768 769 } 770 769 771 return numTriangles; 770 772 } -
GTP/trunk/App/Demos/Vis/CHC_revisited/CHCPlusPlusTraverser.cpp
r2773 r2774 97 97 98 98 // identify nodes that we cannot skip queries for 99 const bool testFeasible = (!wasVisible || (node->IsVirtualLeaf() && (node->GetAssumedVisibleFrameId() <= mFrameId))); 99 const bool testFeasible = (!wasVisible || (node->IsVirtualLeaf() && 100 (node->GetAssumedVisibleFrameId() <= mFrameId))); 100 101 101 102 // node was not recently tested => reset flag … … 200 201 201 202 if (query->GetNodes().empty()) 203 { 202 204 newBatchVal = 1.0f; 205 } 203 206 else 204 207 { … … 237 240 BvhNode *node = mIQueue.front(); 238 241 mIQueue.pop(); 242 239 243 OcclusionQuery *query = GetNextMultiQuery(mIQueue); 240 244 //OcclusionQuery *query = IssueOcclusionQuery(node); -
GTP/trunk/App/Demos/Vis/CHC_revisited/RenderTraverser.cpp
r2773 r2774 167 167 168 168 169 170 171 169 void RenderTraverser::SetVisibilityThreshold(int threshold) 172 170 { … … 181 179 182 180 183 184 181 #if 0 185 182 OcclusionQuery *RenderTraverser::IssueOcclusionQuery(BvhNode *node, bool wasVisible) 186 183 { … … 193 190 } 194 191 195 196 void RenderTraverser::IssueOcclusionQuery(const OcclusionQuery &query, bool wasVisible) 192 #else 193 194 195 OcclusionQuery *RenderTraverser::IssueOcclusionQuery(BvhNode *node, bool wasVisible) 197 196 { 198 197 ++ mStats.mNumIssuedQueries; … … 204 203 } 205 204 206 query.BeginQuery(); 205 OcclusionQuery *query = mQueryHandler.RequestQuery(); 206 207 query->Reset(); 208 query->AddNode(node); 209 210 query->BeginQuery(); 207 211 208 212 if (wasVisible) … … 213 217 if (wasVisible && mUseOptimization) 214 218 { 215 for (size_t i = 0; i < query.GetNodes().size(); ++ i) 216 RenderNode(query.GetNodes()[i]); 219 RenderNode(node); 217 220 } 218 221 else … … 222 225 ++ mStats.mNumStateChanges; 223 226 227 mBvh->RenderBoundingBox(node, mRenderState); 228 } 229 230 query->EndQuery(); 231 232 return query; 233 } 234 235 #endif 236 void RenderTraverser::IssueOcclusionQuery(const OcclusionQuery &query, bool wasVisible) 237 { 238 ++ mStats.mNumIssuedQueries; 239 240 if (mUseRenderQueue && (mRenderState->GetMode() == RenderState::RENDER)) 241 { 242 mRenderQueue.Render(); 243 mRenderQueue.Clear(); 244 } 245 246 query.BeginQuery(); 247 248 if (wasVisible) 249 ++ mStats.mNumPreviouslyVisibleNodeQueries; 250 251 // if this node is a previous visible leaf: 252 // leaves will be rendered anyway => we can also test with the real geometry 253 if (wasVisible && mUseOptimization) 254 { 255 for (size_t i = 0; i < query.GetSize(); ++ i) 256 RenderNode(query.GetNodes()[i]); 257 } 258 else 259 { 260 // change to query mode and render box 261 if (mRenderState->SetState(RenderState::QUERY)) 262 ++ mStats.mNumStateChanges; 263 224 264 mBvh->RenderBoundingBoxes(query.GetNodes(), mRenderState); 225 265 } -
GTP/trunk/App/Demos/Vis/CHC_revisited/chcdemo.cpp
r2773 r2774 897 897 898 898 sprintf_s(msg5, "fps: %6.1f", fps); 899 900 899 //cout << "previously visible node queries: " << traverser->GetStats().mNumPreviouslyVisibleNodeQueries << endl; 901 900 … … 909 908 { 910 909 glColor3f(1.0f, 1.0f, 1.0f); 911 912 910 Output(850, 30, msg[renderMode]); 913 911
Note: See TracChangeset
for help on using the changeset viewer.