Mail Archives: djgpp/1998/04/08/07:45:33
Scott Warner <swarnerx3 AT acadia DOT net> wrote:
>Steven S. Falls wrote:
>>
>> Lately I have been hering about somthing called Z-Sorting. What is
>> it?
>> Thnaks,
>> -Ardy
>> http://www.addr.com/~ardy/
>
>Z-buffering is an algorithm used to remove hidden surfaces when
>displaying 3d surfaces. The x and y coordinates (plotted on the screen)
>and the z coordinate (projected into the screen) is placed in a buffer.
>Through sorting of these z coordinates hidden surfaces can be removed
>for fast display. As I understand it, z-buffering is built into some 3d
>accelerator boards.
Z-sorting, on the other hand, is an algorithm that stashes all the
polygons to be rendered in a list, and sorts them according to their Z
order (a simple implementation would just sort according to the
average Z of the vertices), and renders them later (often
back-to-front (Painter's algorithm)).
The difference between Z-buffering and Z-sorting is that Z-buffering
is pixel-per-pixel and does pixel Z comparisons while rendering, while
Z-sorting is polygon-per-polygon and sorts a list of polygons before
rendering. For moderate numbers of polygons this difference is obvious
(Z-buffering is more accurate and can handle overlapping, but has an
incredible amount of overhead, while Z-sorting can do both the sorting
and the rendering relatively fast). But for very high number of
polygons, the overhead of the sorting operation may become high enough
to warrant using Z-buffering instead.
- Raw text -