Fix washed-out look (inverted terrain normals via winding), tune lighting/fog, add tree+rock collision
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user