In the material, set Sampling > Filter to Linear Mipmaps Anisotropic (mat.texture_filter = BaseMaterial3D.TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC). In our Godot 4.7 test a black and white checker floor, seen from 1 m up, had a brightness spread of 123.1 out of 255 near the camera. Near the horizon the default filter, Linear Mipmaps, brought it down to 26.5, almost flat gray. Anisotropic gave 56.2 there, and the near floor stayed at 123.1.
The code
Save it as far_sharp.gd. sharpen_far() switches every StandardMaterial3D under a node to Linear Mipmaps Anisotropic, once per material even when meshes share it. For example: const FarSharp := preload("res://far_sharp.gd") and FarSharp.sharpen_far($Level) when the level loads. Or set the filter by hand on the few materials that cover floors, roads, roofs and long walls.
extends RefCounted
## Floors, roads and walls seen at a low angle turn into a gray blur with the default texture filter.
## Anisotropic filtering keeps their detail.
## Sets every BaseMaterial3D under root to linear mipmaps with anisotropic filtering.
## Shared materials are changed once. Returns how many it changed.
static func sharpen_far(root: Node) -> int:
var done := {}
for node in root.find_children("*", "MeshInstance3D", true, false):
var mi := node as MeshInstance3D
if mi.mesh == null:
continue
for i in mi.mesh.get_surface_count():
var mat := mi.get_active_material(i) as BaseMaterial3D
if mat and not done.has(mat):
mat.texture_filter = BaseMaterial3D.TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC
done[mat] = true
return done.size()
What we measured
A 400 m checker floor with squares 0.5 m wide, unshaded, the camera 1 m up looking slightly down toward the horizon. In three bands of the screen we measured how far the pixels spread from their average brightness: high means the squares are still visible, low means gray. Two runs gave the same numbers.
- Linear Mipmaps, the default: near 123.1, middle 115.0, far 26.5.
- Linear Mipmaps Anisotropic: near 123.1, middle 118.3, far 56.2.
- Nearest Mipmaps: far 96.6. Linear without mipmaps: far 126.1. Far away those squares are smaller than a pixel, so a high number there is noise rather than detail.
- The project's Anisotropic Filtering Level was at its default, 2.
- sharpen_far() on two floors sharing one material: 1 material changed, and the far band rose from 26.5 to 56.2.
Why it happens
Mipmaps are smaller copies of the texture that Godot picks when a surface is far away, to stop it from sparkling. Plain mipmapping picks one size for both directions, so on a floor seen almost edge-on it picks a copy that is small enough for the squashed direction and blurs the other one too. Anisotropic filtering takes several samples along the squashed direction instead, so the floor keeps its detail across. We tested with the Compatibility renderer only.
What to change
- More or less sharpening: Project Settings > Rendering > Textures > Default Filters > Anisotropic Filtering Level. It costs some GPU time on the surfaces that use it.
- Pixel art textures in 3D: use a Nearest filter, see blurry pixel textures.
- Textures that stretch on big floors: world triplanar UVs.
Ground and roofs to try it on: Stylized Asian PBR Textures has 10 seamless materials, including a temple stone path, tatami and three kinds of roof tiles, as ready StandardMaterial3D files in 2K and 1K. They use Godot's default filter, so run sharpen_far() on the ones you use for long paths and roofs.
Tested in Godot 4.7 with the Compatibility renderer.
Ready-made: Stylized Asian PBR Textures has 10 seamless materials in 2K and 1K, including a temple stone path, tatami and roof tiles, as ready Godot 4 materials.
More how-tos: Shaders, materials and lights
- A 3D outline that stays the same width on screen
- Find and fix the seam in a repeating texture
- PS1 vertex wobble that is the same near and far
- Snow that stays on the roofs
- Packed ORM maps on a StandardMaterial3D
- Neon signs that share a material but not a colour
- A MatCap that stays the right way up from every side
- Scroll or tile a 2D texture without stretched edge lines
- Make WorldEnvironment color grading apply to a 2D game
- Get a hard cel-shaded light edge from StandardMaterial3D's Toon mode
- Make metallic materials stop looking black or flat
- Make a glowing sign or screen actually light the wall around it
- Use a LUT strip for color grading in Godot 4
- Tiling textures that keep their size on any mesh
- A sharp low-resolution PS1 look
- Only 8 lights show on a long wall in Compatibility
- Hit flash shader for 2D sprites
- Flash a 3D enemy white when it takes a hit
- Dissolve shader for 3D models
- 2D outline shader that is not cut off
- 3D outline shader without gaps at the corners
- A force field shield with a hit ripple
- Normal map inverted: DirectX vs OpenGL
- Full-screen post-process shader in 3D
- Scroll a shader texture for hours without the once-an-hour jump