Handle texture filtering sanely to avoid blurriness#16034
Conversation
0d8370a to
1c23ba4
Compare
| # This is also used as the base node texture size for world-aligned | ||
| # texture autoscaling. | ||
| texture_min_size (Base texture size) int 64 1 32768 | ||
| texture_min_size (Base texture size) int 192 1 16384 |
There was a problem hiding this comment.
Where does 192 come from?
Also, if we really enforce a min-limit in the code (see comment below), then this should be 192 192 16384 here as well. (But I think it makes no sense to enforce a min-limit)
There was a problem hiding this comment.
oops, missed that
192 is just based on my personal testing. the lowest resolution where everything is non-blurry enough that you could give this to an unsuspecting player in good conscience (IMO).
| translucent_liquids = g_settings->getBool("translucent_liquids"); | ||
| enable_minimap = g_settings->getBool("enable_minimap"); | ||
| node_texture_size = std::max<u16>(g_settings->getU16("texture_min_size"), 1); | ||
| node_texture_size = rangelim(g_settings->getU16("texture_min_size"), |
There was a problem hiding this comment.
Why enforce a min-limit in the code? The default is already set to 192. If a user wants this lower, why not let them?
There was a problem hiding this comment.
the idea is: the user should not be able to ruin the artistic choice of the game author
There was a problem hiding this comment.
I see. One could then argue why have a setting like this at all? I.e. the server should be in control.
Having a good default, but letting a user set whatever they want makes more sense to me (it's already in the "advanced" section).
There was a problem hiding this comment.
I think larger sizes help with moire even more and make it less blurry (obviously), so it sort of still makes sense.
Don't want to break someone's use of this setting :)
There was a problem hiding this comment.
the approach seems sane 👍
the only thing I can think of that could cause "backwards compat" complaints here is if someone has a lower-than-192px texture pack that they meant to be blurry / bilinearly filtered. e.g. "SharpNet Photo Realism 64px" (with all the filtering settings enabled) would change from this:


the new version actually looks preferable to me though 🤷
EDIT: my example doesn't work anyway because looking at the package screenshots of "SharpNet Photo Realism 64px", it doesn't look like bilinear was enabled, so the author likely didn't intend it to be blurry.
I can't really think of any case where this would be a concern.
| const core::dimension2d<u32> dim = baseimg->getDimension(); | ||
| if (filter) { | ||
| const f32 scaleto = rangelim(g_settings->getU16("texture_min_size"), | ||
| TEXTURE_FILTER_MIN_SIZE, 16384); |
There was a problem hiding this comment.
what happened to "2 tabs for continuation lines" btw? (also elsewhere)
There was a problem hiding this comment.
idk I usually never do that


tl;dr enabling "bilinear filter" or "trilinear filter" is no longer an automatic blurry knob
fixes #15604 as proposed
relates to #13108
To do
This PR is Ready for Review.
How to test