Depht Buffer, Z-Buffer, BSP

Started by
8 comments, last by Anonymous Poster 23 years, 11 months ago
Im using OpenGL and just started my first Engine using BSP. Now i got a problem: If two triangles are crossing each other, only one of them will be displayed, even if it is behind the other. If i do my engine using OpenGLs Depht Buffer, these problems dont appear. Somebody told me that it is also possible to use the graphic-cards built in Z-Buffer, because it is faster and i dont need BSP. Perhaps OpenGLs Depht Buffer automatically uses my graphic cards Z-Buffer. How do i use Hardware Z-Buffer and which of this techniques is the fastest ? -cYa- The only real Anonymous Poster with ICQ # and email :-)
i am the 2 between 0 and 1
Advertisement
Depth Buffer and Z Buffer are the same thing, if OpenGL finds a hardware Z Buffer it will automatically use it.

----------
Drago
osu!
Cool but can you tell me if it is faster / slower as BSP ?

i am the 2 between 0 and 1
The depth buffer and the BSP tree aren't exclusive. You can use them together. If you draw the BSP tree back-to-front the rendering will be slower with the z-buffer on since the no polygon will be behind any that are already rendered and the tests are useless. But if you draw the BSP tree front-to-back with the z-buffer on it can be faster than rendering back-to-front with the z-buffer off, it depends on how the polygons are layed out and how much overdraw you have.

PS. Why don't you register?

- WitchLord

Edited by - WitchLord on 4/29/00 5:35:10 PM

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

BSP trees can do much more than depth buffers. BSP trees can be used to cull polygons from the final draw list in addition to drawing order. They can also be used for collision detection.
Anonymous, I don't know OpenGL, but here's one thing you can do with BSP's in DirectX: Render all the polygons in the BSP tree, back to front, with z-buffer *checking* disabled, but with z-buffer *writing* enabled. Since you aren't checking the z-buffer at every pixel, these polys can be rendered more quickly. But, presumably you have sprites that aren't in the BSP tree, so they'll need a z-buffer to render them correctly -- that's why you enable z-buffer writing. I don't know if you could do this in OpenGl.

As far as which is faster: if you already have some polys in a BSP tree, definitely just render them back-to-front and don't use the z-buffer.

Now for a philosophical question: if "Anonymous Poster" is your registered name, are you really even anonymous?

Edited by - Eric on 4/30/00 3:10:50 AM
Well, Eric, if speed is a concern, your method is quite slow, ''cause the BSP rendering generates LOTS of overdraw.

Read the articles at http://www.bluesnews.com/abrash for more info about techniques to limit overdraw (the techniques used in Quake). Lots of ''em still apply even with the latest hardware.
Regards,Laarz
Sorry Eric,
but I have to defend OpenGL. In OpenGL you can disable/enable the Depth Buffer. When enabled you can also dectivate the Depth Test (always writes to z-buffer without testing). Further you can make ogl not write into the buffer, but to check whether the pixel is closer or not.

to Mr.anonymous, it depends on the number of polys you have in your scene. At a certain number the BSP tree will be faster because you can fastly cull out many of the polys.
Ok thank you all ! Laarz your link really helped me out.
To Witch Lord : I am registered or have you ever seen an anonymous poster who has ICQ number and profile ?

i am the 2 between 0 and 1
Yeah, I noticed that you were registered when I read Eric''s post. Before that I just saw ''Anonymous Poster'' and didn''t go beyond that.

- WitchLord

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement