LibGL: Do not exclude points on the clip planes

Most resources seem to suggest that points on the clip planes are also
inside the frustum, e.g.: https://www.cubic.org/docs/3dclip.htm

This seems to resolve some rendering issues in Grim Fandango in OpenGL
mode where the screen remained black. This was because of quads being
drawn with their vertex positions exactly on the clip planes.
This commit is contained in:
Jelle Raaijmakers 2021-12-02 00:46:32 +01:00 committed by Andreas Kling
parent 4a2a68cd94
commit 52d6ae36cb
Notes: sideshowbarker 2024-07-17 22:50:16 +09:00

View file

@ -15,17 +15,17 @@ bool Clipper::point_within_clip_plane(const FloatVector4& vertex, ClipPlane plan
{
switch (plane) {
case ClipPlane::LEFT:
return vertex.x() > -vertex.w();
return vertex.x() >= -vertex.w();
case ClipPlane::RIGHT:
return vertex.x() < vertex.w();
return vertex.x() <= vertex.w();
case ClipPlane::TOP:
return vertex.y() < vertex.w();
return vertex.y() <= vertex.w();
case ClipPlane::BOTTOM:
return vertex.y() > -vertex.w();
return vertex.y() >= -vertex.w();
case ClipPlane::NEAR:
return vertex.z() > -vertex.w();
return vertex.z() >= -vertex.w();
case ClipPlane::FAR:
return vertex.z() < vertex.w();
return vertex.z() <= vertex.w();
}
return false;