← Pixel Dreamer Studio

Make metallic materials stop looking black or flat

Metal gets its color from what it reflects, not from ambient light. Give the Environment a sky to reflect; the background can stay as it is.

In the Environment, set a Sky (a ProceduralSkyMaterial is enough) and set Reflected Light > Source to Sky (env.reflected_light_source = Environment.REFLECTION_SOURCE_SKY). The background can stay a solid color. In our Godot 4.7 test with only a sun and a dark color background, a gray ball with metallic 1 and roughness 0.2 averaged 34.9 brightness out of 255, against 160.3 for the same ball with metallic 0. White ambient light brought the non-metal ball to 246.4 and did nothing for the metal: 108.0 before and after at roughness 0.5. A sky for reflections only took the smooth metal to 80.8, and the background stayed at 8.7.

The code

Save it as metal_sky.gd. reflect_sky() gives an Environment a procedural sky for reflections and ambient light without touching its background. dark_metals() lists the meshes with a metallic material that will look dark with the current Environment: print it when metal looks wrong. For example: const MetalSky := preload("res://metal_sky.gd") and MetalSky.reflect_sky($WorldEnvironment.environment), or print(MetalSky.dark_metals(self, $WorldEnvironment.environment)).

extends RefCounted
## Metallic materials get their color from what they reflect, not from ambient light.
## These helpers find metals that have nothing to reflect and give the scene a sky.


## Gives env a procedural sky for reflections and ambient light only.
## The background the camera shows (a solid color, for example) stays as it is.
## The metal shows these colors: a near-black sky gives it nothing to reflect.
static func reflect_sky(env: Environment, top := Color(0.38, 0.45, 0.55), horizon := Color(0.65, 0.66, 0.67), ground := Color(0.2, 0.17, 0.13), energy := 1.0) -> void:
	var mat := ProceduralSkyMaterial.new()
	mat.sky_top_color = top
	mat.sky_horizon_color = horizon
	mat.ground_horizon_color = horizon
	mat.ground_bottom_color = ground
	mat.energy_multiplier = energy
	var sky := Sky.new()
	sky.sky_material = mat
	env.sky = sky
	env.reflected_light_source = Environment.REFLECTION_SOURCE_SKY
	env.ambient_light_source = Environment.AMBIENT_SOURCE_SKY


## True when env gives metals a sky to reflect.
static func has_reflections(env: Environment) -> bool:
	if env == null or env.sky == null:
		return false
	if env.reflected_light_source == Environment.REFLECTION_SOURCE_SKY:
		return true
	return env.reflected_light_source == Environment.REFLECTION_SOURCE_BG and env.background_mode == Environment.BG_SKY


## Paths of the meshes under root with a metallic material (0.5 or more) that will look dark with env.
static func dark_metals(root: Node, env: Environment) -> Array[String]:
	var found: Array[String] = []
	if has_reflections(env):
		return found
	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 mat.metallic >= 0.5:
				found.append(str(mi.get_path()))
				break
	return found

What we measured

A gray sphere (albedo 0.8) 4 m in front of the camera, a DirectionalLight3D and an Environment with a dark solid color background. We averaged the screen brightness (0 to 255) over a square inside the ball. Two runs gave the same numbers.

Why it happens

In a PBR material, metallic 1 turns off the diffuse color: the albedo only tints what the surface reflects. Ambient light only feeds the diffuse part, which is why it brightened the plain ball and did nothing for the metal. With no sky and no reflection probe, the only thing the metal can reflect is the light itself, a small highlight that gets smaller as roughness goes down. We tested with the Compatibility renderer only.

What to change

Ready-made metal surfaces: 24 Sci-Fi PBR Materials are all metallic 1.0 with a metallic map, as Godot 4 .tres files. Their three demo scenes use this same setup: a dark color background, with a procedural sky set for reflections.

Tested in Godot 4.7 with the Compatibility renderer.

Ready-made: 24 Sci-Fi PBR Materials has 24 seamless sci-fi PBR materials as 2K PNG maps, plus a Godot 4 ready version with demo scenes already set up to reflect a sky.

More how-tos: Shaders, materials and lights