Lecture 6: The Rasterization Pipeline (10)
brandonlouie

Something I'm interested in knowing more about is how these triangles are encoded. It's mentioned this algorithm is used for sorting in depth, however isn't it the case that these triangles are each being drawn in a 2D space? This leads me to believe there exists some z-component for each of these triangles vertices, and I'm wondering if it's even worth storing this z-component (outside of the context of depth) if these triangles are always going to be drawn in 2D. I supposed we could relate this to homogeneous coordinates, where the z component for each point is usually a dummy value. We could maybe store the depth in place of that dummy value, but could that possibly mess with the following matrix-vector operations as a result?

Boomaa23

@brandonlouie I'm mostly guessing here, but I think that triangles store the z-depth primarily for draw ordering. I believe this is one of the main reasons for using the z-buffer instead of Painter's algorithm, which is that the z-buffer has some well defined draw order. If you did painter's algorithm but added a z-level, you'd just have a z-buffer. Realistically, a polygon in 3D is always projected to 2D anyways, so this is a way of displaying any object (whether it was originally 3D or intended to be 2D) on a 2D plane with depth.

NothernSJTU

wow I find it b/c the exam, now it is appears that the idea of Z-buffer. Very good to start

You must be enrolled in the course to comment