15bd8deadSopenharmony_ciGL_HP_occlusion_test - PRELIMINARY
25bd8deadSopenharmony_ci----------------------------------
35bd8deadSopenharmony_ciXXX - Not complete yet!!!
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    HP_occlusion_test
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciName Strings
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    GL_HP_occlusion_test 
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciNumber
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    137
165bd8deadSopenharmony_ci
175bd8deadSopenharmony_ciOverview
185bd8deadSopenharmony_ci
195bd8deadSopenharmony_ciThis extension defines a mechanism whereby an application can determine the
205bd8deadSopenharmony_cinon-visibility of some set of geometry based on whether an encompassing set
215bd8deadSopenharmony_ciof geometry is non-visible. In general this feature does not guarantee that
225bd8deadSopenharmony_cithe target geometry is visible when the test fails, but is accurate with
235bd8deadSopenharmony_ciregard to non-visibility.
245bd8deadSopenharmony_ci
255bd8deadSopenharmony_ciOcclusion culling allows an application to render some geometry and at the
265bd8deadSopenharmony_cicompletion of the rendering to determine if any of the geometry could or did
275bd8deadSopenharmony_cimodify the depth buffer, ie. a depth buffer test succeeded. The idea being
285bd8deadSopenharmony_cithat if the application renders a bounding box of some geometry in this mode
295bd8deadSopenharmony_ciand the occlusion test failed (ie. the bounding box was depth culled due to
305bd8deadSopenharmony_cithe current contents of the depth buffer) then the geometry enclosed by the
315bd8deadSopenharmony_cibounding box would also be depth culled. Occlusion culling operates
325bd8deadSopenharmony_ciindependently of the current rendering state (ie. when occlusion culling is
335bd8deadSopenharmony_cienabled fragments are generated and the depth and/or color buffer may be
345bd8deadSopenharmony_ciupdated). To prevent updating the depth/color buffers the application must
355bd8deadSopenharmony_cidisable updates to these buffers. As a side effect of reading the occlusion
365bd8deadSopenharmony_ciresult the internal result state is cleared, setting it up for a new
375bd8deadSopenharmony_cibounding box test.
385bd8deadSopenharmony_ci
395bd8deadSopenharmony_ciThe expected usage of this feature is :
405bd8deadSopenharmony_ci
415bd8deadSopenharmony_ci    - disable updates to color and depth buffer (optional)
425bd8deadSopenharmony_ci        glDepthMask(GL_FALSE)
435bd8deadSopenharmony_ci        glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE)
445bd8deadSopenharmony_ci    - enable occlusion test
455bd8deadSopenharmony_ci        glEnable(GL_OCCLUSION_TEST_HP)
465bd8deadSopenharmony_ci    - render bounding geometry
475bd8deadSopenharmony_ci        gl rendering calls
485bd8deadSopenharmony_ci    - disable occlusion test
495bd8deadSopenharmony_ci        glDisable(GL_OCCLUSION_TEST_HP)
505bd8deadSopenharmony_ci    - enable updates to color and depth buffer
515bd8deadSopenharmony_ci        glDepthMask(GL_TRUE)
525bd8deadSopenharmony_ci        glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_TRUE)
535bd8deadSopenharmony_ci    - read occlusion test result
545bd8deadSopenharmony_ci        glGetBooleanv(GL_OCCLUSION_TEST_RESULT_HP, &result)
555bd8deadSopenharmony_ci    - if (result) render internal geometry
565bd8deadSopenharmony_ci      else don't render
575bd8deadSopenharmony_ci
585bd8deadSopenharmony_ciFor this extension to be useful the assumption are being made :
595bd8deadSopenharmony_ci
605bd8deadSopenharmony_ci    - the time to render the geometry under test is much more than rendering
615bd8deadSopenharmony_ci        the encompassing geometry, including reading back the test result
625bd8deadSopenharmony_ci    - the application is modelling data that includes occluding structures
635bd8deadSopenharmony_ci        (eg. walls, hierarchial assemblies, ...)
645bd8deadSopenharmony_ci    - the application is structured in such a way as to utilize bounding
655bd8deadSopenharmony_ci        boxes for encompassing geometry
665bd8deadSopenharmony_ci
675bd8deadSopenharmony_ciNew Procedures and Functions
685bd8deadSopenharmony_ci
695bd8deadSopenharmony_ci    none
705bd8deadSopenharmony_ci
715bd8deadSopenharmony_ciNew Tokens
725bd8deadSopenharmony_ci
735bd8deadSopenharmony_ci    Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, by
745bd8deadSopenharmony_ci    the <pname> of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev :
755bd8deadSopenharmony_ci
765bd8deadSopenharmony_ci        OCCLUSION_TEST_HP           0x????
775bd8deadSopenharmony_ci
785bd8deadSopenharmony_ci    Accepted by the <pname> of GetBooleanv, GetIntegerv, GetFloatv, and 
795bd8deadSopenharmony_ci    GetDoublev :
805bd8deadSopenharmony_ci
815bd8deadSopenharmony_ci        OCCLUSION_TEST_RESULT_HP    0x????
825bd8deadSopenharmony_ci
835bd8deadSopenharmony_ciNew State
845bd8deadSopenharmony_ci
855bd8deadSopenharmony_ci    Boolean result of occlusion test, initial value of FALSE. The result is
865bd8deadSopenharmony_ci    set to FALSE as a side effect of reading it (executing a Get call).
875bd8deadSopenharmony_ci
885bd8deadSopenharmony_ciIssue
895bd8deadSopenharmony_ci
905bd8deadSopenharmony_ci    - should the interface allow for multiple occlusion tests to be enabled
915bd8deadSopenharmony_ci        possible extension :
925bd8deadSopenharmony_ci            add MAX_OCCLUSION_TESTS
935bd8deadSopenharmony_ci            add OCCLUSION_TESTn_HP where n is 1 to MAX_OCCLUSION_TESTS
945bd8deadSopenharmony_ci            add OCCLUSION_TEST_RESULTn_HP where n is 1 to MAX_OCCLUSION_TESTS
955bd8deadSopenharmony_ci            define semantics of multiple tests enables (ex. there exists 
965bd8deadSopenharmony_ci                precedence of tests, ie. TEST7 overrides TEST1 thru 6)
975bd8deadSopenharmony_ci            define how mulitple test results returned (ex. bit encoded in
985bd8deadSopenharmony_ci                return word, 32 per word)
995bd8deadSopenharmony_ci            define disable(OCCLUSION_TEST_HP) (un-numbered test) to disable
1005bd8deadSopenharmony_ci                all currently enabled
1015bd8deadSopenharmony_ci            resulting usage :
1025bd8deadSopenharmony_ci                disable update to color and depth buffer
1035bd8deadSopenharmony_ci                enable occlusion test 1
1045bd8deadSopenharmony_ci                render bounding box 1
1055bd8deadSopenharmony_ci                enable occlusion test 2
1065bd8deadSopenharmony_ci                render bounding box 2
1075bd8deadSopenharmony_ci                    ...
1085bd8deadSopenharmony_ci                enable occlusion test n
1095bd8deadSopenharmony_ci                render bounding box n
1105bd8deadSopenharmony_ci                disable all occlusion tests
1115bd8deadSopenharmony_ci                enable updates to color and depth buffer
1125bd8deadSopenharmony_ci                read occlusion test results
1135bd8deadSopenharmony_ci                for each result 
1145bd8deadSopenharmony_ci                    if (result) render internal geometry
1155bd8deadSopenharmony_ci                    else don't render
1165bd8deadSopenharmony_ci
1175bd8deadSopenharmony_ci   - should the interface be based on render mode semantics
1185bd8deadSopenharmony_ci        no proposal at this time
1195bd8deadSopenharmony_ci
1205bd8deadSopenharmony_ci
1215bd8deadSopenharmony_ci
1225bd8deadSopenharmony_ci--------------64E073B876D--
123