Fix washed-out look (inverted terrain normals via winding), tune lighting/fog, add tree+rock collision

This commit is contained in:
dev
2026-11-03 22:41:00 +00:00
parent edcac03c23
commit ac6f69ff96
5 changed files with 56 additions and 20 deletions

View File

@@ -57,8 +57,12 @@ func _build() -> void:
var p01 := Vector3(x0, sample_height(x0, z1), z1)
var p11 := Vector3(x1, sample_height(x1, z1), z1)
_add_tri(st, p00, p01, p11, half, uv_scale)
_add_tri(st, p00, p11, p10, half, uv_scale)
# Winding order chosen so generate_normals() produces UPWARD normals.
# (The reverse winding gave downward normals, so the sun lit the
# underside and the top surface rendered black — confirmed by an
# unshaded render showing the true bright-green albedo.)
_add_tri(st, p00, p11, p01, half, uv_scale)
_add_tri(st, p00, p10, p11, half, uv_scale)
st.generate_normals()
@@ -67,7 +71,7 @@ func _build() -> void:
mi.name = "TerrainMesh"
mi.mesh = mesh
var mat := StandardMaterial3D.new()
mat.albedo_color = Color(0.33, 0.45, 0.22) # mossy green
mat.albedo_color = Color(0.36, 0.47, 0.26) # mossy green (lit, not fluorescent)
mat.roughness = 0.95
mi.material_override = mat
add_child(mi)