(Originally posted on Mastodon)

I’ve spent way too much time finding this information, so if someone needs it… to enable anisotropic filtering on a custom shader (gdshader) in Godot Engine 4, the syntax is:

uniform sampler2D MySamplerName : source_color, filter_linear_mipmap_anisotropic;

It’s not an option on the material, not an option on the texture, not an option in the project config, it’s a gdshader-specific syntax.

This should make your textures appear sharp as they should!