Lecture 6: The Rasterization Pipeline (15)
SKwon1220

I'm a little confused here; to my understanding, there don't exist traditional methods that are able to sort a list of items faster than O(NlogN) time. Are we saying that Z-buffer allows us to sort n triangles in linear time, and if so, what exactly are the details behind it?

KevinXu02

Actually, the z-buffer only requires the smallest depth; hence, this is a finding minimum operation instead of a sort.

litony396

What are the limitations of the Z-buffer and is there ever any reason to use a different way of managing depth?

ayra-jafri

@litony396 After a bit of googling, it seems that one disadvantage to the z-buffer is the presence of hidden surface artifacts when rendering objects far away. Z-buffers are also costly storage/memory-wise, and require additional code to render transparent surfaces.

One notable alternative to the z-buffer is the w-buffer, which is less memory-intensive, although not as supported as the z-buffer.

Citing my sources below for further reading: https://learn.microsoft.com/en-us/windows/win32/direct3d9/depth-buffers

https://learn.microsoft.com/en-us/windows-hardware/drivers/display/w-buffering

https://www.cs.helsinki.fi/group/goa/render/piilopinnat/z_buffer.html

vivek3141

@SKwon1220 I think the general idea is that the Z-Buffer algorithm is NOT sorting. It's not possible to use the Z-Buffer algorithm as a subroutine for sorting. An example is if you have a bunch of triangles that are on top of each other, running the Z-Buffer algorithm does not give you the triangles in sorted order. We're essentially getting rid of unnecessary information, which is what gives it the speedup.

You must be enrolled in the course to comment