Increase detail of terrain geometry

This commit is contained in:
kayomn 2023-01-11 16:58:58 +00:00
parent 9acfdcb16b
commit a20c7ff70d
2 changed files with 7 additions and 5 deletions

BIN
editor.scn (Stored with Git LFS)

Binary file not shown.

View File

@ -1,6 +1,8 @@
@tool
class_name TerrainInstance3D extends GeometryInstance3D
const _DETAIL := 2
var _mesh := PlaneMesh.new()
var _material := ShaderMaterial.new()
@ -22,14 +24,14 @@ var size: Vector2i = Vector2i.ZERO:
RenderingServer.instance_set_base(self.get_instance(), RID())
else:
self._mesh.subdivide_width = width
self._mesh.subdivide_depth = height
self._mesh.subdivide_width = width * _DETAIL
self._mesh.subdivide_depth = height * _DETAIL
self._mesh.size = value
self._material.set_shader_parameter("SIZE", Vector2(value))
RenderingServer.instance_set_base(self.get_instance(), self._mesh)
size = Vector2i(width, height)
size = value
##
##