mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-02 16:33:13 +00:00
LibGL: Implement glDepthRange
This commit is contained in:
parent
3dd9efd35f
commit
a97dbd2317
Notes:
sideshowbarker
2024-07-18 05:30:38 +09:00
Author: https://github.com/sunverwerth
Commit: a97dbd2317
Pull-request: https://github.com/SerenityOS/serenity/pull/9451
Reviewed-by: https://github.com/Quaker762 ✅
Reviewed-by: https://github.com/alimpfard
7 changed files with 26 additions and 1 deletions
|
@ -260,6 +260,8 @@ static void rasterize_triangle(const RasterizerOptions& options, Gfx::Bitmap& re
|
|||
|
||||
auto barycentric = FloatVector3(coords.x(), coords.y(), coords.z()) * one_over_area;
|
||||
float z = interpolate(triangle.vertices[0].z, triangle.vertices[1].z, triangle.vertices[2].z, barycentric);
|
||||
z = options.depth_min + (options.depth_max - options.depth_min) * (z + 1) / 2;
|
||||
|
||||
if (z >= *depth) {
|
||||
pixel_mask[y] ^= 1 << x;
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue