[gd_scene format=3 uid="uid://xm383pc5pcnn"] [ext_resource type="PackedScene" uid="uid://cnux2fqne284i" path="res://objects/primitive_nodes/point_primitive_node.tscn" id="1_b1cmn"] [ext_resource type="PackedScene" uid="uid://wkqhvjnxs2mx" path="res://objects/terrain_chunk.tscn" id="1_pxqd5"] [ext_resource type="Theme" uid="uid://dh5hqcu3vyhrh" path="res://editor_theme.tres" id="3_ba0ut"] [ext_resource type="Texture2D" uid="uid://b8hetdn3d3ysr" path="res://assets/icons/point.svg" id="4_5lcyj"] [ext_resource type="Texture2D" uid="uid://bb0mnjwx58nt3" path="res://assets/icons/plus.svg" id="4_q68jb"] [ext_resource type="Texture2D" uid="uid://bl3gn6qruuy8w" path="res://assets/icons/plane.svg" id="4_xg7d5"] [ext_resource type="Texture2D" uid="uid://d1te42w7wpkrx" path="res://assets/icons/noise.svg" id="5_eqbpn"] [ext_resource type="PackedScene" uid="uid://bsvvhue5x4rb" path="res://ui/primitive_inspectors/point_primitive_inspector.tscn" id="8_5tm2q"] [sub_resource type="PointPrimitive" id="PointPrimitive_5tm2q"] [sub_resource type="FastNoiseLite" id="FastNoiseLite_pxqd5"] frequency = 0.015 fractal_octaves = 3 [sub_resource type="NoisePrimitive" id="NoisePrimitive_ba0ut"] blend_range = 5.0 noise = SubResource("FastNoiseLite_pxqd5") noise_amplitude = 20.0 [sub_resource type="FastNoiseLite" id="FastNoiseLite_b1cmn"] noise_type = 0 frequency = 0.03 fractal_type = 2 metadata/_preview_in_3d_space_ = true [sub_resource type="NoisePrimitive" id="NoisePrimitive_pxqd5"] blend_range = 10.0 noise = SubResource("FastNoiseLite_b1cmn") noise_amplitude = 5.0 [sub_resource type="FastNoiseLite" id="FastNoiseLite_ba0ut"] noise_type = 4 frequency = 0.588 fractal_gain = 1.0 fractal_weighted_strength = 1.0 [sub_resource type="NoisePrimitive" id="NoisePrimitive_q68jb"] blend_mode = 1 noise = SubResource("FastNoiseLite_ba0ut") [sub_resource type="PlanePrimitive" id="PlanePrimitive_ba0ut"] blend_range = 20.0 baseline = -1.0 [sub_resource type="Gradient" id="Gradient_b1cmn"] interpolation_mode = 2 interpolation_color_space = 2 offsets = PackedFloat32Array(0.0743595, 0.315422, 0.678597, 0.725377) colors = PackedColorArray(0.17652, 0.24, 0.0744, 1, 0.129706, 0.117486, 0.129714, 1, 0.216666, 0.201746, 0.216677, 1, 0.786852, 0.768096, 0.786791, 1) [sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_sldah"] sky_top_color = Color(0.22, 0.3575, 0.55, 1) sky_horizon_color = Color(0.662243, 0.671743, 0.686743, 1) ground_bottom_color = Color(0.167133, 0.2, 0.132, 1) ground_horizon_color = Color(0.662243, 0.671743, 0.686743, 1) [sub_resource type="Sky" id="Sky_b1cmn"] sky_material = SubResource("ProceduralSkyMaterial_sldah") [sub_resource type="Environment" id="Environment_pxqd5"] background_mode = 2 sky = SubResource("Sky_b1cmn") ambient_light_source = 2 ambient_light_color = Color(0.34313214, 0.36319032, 0.49935722, 1) tonemap_mode = 2 glow_enabled = true volumetric_fog_density = 0.0 volumetric_fog_emission_energy = 1024.0 volumetric_fog_length = 831.81 volumetric_fog_detail_spread = 0.5 volumetric_fog_sky_affect = 0.904 volumetric_fog_temporal_reprojection_amount = 0.99 [sub_resource type="GDScript" id="GDScript_b1cmn"] script/source = "extends Camera3D var pan_speed = .001 var rotate_speed := .0015 var zoom_speed := 2. var rotating := false var panning := false var distance := 200 var pivot := Vector3.ZERO func _ready(): global_position = global_position.normalized() * distance func _unhandled_input(event: InputEvent) -> void: if event is InputEventMouseButton and (event as InputEventMouseButton).button_index == MOUSE_BUTTON_RIGHT: get_viewport().set_input_as_handled() rotating = event.is_pressed() elif event is InputEventMouseButton and (event as InputEventMouseButton).button_index == MOUSE_BUTTON_MIDDLE: get_viewport().set_input_as_handled() panning = event.is_pressed() elif event is InputEventMouseMotion and rotating: get_viewport().set_input_as_handled() var motion := event as InputEventMouseMotion global_position += (global_basis.y * motion.screen_relative.y - global_basis.x * motion.screen_relative.x) * rotate_speed * distance look_at(pivot) global_position = (global_position - pivot).normalized() * distance + pivot elif event is InputEventMouseButton and (event as InputEventMouseButton).button_index == MOUSE_BUTTON_WHEEL_UP: get_viewport().set_input_as_handled() distance = max(1., distance - zoom_speed) global_position = (global_position - pivot).normalized() * distance + pivot elif event is InputEventMouseButton and (event as InputEventMouseButton).button_index == MOUSE_BUTTON_WHEEL_DOWN: get_viewport().set_input_as_handled() distance = min(1000., distance + zoom_speed) global_position = (global_position - pivot).normalized() * distance + pivot elif event is InputEventMouseMotion and panning: get_viewport().set_input_as_handled() var backward := Vector3(global_basis.z.x, 0.0, global_basis.z.z).normalized() var right := Vector3(global_basis.x.x, 0.0, global_basis.x.z).normalized() var motion := event as InputEventMouseMotion var translation = -(backward * motion.screen_relative.y + right * motion.screen_relative.x) * pan_speed * distance pivot += translation global_position += translation " [sub_resource type="CompressedTexture2D" id="CompressedTexture2D_xg7d5"] load_path = "res://.godot/imported/point.svg-e68fd7c1e788d2c48d769cc58eba6e98.ctex" [sub_resource type="PointPrimitive" id="PointPrimitive_5lcyj"] [sub_resource type="PlanePrimitive" id="PlanePrimitive_5lcyj"] [sub_resource type="NoisePrimitive" id="NoisePrimitive_5lcyj"] [node name="Editor" type="Node3D" unique_id=1027707839] [node name="TerrainMeshEditor" type="TerrainMeshEditor" parent="." unique_id=1382595562] primitives = [SubResource("PointPrimitive_5tm2q"), SubResource("NoisePrimitive_ba0ut"), SubResource("NoisePrimitive_pxqd5"), SubResource("NoisePrimitive_q68jb"), SubResource("PlanePrimitive_ba0ut")] vertex_color_gradient = SubResource("Gradient_b1cmn") color_gradient_end_height = 100.0 chunk_count = 8 chunk_scene = ExtResource("1_pxqd5") point_primitive_object = ExtResource("1_b1cmn") [node name="WorldEnvironment" type="WorldEnvironment" parent="." unique_id=1468550752] environment = SubResource("Environment_pxqd5") [node name="DirectionalLight3D" type="DirectionalLight3D" parent="." unique_id=978399107] transform = Transform3D(-0.750999, -0.305988, 0.585126, -1.29815e-08, 0.886147, 0.463404, -0.660305, 0.348015, -0.665494, 0, 0, 0) light_color = Color(0.89, 0.82948, 0.7387, 1) shadow_enabled = true shadow_reverse_cull_face = true directional_shadow_max_distance = 300.0 [node name="Camera3D" type="Camera3D" parent="." unique_id=376347830] transform = Transform3D(0.707107, -0.377082, 0.598171, 0, 0.845942, 0.533275, -0.707107, -0.377082, 0.598171, 504.544, 443.732, 504.544) fov = 57.3 far = 2000.0 script = SubResource("GDScript_b1cmn") [node name="LeftPanel" type="Panel" parent="." unique_id=1768834661] anchors_preset = 9 anchor_bottom = 1.0 offset_right = 258.0 grow_vertical = 2 theme = ExtResource("3_ba0ut") [node name="VBoxContainer" type="VBoxContainer" parent="LeftPanel" unique_id=1723457232] layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 [node name="Layers" type="TabContainer" parent="LeftPanel/VBoxContainer" unique_id=2095156888] layout_mode = 2 size_flags_vertical = 3 current_tab = 0 [node name="Layers" type="VBoxContainer" parent="LeftPanel/VBoxContainer/Layers" unique_id=138865385] layout_mode = 2 metadata/_tab_index = 0 [node name="HBoxContainer" type="HBoxContainer" parent="LeftPanel/VBoxContainer/Layers/Layers" unique_id=702489990] layout_mode = 2 size_flags_vertical = 8 [node name="TextureRect" type="TextureRect" parent="LeftPanel/VBoxContainer/Layers/Layers/HBoxContainer" unique_id=1669840346] custom_minimum_size = Vector2(32, 32) layout_mode = 2 texture = ExtResource("4_q68jb") expand_mode = 2 stretch_mode = 4 [node name="AddPointPrimitive" type="AddPrimitiveButton" parent="LeftPanel/VBoxContainer/Layers/Layers/HBoxContainer" unique_id=255935272 node_paths=PackedStringArray("terrain")] custom_minimum_size = Vector2(32, 32) layout_mode = 2 icon = SubResource("CompressedTexture2D_xg7d5") expand_icon = true primitive_blueprint = SubResource("PointPrimitive_5lcyj") terrain = NodePath("../../../../../../TerrainMeshEditor") [node name="AddPlanePrimitive" type="AddPrimitiveButton" parent="LeftPanel/VBoxContainer/Layers/Layers/HBoxContainer" unique_id=850669113 node_paths=PackedStringArray("terrain")] custom_minimum_size = Vector2(32, 32) layout_mode = 2 icon = ExtResource("4_xg7d5") expand_icon = true primitive_blueprint = SubResource("PlanePrimitive_5lcyj") terrain = NodePath("../../../../../../TerrainMeshEditor") [node name="AddNoisePrimitive" type="AddPrimitiveButton" parent="LeftPanel/VBoxContainer/Layers/Layers/HBoxContainer" unique_id=761062556 node_paths=PackedStringArray("terrain")] custom_minimum_size = Vector2(32, 32) layout_mode = 2 icon = ExtResource("5_eqbpn") expand_icon = true primitive_blueprint = SubResource("NoisePrimitive_5lcyj") terrain = NodePath("../../../../../../TerrainMeshEditor") [node name="Tree" type="PrimitiveLayerList" parent="LeftPanel/VBoxContainer/Layers/Layers" unique_id=797700186 node_paths=PackedStringArray("terrain")] layout_mode = 2 size_flags_vertical = 3 scroll_horizontal_enabled = false terrain = NodePath("../../../../../TerrainMeshEditor") icons = { &"NoisePrimitive": ExtResource("5_eqbpn"), &"PlanePrimitive": ExtResource("4_xg7d5"), &"PointPrimitive": ExtResource("4_5lcyj") } [node name="Inspector" type="LayerEditor" parent="LeftPanel/VBoxContainer" unique_id=833878161 node_paths=PackedStringArray("terrain")] layout_mode = 2 size_flags_vertical = 3 inspectors = { &"PointPrimitive": ExtResource("8_5tm2q") } terrain = NodePath("../../../TerrainMeshEditor") [connection signal="primitives_changed" from="TerrainMeshEditor" to="TerrainMeshEditor" method="_on_primitives_changed"]