Skip to main content
gamedev.net
🔒 Locked

Z-buffer: how slow?

Started by Moe Oct 10, 2000 at 1:24 PM 5 replies 300+ views
Original Post
Moe
Moe
I have heard that the DX z buffer is rather slow. Can anyone confirm this? How does it compare in speed to a portal/bsp based sorting? Is the painter''s algorithm used in 3d at all (just sorting according to z values)?
furby100
furby100
Well, in software, Z-Buffering is one of the slowest methods around. In hardware though, its reasonable and has pixel accuracy and so therefore you can use intersecting polygons without breaking them up, which is a good thing. Other methods cannot do this. The painters algorithm is only used in software engines usually.

------------------------------
#pragma twice


sharewaregames.20m.com

Moe
Moe
If the painters algorithm was used in software, would it be possibly faster than a z-buffer in hardware, or than in software? So is it somewhat feasable to use a painters algorithm instead of a z-buffer (whether it be in hardware or software)?

MatsG
MatsG
In my old software engines I usally found that after about 2-3000 polygones the z-buffer started to get faster then sorting.
Since the time spent on sorting grows in a x^2 kind of curve by each polygon while the time spent on z-buffer is the same. Ofcourse that depends on the algorithm used. The main reason I usally ended up with z-buffers is that no clipping between polygons is needed.
furby100
furby100
Painter''s algorithm is faster than a Z-Buffer in hardware, but not much, and it generates artifacts much more readily than a Z-Buffer will.

------------------------------
#pragma twice


sharewaregames.20m.com

Friday13
Friday13
my 2 cents:

I recently found out that on GeForce2 (not sure about other nVidia chips), z-buffer is ''tile-based''(or ''ierarchical'' if you like), i.e., each of the lower addresses covers a small square (approx. 32x32) on the screen, so, when such square is not drawn upon, it takes a single doubleword to mark it empty. When a square''s not empty, it gets further split by four smaller squares (using higher addresses) and so on. I heard this might provide up to 20% performance gain.
mhkrause
mhkrause
Z-buffering in hardware is generally so fast you don''t need to worry about it, it won''t be the bottleneck.

You can try disabling Z-buffering, and doing painter''s algorithm in software, but then you''d be losing out on the the primary point of hardware acceleration: Free up the CPU to do something more important. If the CPU has to spend a lot of time prepping the primitives for the card, and the card spends a lot of time waiting for the CPU to deliver, neither will be operating at peak efficiency.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.