GodotShade/heightmap.gd
Guillaume Vern a342f96089 init project
2025-10-07 16:20:44 +02:00

15 lines
436 B
GDScript

extends CollisionShape3D
func _ready():
print("loading heightmap...")
var heightmap_texture = ResourceLoader.load("res://Rolling Hills Height Map 1k/Rolling Hills Height Map.png")
var heightmap_image = heightmap_texture.get_image()
heightmap_image.convert(Image.FORMAT_RF)
shape = HeightMapShape3D.new()
var height_min = 0.0
var height_max = 100.0
shape.update_map_data_from_image(heightmap_image, height_min, height_max)