Z-buffering

Started by
4 comments, last by Corpse 22 years, 5 months ago
Is Z-Buffering better for hidden surface removal (I can''t spell it) than BSP trees? Or it''s just easiest?
Pavel "Corpse" Zuna
Advertisement
I mean : "... easier to write the code."

Pavel "Corpse" Zuna
Pavel "Corpse" Zuna
It''s easier to write the code for a z-buffer than a BSP tree, sure. But neither is a substitute for the other. BSP is used for front-to-back sorting of your scene''s geometry, and that can solve the hidden-surface problem, and z-buffers sort pixels front to back, so they can as well. But a BSP tree can be used in conjunction with a PVS system, etc, to greatly increase rendering efficiency. Inserting a player model into the BSP tree, though, would be overkill; use a hardware z-buffer for that. In short, both in theory do the same thing, but they should under most circumstances be used in conjunction with one another.
I''d say Z buffering:

pDevice->SetRenderState( D3DRS_ZENABLE, D3DZB_TRUE );


However you''d probably use both - each solves a different problem. Z buffering is pixel level prevention of overdraw.
BSP trees are more to do with not drawing complete polygons or even complete models. BSP trees also have a nice side effect that it can give you the polygons in front to back sorted order, which is perfect as input for a Z buffer.

--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

well i use both ..
i have a bsp for rendering everything
except the player models and some dynamic terrain objects.

the rest rely on the zbuffer for proper rendering .



{ Stating the obvious never helped any situation !! }
OK, thanks guys (or girls).

I will try to use both.

Pavel "Corpse" Zuna
Pavel "Corpse" Zuna

This topic is closed to new replies.

Advertisement