[59] | 1 | #ifndef _CoherentHierarchicalCullingManager_H__
|
---|
| 2 | #define _CoherentHierarchicalCullingManager_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 CoherentHierarchicalCullingManager : public CullingManager
|
---|
| 14 | {
|
---|
| 15 | public:
|
---|
[142] | 16 | CoherentHierarchicalCullingManager();
|
---|
[155] | 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 | CoherentHierarchicalCullingManager(const unsigned int assumedVisibility);
|
---|
| 21 |
|
---|
[59] | 22 | void RenderScene();
|
---|
[155] | 23 | /** Sets assumed visibility (i.e., an estimation for
|
---|
| 24 | how many frames the visibility is considered to be valid).
|
---|
[146] | 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.
|
---|
[142] | 28 | */
|
---|
[345] | 29 | void SetAssumedVisibility(const unsigned int assumedVisibility);
|
---|
[146] | 30 |
|
---|
[142] | 31 | protected:
|
---|
[2332] | 32 |
|
---|
[147] | 33 | /** Decides if node is considered to be visible depeding on the
|
---|
[142] | 34 | assumed visibility factor.
|
---|
[147] | 35 | @returns if node is considered to be visible
|
---|
[142] | 36 | */
|
---|
[147] | 37 | bool DecideVisible(HierarchyNode *node) const;
|
---|
[146] | 38 |
|
---|
[155] | 39 | /** Skip query for this node.
|
---|
| 40 | */
|
---|
[345] | 41 | void SkipQuery(HierarchyNode *node) const;
|
---|
[155] | 42 |
|
---|
[2332] | 43 | /** If this node is still valid for traversal in this frame.
|
---|
| 44 | It is possible that the parent was tested invisible before
|
---|
| 45 | so this node can be skipped.
|
---|
| 46 | */
|
---|
| 47 | bool NodeInvalid(HierarchyNode *node) const;
|
---|
| 48 |
|
---|
[1492] | 49 | /** number of steps the visibility is assumed to be valid.
|
---|
| 50 | */
|
---|
| 51 | unsigned int mAssumedVisibility;
|
---|
[155] | 52 |
|
---|
[146] | 53 | /** Threshold for rand function to return positive result with respect to
|
---|
| 54 | mAssumedVisibility.
|
---|
| 55 | */
|
---|
[147] | 56 | int mThreshold;
|
---|
[59] | 57 | };
|
---|
| 58 |
|
---|
| 59 | } // namespace GtpVisibility
|
---|
| 60 |
|
---|
| 61 | #endif // CoherentHierarchicalCullingManager_H
|
---|