• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1GL_HP_occlusion_test - PRELIMINARY
2----------------------------------
3XXX - Not complete yet!!!
4
5Name
6
7    HP_occlusion_test
8
9Name Strings
10
11    GL_HP_occlusion_test
12
13Number
14
15    137
16
17Overview
18
19This extension defines a mechanism whereby an application can determine the
20non-visibility of some set of geometry based on whether an encompassing set
21of geometry is non-visible. In general this feature does not guarantee that
22the target geometry is visible when the test fails, but is accurate with
23regard to non-visibility.
24
25Occlusion culling allows an application to render some geometry and at the
26completion of the rendering to determine if any of the geometry could or did
27modify the depth buffer, ie. a depth buffer test succeeded. The idea being
28that if the application renders a bounding box of some geometry in this mode
29and the occlusion test failed (ie. the bounding box was depth culled due to
30the current contents of the depth buffer) then the geometry enclosed by the
31bounding box would also be depth culled. Occlusion culling operates
32independently of the current rendering state (ie. when occlusion culling is
33enabled fragments are generated and the depth and/or color buffer may be
34updated). To prevent updating the depth/color buffers the application must
35disable updates to these buffers. As a side effect of reading the occlusion
36result the internal result state is cleared, setting it up for a new
37bounding box test.
38
39The expected usage of this feature is :
40
41    - disable updates to color and depth buffer (optional)
42        glDepthMask(GL_FALSE)
43        glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE)
44    - enable occlusion test
45        glEnable(GL_OCCLUSION_TEST_HP)
46    - render bounding geometry
47        gl rendering calls
48    - disable occlusion test
49        glDisable(GL_OCCLUSION_TEST_HP)
50    - enable updates to color and depth buffer
51        glDepthMask(GL_TRUE)
52        glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_TRUE)
53    - read occlusion test result
54        glGetBooleanv(GL_OCCLUSION_TEST_RESULT_HP, &result)
55    - if (result) render internal geometry
56      else don't render
57
58For this extension to be useful the assumption are being made :
59
60    - the time to render the geometry under test is much more than rendering
61        the encompassing geometry, including reading back the test result
62    - the application is modelling data that includes occluding structures
63        (eg. walls, hierarchial assemblies, ...)
64    - the application is structured in such a way as to utilize bounding
65        boxes for encompassing geometry
66
67New Procedures and Functions
68
69    none
70
71New Tokens
72
73    Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, by
74    the <pname> of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev :
75
76        OCCLUSION_TEST_HP           0x????
77
78    Accepted by the <pname> of GetBooleanv, GetIntegerv, GetFloatv, and
79    GetDoublev :
80
81        OCCLUSION_TEST_RESULT_HP    0x????
82
83New State
84
85    Boolean result of occlusion test, initial value of FALSE. The result is
86    set to FALSE as a side effect of reading it (executing a Get call).
87
88Issue
89
90    - should the interface allow for multiple occlusion tests to be enabled
91        possible extension :
92            add MAX_OCCLUSION_TESTS
93            add OCCLUSION_TESTn_HP where n is 1 to MAX_OCCLUSION_TESTS
94            add OCCLUSION_TEST_RESULTn_HP where n is 1 to MAX_OCCLUSION_TESTS
95            define semantics of multiple tests enables (ex. there exists
96                precedence of tests, ie. TEST7 overrides TEST1 thru 6)
97            define how mulitple test results returned (ex. bit encoded in
98                return word, 32 per word)
99            define disable(OCCLUSION_TEST_HP) (un-numbered test) to disable
100                all currently enabled
101            resulting usage :
102                disable update to color and depth buffer
103                enable occlusion test 1
104                render bounding box 1
105                enable occlusion test 2
106                render bounding box 2
107                    ...
108                enable occlusion test n
109                render bounding box n
110                disable all occlusion tests
111                enable updates to color and depth buffer
112                read occlusion test results
113                for each result
114                    if (result) render internal geometry
115                    else don't render
116
117   - should the interface be based on render mode semantics
118        no proposal at this time
119
120
121
122--------------64E073B876D--
123