hi all,
this is my question!
is HSR performed by opengl? or must i implement it for myself?
thanks + greets
gammastrahler
Does OpenGL perform Hidden Surface Removal?
Started by Gammastrahler, Jun 20 2001 12:58 AM
4 replies to this topic
Sponsor:
#2 Moderators - Reputation: 1087
Posted 20 June 2001 - 01:09 AM
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
#3 Members - Reputation: 116
Posted 20 June 2001 - 01:20 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
#4 Members - Reputation: 512
Posted 20 June 2001 - 01:39 AM
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. *-
#5 Members - Reputation: 122
Posted 21 June 2001 - 07:23 PM
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






