Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Anonymous Poster

Depht Buffer, Z-Buffer, BSP

This topic is 6933 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 :-)

Share this post


Link to post
Share on other sites
Advertisement
Depth Buffer and Z Buffer are the same thing, if OpenGL finds a hardware Z Buffer it will automatically use it.

----------
Drago

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!