Switch to calculating z buffer from viewport vertices
This commit is contained in:
parent
fdce10a85c
commit
a3f0be461b
@ -347,8 +347,7 @@ internal void fill_triangle(Render *render, V3f vertices[TRIANGLE_VERTICES],
|
|||||||
}
|
}
|
||||||
|
|
||||||
z = 0.0f;
|
z = 0.0f;
|
||||||
z += vertices[0].z * coords.x + vertices[1].z * coords.y +
|
z += v0.z * coords.x + v1.z * coords.y + v2.z * coords.z;
|
||||||
vertices[2].z * coords.z;
|
|
||||||
zbuf = get_pixel(f32, &(render->depth), x, y);
|
zbuf = get_pixel(f32, &(render->depth), x, y);
|
||||||
|
|
||||||
if (z > zbuf) {
|
if (z > zbuf) {
|
||||||
|
Loading…
Reference in New Issue
Block a user