1 | #ifndef _CullingManager_H__
|
---|
2 | #define _CullingManager_H__
|
---|
3 |
|
---|
4 | #include "HierarchyInterface.h"
|
---|
5 |
|
---|
6 |
|
---|
7 | namespace GtpVisibility {
|
---|
8 |
|
---|
9 | /** This abstract class implements an interface for a specific culling
|
---|
10 | algorithm. The algorithm is either used to render a scene
|
---|
11 | or to make a visibility query.
|
---|
12 | */
|
---|
13 | class CullingManager
|
---|
14 | {
|
---|
15 | public:
|
---|
16 | /** Default constructor.
|
---|
17 | @remark an appropriate hierarchy interface must be provided for the algorithms to
|
---|
18 | work on specific hierarchy
|
---|
19 | */
|
---|
20 | CullingManager();
|
---|
21 | /** Renders the scene using a specific occlusion culling algorithm, e.g., coherent
|
---|
22 | hierarchical culling or stop and wait.
|
---|
23 | */
|
---|
24 | virtual void RenderScene() = 0;
|
---|
25 | /** Sets the hierarchy interface.
|
---|
26 | @param hierarchyInterface
|
---|
27 | @remark the hierarchy interface encapsulates the hierarchy we are working on
|
---|
28 | */
|
---|
29 | void SetHierarchyInterface(HierarchyInterface *hierarchyInterface);
|
---|
30 | /** Sets the threshold for the visibiliy culling algorithm.
|
---|
31 | @param visibilityThreshold number of visible pixels where an object
|
---|
32 | is still considered invisible.
|
---|
33 | */
|
---|
34 | void SetVisibilityThreshold(unsigned int visibilityThreshold);
|
---|
35 |
|
---|
36 | /** Returns number of frustum culled nodes.
|
---|
37 | */
|
---|
38 | unsigned int GetNumFrustumCulledNodes();
|
---|
39 | /** Returns number of occlusion query culled nodes.
|
---|
40 | */
|
---|
41 | unsigned int GetNumQueryCulledNodes();
|
---|
42 | /** Returns number of issued occlusion queries.
|
---|
43 | */
|
---|
44 | unsigned int GetNumQueriesIssued();
|
---|
45 | /** basic initializations on beginning of each frame, e.g.,
|
---|
46 | resets statistics.
|
---|
47 | */
|
---|
48 | void InitFrame(bool visualizeCulledNodes);
|
---|
49 |
|
---|
50 | /** Some visualization of culled nodes are shown, depending
|
---|
51 | on the type of hierarchy.
|
---|
52 | @param visualizeCulledNodes if true, culled nodes are visualized
|
---|
53 | */
|
---|
54 | void SetVisualizeCulledNodes(bool visualizeCulledNodes);
|
---|
55 |
|
---|
56 | protected:
|
---|
57 |
|
---|
58 | unsigned int mNumQueryCulledNodes;
|
---|
59 | unsigned int mNumFrustumCulledNodes;
|
---|
60 | unsigned int mVisibilityThreshold;
|
---|
61 | unsigned int mNumQueriesIssued;
|
---|
62 |
|
---|
63 | HierarchyInterface *mHierarchyInterface;
|
---|
64 | bool mVisualizeCulledNodes;
|
---|
65 | };
|
---|
66 | } // namespace GtpVisibility
|
---|
67 | #endif // CullingManager |
---|