mirror of
https://github.com/minetest/minetest.git
synced 2025-01-03 20:07:30 +01:00
parent
a37bdbf8b7
commit
10f1e142f6
@ -1511,10 +1511,18 @@ bool ImageSource::generateImagePart(std::string_view part_of_name,
|
||||
|
||||
CHECK_BASEIMG();
|
||||
|
||||
// Apply the "clean transparent" filter, if needed
|
||||
/* Apply the "clean transparent" filter, if necessary
|
||||
* This is needed since filtering will sample parts of the image
|
||||
* that are transparent and PNG optimizers often discard the color
|
||||
* information in those parts. */
|
||||
if (m_setting_mipmap || m_setting_bilinear_filter ||
|
||||
m_setting_trilinear_filter || m_setting_anisotropic_filter)
|
||||
imageCleanTransparent(baseimg, 127);
|
||||
m_setting_trilinear_filter || m_setting_anisotropic_filter) {
|
||||
/* Note: in theory we should pass either 0 or 127 depending on
|
||||
* if the texture is used with an ALPHA or ALPHA_REF material,
|
||||
* however we don't have this information here.
|
||||
* It doesn't matter in practice. */
|
||||
imageCleanTransparent(baseimg, 0);
|
||||
}
|
||||
|
||||
/* Upscale textures to user's requested minimum size. This is a trick to make
|
||||
* filters look as good on low-res textures as on high-res ones, by making
|
||||
|
Loading…
Reference in New Issue
Block a user