mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 09:49:15 +03:00
LibSoftGPU: Only interpolate fog values if fog is enabled
This commit is contained in:
parent
f510a3cd8f
commit
66cf2ea240
Notes:
sideshowbarker
2024-07-17 21:19:34 +09:00
Author: https://github.com/sunverwerth Commit: https://github.com/SerenityOS/serenity/commit/66cf2ea2405 Pull-request: https://github.com/SerenityOS/serenity/pull/11568 Reviewed-by: https://github.com/Hendiadyoin1 ✅ Reviewed-by: https://github.com/Quaker762 ✅ Reviewed-by: https://github.com/gmta
@ -375,12 +375,14 @@ static void rasterize_triangle(const RasterizerOptions& options, Gfx::Bitmap& re
|
||||
|
||||
quad.uv = interpolate(expand4(vertex0.tex_coord), expand4(vertex1.tex_coord), expand4(vertex2.tex_coord), quad.barycentrics);
|
||||
|
||||
// Calculate depth of fragment for fog
|
||||
//
|
||||
// OpenGL 1.5 spec chapter 3.10: "An implementation may choose to approximate the
|
||||
// eye-coordinate distance from the eye to each fragment center by |Ze|."
|
||||
if (options.fog_enabled) {
|
||||
// Calculate depth of fragment for fog
|
||||
//
|
||||
// OpenGL 1.5 spec chapter 3.10: "An implementation may choose to approximate the
|
||||
// eye-coordinate distance from the eye to each fragment center by |Ze|."
|
||||
|
||||
quad.fog_depth = interpolate(expand4(vertex0_eye_absz), expand4(vertex1_eye_absz), expand4(vertex2_eye_absz), quad.barycentrics);
|
||||
quad.fog_depth = interpolate(expand4(vertex0_eye_absz), expand4(vertex1_eye_absz), expand4(vertex2_eye_absz), quad.barycentrics);
|
||||
}
|
||||
|
||||
pixel_shader(quad);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user