Revision 2757,
1.2 KB
checked in by mattausch, 17 years ago
(diff) |
loading textured scenes possible
|
Line | |
---|
1 | #include "StopAndWaitTraverser.h"
|
---|
2 |
|
---|
3 | namespace CHCDemo
|
---|
4 | {
|
---|
5 | StopAndWaitTraverser::StopAndWaitTraverser(): RenderTraverser()
|
---|
6 | {
|
---|
7 | }
|
---|
8 |
|
---|
9 |
|
---|
10 | StopAndWaitTraverser::~StopAndWaitTraverser()
|
---|
11 | {
|
---|
12 | //DelQueries();
|
---|
13 | }
|
---|
14 |
|
---|
15 |
|
---|
16 | void StopAndWaitTraverser::Render()
|
---|
17 | {
|
---|
18 | #if 0
|
---|
19 | while(! mDistanceQueue.empty())
|
---|
20 | {
|
---|
21 | HierarchyNode *node = mDistanceQueue.top();
|
---|
22 | mDistanceQueue.pop();
|
---|
23 | mNumTraversedNodes ++;
|
---|
24 | // interesting for the visualization, so rest and set
|
---|
25 | node->SetVisible(false);
|
---|
26 |
|
---|
27 | bool intersects;
|
---|
28 |
|
---|
29 | if(InsideViewFrustum(node, intersects))
|
---|
30 | {
|
---|
31 | // update node's visited flag
|
---|
32 | node->SetLastVisited(mFrameID);
|
---|
33 |
|
---|
34 | // for near plane intersecting abbs possible
|
---|
35 | // wrong results => skip occlusion query
|
---|
36 | if(intersects)
|
---|
37 | {
|
---|
38 | node->SetVisible(true);
|
---|
39 | TraverseNode(node);
|
---|
40 | }
|
---|
41 | else
|
---|
42 | {
|
---|
43 | IssueOcclusionQuery(node, false);
|
---|
44 |
|
---|
45 | // wait if result not available
|
---|
46 | int visiblePixels = GetOcclusionQueryResult(node);
|
---|
47 |
|
---|
48 | // node visible
|
---|
49 | if(visiblePixels > mVisibilityThreshold)
|
---|
50 | {
|
---|
51 | node->SetVisible(true);
|
---|
52 | TraverseNode(node);
|
---|
53 | }
|
---|
54 | else
|
---|
55 | {
|
---|
56 | mNumQueryCulledNodes ++;
|
---|
57 | }
|
---|
58 | }
|
---|
59 | }
|
---|
60 | else
|
---|
61 | {
|
---|
62 | mNumFrustumCulledNodes ++;
|
---|
63 | }
|
---|
64 | }
|
---|
65 | #endif
|
---|
66 | }
|
---|
67 |
|
---|
68 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.