diff --git a/games/devtest/mods/testnodes/textures.lua b/games/devtest/mods/testnodes/textures.lua index 86bc3e343..96f291d6a 100644 --- a/games/devtest/mods/testnodes/textures.lua +++ b/games/devtest/mods/testnodes/textures.lua @@ -89,10 +89,12 @@ for a=1,#alphas do end minetest.register_node("testnodes:alpha_compositing", { - description = S("Alpha Compositing Test Node") .. "\n" .. + description = S("Texture Overlay Test Node") .. "\n" .. S("A regular grid should be visible where each cell contains two " .. - "texels with the same colour.") .. "\n" .. - S("Alpha compositing is gamma-incorrect for backwards compatibility."), + "texels with the same color.") .. "\n" .. + S("Texture overlay is gamma-incorrect, " .. + "and in general it does not do alpha compositing, " .. + "both for backwards compatibility."), drawtype = "glasslike", paramtype = "light", tiles = {"testnodes_alpha_compositing_bottom.png^" .. diff --git a/games/devtest/mods/testnodes/textures/testnodes_alpha_compositing_bottom.png b/games/devtest/mods/testnodes/textures/testnodes_alpha_compositing_bottom.png index 83447e423..40d9f53de 100644 Binary files a/games/devtest/mods/testnodes/textures/testnodes_alpha_compositing_bottom.png and b/games/devtest/mods/testnodes/textures/testnodes_alpha_compositing_bottom.png differ diff --git a/src/client/imagesource.cpp b/src/client/imagesource.cpp index 696159408..adc39f130 100644 --- a/src/client/imagesource.cpp +++ b/src/client/imagesource.cpp @@ -371,14 +371,12 @@ void blitBaseImage(video::IImage* &src, video::IImage* &dst) namespace { -/** Calculate the color of a single pixel drawn on top of another pixel without - * gamma correction +/** Calculate the result of the overlay texture modifier (`^`) for a single + * pixel * - * The color mixing is a little more complicated than just - * video::SColor::getInterpolated because getInterpolated does not handle alpha - * correctly. - * For example, a pixel with alpha=64 drawn atop a pixel with alpha=128 should - * yield a pixel with alpha=160, while getInterpolated would yield alpha=96. + * This is not alpha blending if both src and dst are semi-transparent. The + * reason this is that an old implementation did it wrong, and fixing it would + * break backwards compatibility (see #14847). * * \tparam overlay If enabled, only modify dst_col if it is fully opaque * \param src_col Color of the top pixel