mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:47:45 +00:00
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:
parent
4a2a68cd94
commit
52d6ae36cb
1 changed files with 6 additions and 6 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue