Original Post
🔒 Locked
Z-buffer: how slow?
Advertisement
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
------------------------------
#pragma twice
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.
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.
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
------------------------------
#pragma twice
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.
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.
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.
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.
Advertisement