Editor Terrain Size Options #1
BIN
editor.scn (Stored with Git LFS)
BIN
editor.scn (Stored with Git LFS)
Binary file not shown.
|
@ -1,6 +1,8 @@
|
||||||
@tool
|
@tool
|
||||||
class_name TerrainInstance3D extends GeometryInstance3D
|
class_name TerrainInstance3D extends GeometryInstance3D
|
||||||
|
|
||||||
|
const _DETAIL := 2
|
||||||
|
|
||||||
var _mesh := PlaneMesh.new()
|
var _mesh := PlaneMesh.new()
|
||||||
|
|
||||||
var _material := ShaderMaterial.new()
|
var _material := ShaderMaterial.new()
|
||||||
|
@ -22,14 +24,14 @@ var size: Vector2i = Vector2i.ZERO:
|
||||||
RenderingServer.instance_set_base(self.get_instance(), RID())
|
RenderingServer.instance_set_base(self.get_instance(), RID())
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self._mesh.subdivide_width = width
|
self._mesh.subdivide_width = width * _DETAIL
|
||||||
self._mesh.subdivide_depth = height
|
self._mesh.subdivide_depth = height * _DETAIL
|
||||||
self._mesh.size = value
|
self._mesh.size = value
|
||||||
|
|
||||||
self._material.set_shader_parameter("SIZE", Vector2(value))
|
self._material.set_shader_parameter("SIZE", Vector2(value))
|
||||||
RenderingServer.instance_set_base(self.get_instance(), self._mesh)
|
RenderingServer.instance_set_base(self.get_instance(), self._mesh)
|
||||||
|
|
||||||
size = Vector2i(width, height)
|
size = value
|
||||||
|
|
||||||
##
|
##
|
||||||
##
|
##
|
||||||
|
|
Loading…
Reference in New Issue