← Pixel Dreamer Studio

Keep floors, roads and roofs sharp when the camera looks along them

The default filter blurs a texture seen at a low angle. Set the material's texture filter to Linear Mipmaps Anisotropic.

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.

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

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