mirror of
https://github.com/minetest/minetest.git
synced 2024-11-30 03:23:45 +01:00
Fix comment and alpha test node oopsies from #14852
This commit is contained in:
parent
9046379b30
commit
603eb57943
@ -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^" ..
|
||||
|
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 {
|
||||
|
||||
/** 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
|
||||
|
Loading…
Reference in New Issue
Block a user