mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
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.
This commit is contained in:
parent
fd628cdfec
commit
9fc419395e
Notes:
sideshowbarker
2024-07-17 17:53:36 +09:00
Author: https://github.com/gmta Commit: https://github.com/SerenityOS/serenity/commit/9fc419395e Pull-request: https://github.com/SerenityOS/serenity/pull/12898
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user