Increase detail of terrain geometry
This commit is contained in:
parent
9acfdcb16b
commit
a20c7ff70d
BIN
editor.scn (Stored with Git LFS)
BIN
editor.scn (Stored with Git LFS)
Binary file not shown.
|
@ -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
|
||||
|
||||
##
|
||||
##
|
||||
|
|
Loading…
Reference in New Issue