diff --git a/GL/clip.c b/GL/clip.c index 0bc4e01..d0fafc2 100644 --- a/GL/clip.c +++ b/GL/clip.c @@ -255,9 +255,9 @@ void _glClipTriangleStrip(SubmissionTarget* target, uint8_t fladeShade) { * and it's in front of the near plane (Z > -W) */ uint8_t visible = ( - ((v1->w > 0 && v1->xyz[2] > -v1->w) ? 4 : 0) | - ((v2->w > 0 && v2->xyz[2] > -v2->w) ? 2 : 0) | - ((v3->w > 0 && v3->xyz[2] > -v3->w) ? 1 : 0) + ((v1->w > 0 && v1->xyz[2] >= -v1->w) ? 4 : 0) | + ((v2->w > 0 && v2->xyz[2] >= -v2->w) ? 2 : 0) | + ((v3->w > 0 && v3->xyz[2] >= -v3->w) ? 1 : 0) ); switch(visible) { diff --git a/GL/draw.c b/GL/draw.c index b12fa08..d8217c8 100644 --- a/GL/draw.c +++ b/GL/draw.c @@ -1171,12 +1171,9 @@ GL_FORCE_INLINE void divide(SubmissionTarget* target) { float f = MATH_fsrra(vertex->w * vertex->w); vertex->xyz[0] *= f; vertex->xyz[1] *= f; - vertex->xyz[2] = 1.0 - ((DEPTH_RANGE_MULTIPLIER_L * vertex->xyz[2] * f) + DEPTH_RANGE_MULTIPLIER_H); - /* Passing a value > 1.0f will cause the polygon to be dropped by the - * PVR. Although we clip to the near plane, rounding errors can still - * cause this happen. This just ensures it doesn't */ - vertex->xyz[2] = MIN(1.0f, vertex->xyz[2]); + /* Scale depending on glDepthRange */ + vertex->xyz[2] = 1.0f - ((DEPTH_RANGE_MULTIPLIER_L * vertex->xyz[2] * f) + DEPTH_RANGE_MULTIPLIER_H); ++vertex; }