mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-22 09:18:55 +00:00
LibGL: Fix clipping and interpolate vertex attributes
The previous clipping implementation was problematic especially when clipping against the near plane. Triangles are now correctly clipped using homogenous coordinates against all frustum planes. Texture coordinates and vertex colors are now correctly interpolated. The earier implementation was just a placeholder.
This commit is contained in:
parent
39ff1459f8
commit
220ac5eb02
Notes:
sideshowbarker
2024-07-18 05:30:19 +09:00
Author: https://github.com/sunverwerth
Commit: 220ac5eb02
Pull-request: https://github.com/SerenityOS/serenity/pull/9451
Reviewed-by: https://github.com/Quaker762 ✅
Reviewed-by: https://github.com/alimpfard
6 changed files with 111 additions and 205 deletions
|
@ -7,6 +7,8 @@
|
|||
#pragma once
|
||||
|
||||
#include "GL/gl.h"
|
||||
#include <LibGfx/Vector2.h>
|
||||
#include <LibGfx/Vector4.h>
|
||||
|
||||
namespace GL {
|
||||
|
||||
|
@ -15,9 +17,9 @@ struct GLColor {
|
|||
};
|
||||
|
||||
struct GLVertex {
|
||||
GLfloat x, y, z, w;
|
||||
GLfloat r, g, b, a;
|
||||
GLfloat u, v;
|
||||
FloatVector4 position;
|
||||
FloatVector4 color;
|
||||
FloatVector2 tex_coord;
|
||||
};
|
||||
|
||||
struct GLTriangle {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue