Fix clipping
This commit is contained in:
parent
906423db08
commit
e21b7a0b9c
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user