diff options
author | Jelle Raaijmakers <jelle@gmta.nl> | 2022-03-06 00:21:58 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-03-06 01:38:01 +0100 |
commit | 9fc419395ee2bae343ee978ee5036f6eb2edbdfe (patch) | |
tree | 1e70f69fdea668b45eb53cf29d84cc140c757ec7 /Userland/Libraries/LibSoftGPU | |
parent | fd628cdfec7e4bfcb6d169b732cde5b1e83eb7b4 (diff) | |
download | serenity-9fc419395ee2bae343ee978ee5036f6eb2edbdfe.zip |
LibSoftGPU: Use destination alpha for texture decal function
According to the OpenGL spec, the decal function uses the destination
(or texture) alpha instead of the source alpha. This fixes the sky in
GLQuake.
Diffstat (limited to 'Userland/Libraries/LibSoftGPU')
-rw-r--r-- | Userland/Libraries/LibSoftGPU/Device.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibSoftGPU/Device.cpp b/Userland/Libraries/LibSoftGPU/Device.cpp index 84940710b7..5bedeab2c9 100644 --- a/Userland/Libraries/LibSoftGPU/Device.cpp +++ b/Userland/Libraries/LibSoftGPU/Device.cpp @@ -1016,10 +1016,10 @@ ALWAYS_INLINE void Device::shade_fragments(PixelQuad& quad) quad.out_color = texel; break; case TextureEnvMode::Decal: { - auto src_alpha = quad.out_color.w(); - quad.out_color.set_x(mix(quad.out_color.x(), texel.x(), src_alpha)); - quad.out_color.set_y(mix(quad.out_color.y(), texel.y(), src_alpha)); - quad.out_color.set_z(mix(quad.out_color.z(), texel.z(), src_alpha)); + auto dst_alpha = texel.w(); + quad.out_color.set_x(mix(quad.out_color.x(), texel.x(), dst_alpha)); + quad.out_color.set_y(mix(quad.out_color.y(), texel.y(), dst_alpha)); + quad.out_color.set_z(mix(quad.out_color.z(), texel.z(), dst_alpha)); break; } default: |