178 lines
6.9 KiB
Plaintext
178 lines
6.9 KiB
Plaintext
[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"]
|
|
|
|
[sub_resource type="PointPrimitive" id="PointPrimitive_pxqd5"]
|
|
slope = -0.7
|
|
height = 0.0
|
|
|
|
[sub_resource type="PointPrimitive" id="PointPrimitive_ba0ut"]
|
|
blend_range = 10.0
|
|
center = Vector2(50, 0)
|
|
slope = -0.7
|
|
|
|
[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"]
|
|
fractal_type = 2
|
|
fractal_gain = 1.0
|
|
fractal_weighted_strength = 0.58
|
|
|
|
[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.2546, 0.27132, 0.38, 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 := 5.0
|
|
var rotating := false
|
|
var panning := false
|
|
var distance := 50
|
|
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 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
|
|
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
|
|
"
|
|
|
|
[node name="Editor" type="Node3D" unique_id=1027707839]
|
|
|
|
[node name="TerrainMeshEditor" type="TerrainMeshEditor" parent="." unique_id=1382595562]
|
|
primitives = [SubResource("PointPrimitive_pxqd5"), SubResource("PointPrimitive_ba0ut"), 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_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="TabContainer" type="TabContainer" parent="LeftPanel" unique_id=2095156888]
|
|
layout_mode = 1
|
|
anchors_preset = 15
|
|
anchor_right = 1.0
|
|
anchor_bottom = 1.0
|
|
grow_horizontal = 2
|
|
grow_vertical = 2
|
|
current_tab = 0
|
|
|
|
[node name="MarginContainer" type="MarginContainer" parent="LeftPanel/TabContainer" unique_id=1533578826]
|
|
layout_mode = 2
|
|
size_flags_horizontal = 3
|
|
size_flags_vertical = 3
|
|
metadata/_tab_index = 0
|
|
|
|
[node name="Tree" type="PrimitiveLayerList" parent="LeftPanel/TabContainer/MarginContainer" unique_id=797700186 node_paths=PackedStringArray("terrain")]
|
|
layout_mode = 2
|
|
columns = 4
|
|
drop_mode_flags = 2
|
|
select_mode = 1
|
|
terrain = NodePath("../../../../TerrainMeshEditor")
|
|
|
|
[connection signal="primitives_changed" from="TerrainMeshEditor" to="TerrainMeshEditor" method="_on_primitives_changed"]
|