mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 00:31:14 +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
Notes:
sideshowbarker
2024-07-17 22:50:16 +09:00
Author: https://github.com/gmta Commit: https://github.com/SerenityOS/serenity/commit/52d6ae36cb5 Pull-request: https://github.com/SerenityOS/serenity/pull/11154 Reviewed-by: https://github.com/sunverwerth ✅
|
@ -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…
Reference in a new issue