1 | #ifndef _RandomUpdateCullingManager_H__
|
---|
2 | #define _RandomUpdateCullingManager_H__
|
---|
3 |
|
---|
4 | #include "CullingManager.h"
|
---|
5 | #include "HierarchyInterface.h"
|
---|
6 |
|
---|
7 |
|
---|
8 | namespace GtpVisibility
|
---|
9 | {
|
---|
10 |
|
---|
11 | /** Renders the scene with the coherent hierarchical culling algorithm.
|
---|
12 | */
|
---|
13 | class RandomUpdateCullingManager : public CullingManager
|
---|
14 | {
|
---|
15 | public:
|
---|
16 | RandomUpdateCullingManager();
|
---|
17 | /** Constructor taking the assumed visibility into account, i.e., the estimation
|
---|
18 | for how many frames the current visibility is considered to be valid
|
---|
19 | */
|
---|
20 | RandomUpdateCullingManager(const unsigned int assumedVisibility);
|
---|
21 |
|
---|
22 | void RenderScene();
|
---|
23 | /** Sets assumed visibility (i.e., an estimation for
|
---|
24 | how many frames the visibility is considered to be valid).
|
---|
25 | @param assumedVisibility indicates for how many frames the
|
---|
26 | same visibility is be assumed.
|
---|
27 | if 0, the visibility is tested deterministically for each frame.
|
---|
28 | */
|
---|
29 | void SetAssumedVisibility(const unsigned int assumedVisibility);
|
---|
30 |
|
---|
31 | protected:
|
---|
32 |
|
---|
33 | /** Decides if node is considered to be visible depeding on the
|
---|
34 | assumed visibility factor.
|
---|
35 | @returns if node is considered to be visible
|
---|
36 | */
|
---|
37 | bool DecideVisible(HierarchyNode *node) const;
|
---|
38 |
|
---|
39 | /** Skip query for this node.
|
---|
40 | */
|
---|
41 | void SkipQuery(HierarchyNode *node) const;
|
---|
42 |
|
---|
43 | /** number of steps the visibility is assumed to be valid.
|
---|
44 | */
|
---|
45 | unsigned int mAssumedVisibility;
|
---|
46 |
|
---|
47 | /** Threshold for rand function to return positive result
|
---|
48 | with respect to mAssumedVisibility.
|
---|
49 | */
|
---|
50 | int mThreshold;
|
---|
51 |
|
---|
52 | int mRandomCandidates;
|
---|
53 | };
|
---|
54 |
|
---|
55 | } // namespace GtpVisibility
|
---|
56 |
|
---|
57 | #endif // RandomUpdateCullingManager_H
|
---|