Fix comment and alpha test node oopsies from #14852

This commit is contained in:
DS 2024-08-16 22:01:16 +02:00 committed by GitHub
parent 9046379b30
commit 603eb57943
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 10 deletions

@ -89,10 +89,12 @@ for a=1,#alphas do
end end
minetest.register_node("testnodes:alpha_compositing", { 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 " .. S("A regular grid should be visible where each cell contains two " ..
"texels with the same colour.") .. "\n" .. "texels with the same color.") .. "\n" ..
S("Alpha compositing is gamma-incorrect for backwards compatibility."), S("Texture overlay is gamma-incorrect, " ..
"and in general it does not do alpha compositing, " ..
"both for backwards compatibility."),
drawtype = "glasslike", drawtype = "glasslike",
paramtype = "light", paramtype = "light",
tiles = {"testnodes_alpha_compositing_bottom.png^" .. tiles = {"testnodes_alpha_compositing_bottom.png^" ..

Binary file not shown.

Before

Width:  |  Height:  |  Size: 251 B

After

Width:  |  Height:  |  Size: 265 B

@ -371,14 +371,12 @@ void blitBaseImage(video::IImage* &src, video::IImage* &dst)
namespace { namespace {
/** Calculate the color of a single pixel drawn on top of another pixel without /** Calculate the result of the overlay texture modifier (`^`) for a single
* gamma correction * pixel
* *
* The color mixing is a little more complicated than just * This is not alpha blending if both src and dst are semi-transparent. The
* video::SColor::getInterpolated because getInterpolated does not handle alpha * reason this is that an old implementation did it wrong, and fixing it would
* correctly. * break backwards compatibility (see #14847).
* 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.
* *
* \tparam overlay If enabled, only modify dst_col if it is fully opaque * \tparam overlay If enabled, only modify dst_col if it is fully opaque
* \param src_col Color of the top pixel * \param src_col Color of the top pixel