add more checks in triangle raster code
This commit is contained in:
parent
79a678f162
commit
9550d34e65
7 changed files with 357 additions and 260 deletions
|
|
@ -308,11 +308,22 @@ bool pxl8_frustum_test_aabb(const pxl8_frustum* frustum, pxl8_vec3 min, pxl8_vec
|
|||
(normal.z >= 0.0f) ? max.z : min.z
|
||||
};
|
||||
|
||||
f32 dist = pxl8_vec3_dot(normal, p_vertex) + d;
|
||||
pxl8_vec3 n_vertex = {
|
||||
(normal.x >= 0.0f) ? min.x : max.x,
|
||||
(normal.y >= 0.0f) ? min.y : max.y,
|
||||
(normal.z >= 0.0f) ? min.z : max.z
|
||||
};
|
||||
|
||||
if (dist < 0.0f) {
|
||||
f32 p_dist = pxl8_vec3_dot(normal, p_vertex) + d;
|
||||
f32 n_dist = pxl8_vec3_dot(normal, n_vertex) + d;
|
||||
|
||||
if (p_dist < -0.1f) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (n_dist > 0.1f) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue