Does OpenGL perform Hidden Surface Removal?
hi all,
this is my question!
is HSR performed by opengl? or must i implement it for myself?
thanks + greets
gammastrahler
Yes and no. It only does generic stuff (like removal of polygons that face in one direction (clockwise or counter clockwise), and if the video card can do it, advanced Z-Buffer occlusion), and makes no assumptions about what you're trying to render. For advanced more occlusion (portals, BSP, quadtree, ROAM) you should write the code yourself.
[Resist Windows XP's Invasive Production Activation Technology!]
Edited by - Null and Void on June 20, 2001 8:11:38 AM
[Resist Windows XP's Invasive Production Activation Technology!]
Edited by - Null and Void on June 20, 2001 8:11:38 AM
simply,
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK); //can also use GL_FRONT, or GL_FRONT_AND_BACK
HHSDrum@yahoo.com
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK); //can also use GL_FRONT, or GL_FRONT_AND_BACK
HHSDrum@yahoo.com
OpenGL does Hidden Surface Removal.
It''s called a Zbuffer or depth buffer and it removes hidden surfaces (surfaces behind other surfaces).
Back Face Culling (BFC) is another Hidden Surface Removal (HSR) technic which can be used along with Z-Buffering.
(And you really want to use it, it boost rendering)
BFC is not in a good pipeline position in the current OpenGL pipeline, and you should better do it yourself rather than ask OpenGL to do.
I think that they may/would be extensions to do the tests at a more appropriate place in the pipeline.
-* So many things to do, so little time to spend. *-
It''s called a Zbuffer or depth buffer and it removes hidden surfaces (surfaces behind other surfaces).
Back Face Culling (BFC) is another Hidden Surface Removal (HSR) technic which can be used along with Z-Buffering.
(And you really want to use it, it boost rendering)
BFC is not in a good pipeline position in the current OpenGL pipeline, and you should better do it yourself rather than ask OpenGL to do.
I think that they may/would be extensions to do the tests at a more appropriate place in the pipeline.
-* So many things to do, so little time to spend. *-
As stated earlier, if you know that a particular part of an object is not going to be seen (like the inside of a closed box), then you can use glEnable(GL_CULL_FACE); If for instance, you want to compare the z axis distance of a already displayed pixel and a new pixel that will be placed in its spot, you would just use the debt buffer and call glEnable(GL_DEBTH_TEST); In the initializing code of your software, make sure that you clear out the structure with a call to glclear(GL_DEBTH_BUFFER_BIT);
Edem Attiogbe
Edem Attiogbe
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement