Revision 92,
1.3 KB
checked in by mattausch, 19 years ago
(diff) |
exchanged halfbounding box with full bounding box
|
Rev | Line | |
---|
[59] | 1 | #include "StopAndWaitCullingManager.h" |
---|
[86] | 2 | #include <windows.h> |
---|
[59] | 3 | |
---|
| 4 | namespace GtpVisibility { |
---|
| 5 | |
---|
| 6 | //----------------------------------------------------------------------- |
---|
| 7 | void StopAndWaitCullingManager::RenderScene() |
---|
| 8 | { |
---|
[87] | 9 | InitFrame(); |
---|
| 10 | |
---|
[59] | 11 | while (!mHierarchyInterface->GetQueue()->empty()) |
---|
| 12 | { |
---|
| 13 | HierarchyNode *node = mHierarchyInterface->GetQueue()->top(); |
---|
| 14 | mHierarchyInterface->GetQueue()->pop(); |
---|
[87] | 15 | |
---|
[59] | 16 | // interesting for visualization purpose |
---|
| 17 | mHierarchyInterface->SetNodeVisible(node, false); |
---|
| 18 | mHierarchyInterface->SetLastVisited(node, mHierarchyInterface->GetFrameId()); |
---|
| 19 | |
---|
| 20 | bool intersects = false; |
---|
| 21 | |
---|
[74] | 22 | if (!mHierarchyInterface->CheckFrustumVisible(node, intersects)) |
---|
[59] | 23 | { |
---|
| 24 | mNumFrustumCulledNodes ++; |
---|
| 25 | } |
---|
[74] | 26 | else |
---|
[59] | 27 | { |
---|
[74] | 28 | //if intersects near plane => skip occlusion query because wrong results possible |
---|
| 29 | if (intersects) |
---|
| 30 | { |
---|
| 31 | mHierarchyInterface->SetNodeVisible(node, true); |
---|
| 32 | mHierarchyInterface->TraverseNode(node); |
---|
| 33 | continue; |
---|
| 34 | } |
---|
[59] | 35 | |
---|
[87] | 36 | mNumQueriesIssued ++; |
---|
| 37 | |
---|
[86] | 38 | unsigned int visiblePixels = 0; |
---|
| 39 | |
---|
| 40 | mHierarchyInterface->IssueOcclusionQuery(node)->GetQueryResult(visiblePixels, true); |
---|
[92] | 41 | |
---|
[74] | 42 | // node visible |
---|
[86] | 43 | if (visiblePixels > mVisibilityThreshold) |
---|
[74] | 44 | { |
---|
| 45 | mHierarchyInterface->TraverseNode(node); |
---|
| 46 | } |
---|
| 47 | else |
---|
| 48 | { |
---|
| 49 | mNumQueryCulledNodes ++; |
---|
| 50 | } |
---|
[59] | 51 | } |
---|
| 52 | } |
---|
| 53 | } |
---|
| 54 | } // namespace GtpVisibility |
---|
Note: See
TracBrowser
for help on using the repository browser.