PDA

View Full Version : Depth test, BSP tree, performance...



bleifrei
04-28-2003, 02:00 PM
Hi There!

First, sorry for my bad english.
I'm a newbie in opengl programming, on my bumpy path through Redbook. And I've become a bit confused. http://www.opengl.org/discussion_boards/ubb/smile.gif
Suppose that I plan to write a program which draw many houses in 3d and these houses consist of many prebuilt objects(walls, doors, windows, roof, etc). I've read in RB, that enabling depth test in opengl increase performance. Nearest object drawn, covered object not drawn, right? I've read something about frustum culling( it says: "DONT DRAW WHAT CANNOT BE SEEN.") But depth test deal with hidden surface removal, then what need is there for frustum culling? Is anything outside a clipping plane "nothing" for opengl? And why programs need for (for example) BSP tree algorythm to increase performance of rendering of bigger scenes?
I will greatly appreciate any help!

ReAKtor
04-28-2003, 02:50 PM
With depth testing objects that are behind other objects (ie can't be seen) are overwritten by the object in front so the display is correct. With depth testing the object in the background is still being drawn. It's just overwritten by the object in front. Depth testing doesn't do any sort of Culling (you need to use glEnable(GL_CULL_FACE) for that) it just makes the display look correct by checking the z value of the pixels. You need frustum culling which removes all the objects that are not in your immediate fov (field of view). This will massively speed up your OpenGL program. I'm not sure about BSP trees though.

graphicsMan
04-28-2003, 07:36 PM
If you have a really large scene, you can use a BSP tree to render a relatively smaller number of triangles. For most scenes this isn't necissary because the hardware has a z-buffer which is very fast. I would only look into BSP trees if your application has a large number of triangles and you aren't getting a high enough frame rate, or needs to be drawn back to front (say for alpha blending).

Brian

bleifrei
04-29-2003, 12:29 PM
Thx guys!