built more assets and started playing with foliage painting
This commit is contained in:
42
demo/CodeGeneratedDemo.tscn
Normal file
42
demo/CodeGeneratedDemo.tscn
Normal file
@@ -0,0 +1,42 @@
|
||||
[gd_scene load_steps=8 format=3 uid="uid://cofnhdcclon1w"]
|
||||
|
||||
[ext_resource type="Script" path="res://demo/src/CodeGenerated.gd" id="1_h7vyv"]
|
||||
[ext_resource type="PackedScene" uid="uid://domhm87hbhbg1" path="res://demo/components/Player.tscn" id="2_3v2uf"]
|
||||
[ext_resource type="PackedScene" uid="uid://bb2lp50sjndus" path="res://demo/components/Environment.tscn" id="3_71ikj"]
|
||||
[ext_resource type="PackedScene" uid="uid://di5fovhcyd7re" path="res://demo/components/Enemy.tscn" id="4_p8qry"]
|
||||
[ext_resource type="PackedScene" uid="uid://d2jihfohphuue" path="res://demo/components/UI.tscn" id="4_x5ge4"]
|
||||
[ext_resource type="Script" path="res://demo/src/RuntimeNavigationBaker.gd" id="5_445ur"]
|
||||
|
||||
[sub_resource type="NavigationMesh" id="NavigationMesh_vs6am"]
|
||||
geometry_parsed_geometry_type = 1
|
||||
agent_height = 2.0
|
||||
agent_max_slope = 30.0
|
||||
|
||||
[node name="CodeGenerated" type="Node"]
|
||||
script = ExtResource("1_h7vyv")
|
||||
|
||||
[node name="Environment" parent="." instance=ExtResource("3_71ikj")]
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("2_3v2uf")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 50, 0)
|
||||
|
||||
[node name="Enemy" parent="." node_paths=PackedStringArray("target") instance=ExtResource("4_p8qry")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 10, 50, -10)
|
||||
target = NodePath("../Player")
|
||||
|
||||
[node name="UI" parent="." instance=ExtResource("4_x5ge4")]
|
||||
|
||||
[node name="RuntimeNavigationBaker" type="Node" parent="." node_paths=PackedStringArray("player")]
|
||||
script = ExtResource("5_445ur")
|
||||
enabled = false
|
||||
template = SubResource("NavigationMesh_vs6am")
|
||||
player = NodePath("../Player")
|
||||
|
||||
[node name="RunThisSceneLabel3D" type="Label3D" parent="."]
|
||||
pixel_size = 0.001
|
||||
billboard = 1
|
||||
no_depth_test = true
|
||||
fixed_size = true
|
||||
text = "Run This Scene"
|
||||
font_size = 64
|
||||
outline_size = 10
|
||||
89
demo/Demo.tscn
Normal file
89
demo/Demo.tscn
Normal file
@@ -0,0 +1,89 @@
|
||||
[gd_scene load_steps=12 format=3 uid="uid://chol2xlfbq7cu"]
|
||||
|
||||
[ext_resource type="Script" path="res://demo/src/DemoScene.gd" id="1_k7qca"]
|
||||
[ext_resource type="PackedScene" uid="uid://d2jihfohphuue" path="res://demo/components/UI.tscn" id="2_nqak5"]
|
||||
[ext_resource type="PackedScene" uid="uid://dwnhqfjq7v1pq" path="res://demo/components/Borders.tscn" id="3_cw38j"]
|
||||
[ext_resource type="PackedScene" uid="uid://domhm87hbhbg1" path="res://demo/components/Player.tscn" id="3_ht63y"]
|
||||
[ext_resource type="PackedScene" uid="uid://djhl3foqkj4e2" path="res://demo/components/Tunnel.tscn" id="3_kdh0b"]
|
||||
[ext_resource type="PackedScene" uid="uid://bb2lp50sjndus" path="res://demo/components/Environment.tscn" id="3_yqldq"]
|
||||
[ext_resource type="Terrain3DAssets" uid="uid://dal3jhw6241qg" path="res://demo/data/assets.tres" id="8_g2of2"]
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_vr1m7"]
|
||||
offsets = PackedFloat32Array(0.2, 1)
|
||||
colors = PackedColorArray(1, 1, 1, 1, 0, 0, 0, 1)
|
||||
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_d8lcj"]
|
||||
noise_type = 2
|
||||
frequency = 0.03
|
||||
cellular_jitter = 3.0
|
||||
cellular_return_type = 0
|
||||
domain_warp_enabled = true
|
||||
domain_warp_type = 1
|
||||
domain_warp_amplitude = 50.0
|
||||
domain_warp_fractal_type = 2
|
||||
domain_warp_fractal_lacunarity = 1.5
|
||||
domain_warp_fractal_gain = 1.0
|
||||
|
||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_bov7h"]
|
||||
seamless = true
|
||||
color_ramp = SubResource("Gradient_vr1m7")
|
||||
noise = SubResource("FastNoiseLite_d8lcj")
|
||||
|
||||
[sub_resource type="Terrain3DMaterial" id="Terrain3DMaterial_jrc01"]
|
||||
_shader_parameters = {
|
||||
"_mouse_layer": 2147483648,
|
||||
"auto_base_texture": 0,
|
||||
"auto_height_reduction": 0.1,
|
||||
"auto_overlay_texture": 1,
|
||||
"auto_slope": 1.0,
|
||||
"blend_sharpness": 0.87,
|
||||
"dual_scale_far": 170.0,
|
||||
"dual_scale_near": 100.0,
|
||||
"dual_scale_reduction": 0.3,
|
||||
"dual_scale_texture": 0,
|
||||
"height_blending": true,
|
||||
"macro_variation1": Color(0.878431, 0.862745, 0.901961, 1),
|
||||
"macro_variation2": Color(0.898039, 0.898039, 0.803922, 1),
|
||||
"noise1_angle": 0.1,
|
||||
"noise1_offset": Vector2(0.5, 0.5),
|
||||
"noise1_scale": 0.04,
|
||||
"noise2_scale": 0.076,
|
||||
"noise3_scale": 0.225,
|
||||
"noise_texture": SubResource("NoiseTexture2D_bov7h"),
|
||||
"tri_scale_reduction": 0.3,
|
||||
"vertex_normals_distance": 128.0,
|
||||
"world_noise_height": 34.0,
|
||||
"world_noise_lod_distance": 7500.0,
|
||||
"world_noise_max_octaves": 4,
|
||||
"world_noise_min_octaves": 2,
|
||||
"world_noise_offset": Vector3(2.17, -1.225, 1.9),
|
||||
"world_noise_region_blend": 0.33,
|
||||
"world_noise_scale": 9.85
|
||||
}
|
||||
world_background = 2
|
||||
auto_shader = true
|
||||
dual_scaling = true
|
||||
|
||||
[node name="Demo" type="Node"]
|
||||
script = ExtResource("1_k7qca")
|
||||
|
||||
[node name="UI" parent="." instance=ExtResource("2_nqak5")]
|
||||
|
||||
[node name="Environment" parent="." instance=ExtResource("3_yqldq")]
|
||||
|
||||
[node name="Borders" parent="." instance=ExtResource("3_cw38j")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 512, -3, 512)
|
||||
collision_mask = 3
|
||||
|
||||
[node name="Tunnel" parent="." instance=ExtResource("3_kdh0b")]
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("3_ht63y")]
|
||||
transform = Transform3D(0.176947, 0, -0.98422, 0, 1, 0, 0.98422, 0, 0.176947, 223.143, 105.348, -1833.08)
|
||||
|
||||
[node name="Terrain3D" type="Terrain3D" parent="."]
|
||||
data_directory = "res://demo/data"
|
||||
material = SubResource("Terrain3DMaterial_jrc01")
|
||||
assets = ExtResource("8_g2of2")
|
||||
collision_mask = 3
|
||||
top_level = true
|
||||
metadata/_edit_lock_ = true
|
||||
91
demo/NavigationDemo.tscn
Normal file
91
demo/NavigationDemo.tscn
Normal file
@@ -0,0 +1,91 @@
|
||||
[gd_scene load_steps=14 format=3 uid="uid://x34e4v60vdmy"]
|
||||
|
||||
[ext_resource type="Script" path="res://demo/src/DemoScene.gd" id="1_po4vw"]
|
||||
[ext_resource type="PackedScene" uid="uid://bb2lp50sjndus" path="res://demo/components/Environment.tscn" id="2_i74wg"]
|
||||
[ext_resource type="PackedScene" uid="uid://dwnhqfjq7v1pq" path="res://demo/components/Borders.tscn" id="3_3upu0"]
|
||||
[ext_resource type="PackedScene" uid="uid://domhm87hbhbg1" path="res://demo/components/Player.tscn" id="4_fk3ul"]
|
||||
[ext_resource type="PackedScene" uid="uid://djhl3foqkj4e2" path="res://demo/components/Tunnel.tscn" id="5_2lvlr"]
|
||||
[ext_resource type="PackedScene" uid="uid://d2jihfohphuue" path="res://demo/components/UI.tscn" id="5_rc7e2"]
|
||||
[ext_resource type="NavigationMesh" uid="uid://yf3fu23666k8" path="res://demo/data/nav_mesh.res" id="8_6jfdr"]
|
||||
[ext_resource type="Terrain3DAssets" uid="uid://dal3jhw6241qg" path="res://demo/data/assets.tres" id="10_qmhh8"]
|
||||
[ext_resource type="PackedScene" uid="uid://di5fovhcyd7re" path="res://demo/components/Enemy.tscn" id="12_b2xl8"]
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_vr1m7"]
|
||||
offsets = PackedFloat32Array(0.2, 1)
|
||||
colors = PackedColorArray(1, 1, 1, 1, 0, 0, 0, 1)
|
||||
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_d8lcj"]
|
||||
noise_type = 2
|
||||
frequency = 0.03
|
||||
cellular_jitter = 3.0
|
||||
cellular_return_type = 0
|
||||
domain_warp_enabled = true
|
||||
domain_warp_type = 1
|
||||
domain_warp_amplitude = 50.0
|
||||
domain_warp_fractal_type = 2
|
||||
domain_warp_fractal_lacunarity = 1.5
|
||||
domain_warp_fractal_gain = 1.0
|
||||
|
||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_bov7h"]
|
||||
seamless = true
|
||||
color_ramp = SubResource("Gradient_vr1m7")
|
||||
noise = SubResource("FastNoiseLite_d8lcj")
|
||||
|
||||
[sub_resource type="Terrain3DMaterial" id="Terrain3DMaterial_s5mq5"]
|
||||
_shader_parameters = {
|
||||
"_mouse_layer": 2147483648,
|
||||
"auto_base_texture": 0,
|
||||
"auto_height_reduction": 0.1,
|
||||
"auto_overlay_texture": 1,
|
||||
"auto_slope": 1.0,
|
||||
"blend_sharpness": 0.87,
|
||||
"dual_scale_far": 170.0,
|
||||
"dual_scale_near": 100.0,
|
||||
"dual_scale_reduction": 0.3,
|
||||
"dual_scale_texture": 0,
|
||||
"height_blending": true,
|
||||
"macro_variation1": Color(0.878431, 0.862745, 0.901961, 1),
|
||||
"macro_variation2": Color(0.898039, 0.898039, 0.803922, 1),
|
||||
"noise1_angle": 0.1,
|
||||
"noise1_offset": Vector2(0.5, 0.5),
|
||||
"noise1_scale": 0.04,
|
||||
"noise2_scale": 0.076,
|
||||
"noise3_scale": 0.225,
|
||||
"noise_texture": SubResource("NoiseTexture2D_bov7h"),
|
||||
"tri_scale_reduction": 0.3,
|
||||
"vertex_normals_distance": 128.0
|
||||
}
|
||||
world_background = 0
|
||||
auto_shader = true
|
||||
dual_scaling = true
|
||||
|
||||
[node name="Demo" type="Node"]
|
||||
script = ExtResource("1_po4vw")
|
||||
|
||||
[node name="UI" parent="." instance=ExtResource("5_rc7e2")]
|
||||
|
||||
[node name="Environment" parent="." instance=ExtResource("2_i74wg")]
|
||||
|
||||
[node name="Borders" parent="." instance=ExtResource("3_3upu0")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 512, -2.5, 512)
|
||||
|
||||
[node name="Tunnel" parent="." instance=ExtResource("5_2lvlr")]
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("4_fk3ul")]
|
||||
transform = Transform3D(0.0774673, 0, -0.996995, 0, 1, 0, 0.996995, 0, 0.0774673, 229.418, 104.956, -1838.16)
|
||||
|
||||
[node name="Enemy" parent="." node_paths=PackedStringArray("target") instance=ExtResource("12_b2xl8")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 192.727, 105.171, -1787.81)
|
||||
target = NodePath("../Player")
|
||||
|
||||
[node name="NavigationRegion3D" type="NavigationRegion3D" parent="."]
|
||||
navigation_mesh = ExtResource("8_6jfdr")
|
||||
|
||||
[node name="Terrain3D" type="Terrain3D" parent="NavigationRegion3D"]
|
||||
data_directory = "res://demo/data"
|
||||
material = SubResource("Terrain3DMaterial_s5mq5")
|
||||
assets = ExtResource("10_qmhh8")
|
||||
collision_mask = 3
|
||||
mesh_size = 64
|
||||
top_level = true
|
||||
metadata/_edit_lock_ = true
|
||||
27
demo/assets/materials/M_crystal_blue.tres
Normal file
27
demo/assets/materials/M_crystal_blue.tres
Normal file
@@ -0,0 +1,27 @@
|
||||
[gd_resource type="StandardMaterial3D" load_steps=3 format=3 uid="uid://fkhkir6t1hml"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://br7bfxcxh60df" path="res://demo/assets/textures/rock030_alb_ht.png" id="1_ahc02"]
|
||||
[ext_resource type="Texture2D" uid="uid://cr72kjil43vgj" path="res://demo/assets/textures/rock030_nrm_rgh.png" id="2_glxvb"]
|
||||
|
||||
[resource]
|
||||
transparency = 1
|
||||
vertex_color_use_as_albedo = true
|
||||
albedo_color = Color(0.4, 1, 1, 0.647059)
|
||||
metallic_specular = 1.0
|
||||
roughness = 0.2
|
||||
roughness_texture = ExtResource("2_glxvb")
|
||||
roughness_texture_channel = 3
|
||||
emission_enabled = true
|
||||
emission = Color(0, 0.145098, 0.776471, 1)
|
||||
emission_energy_multiplier = 1.4
|
||||
normal_enabled = true
|
||||
normal_scale = 0.4
|
||||
normal_texture = ExtResource("2_glxvb")
|
||||
rim_enabled = true
|
||||
rim = 0.25
|
||||
clearcoat_roughness = 0.0
|
||||
ao_light_affect = 1.0
|
||||
ao_texture = ExtResource("1_ahc02")
|
||||
ao_texture_channel = 3
|
||||
refraction_enabled = true
|
||||
refraction_scale = -0.1
|
||||
26
demo/assets/materials/M_crystal_purple.tres
Normal file
26
demo/assets/materials/M_crystal_purple.tres
Normal file
@@ -0,0 +1,26 @@
|
||||
[gd_resource type="StandardMaterial3D" load_steps=3 format=3 uid="uid://cso4f2iyuxpmc"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://br7bfxcxh60df" path="res://demo/assets/textures/rock030_alb_ht.png" id="1_uwd12"]
|
||||
[ext_resource type="Texture2D" uid="uid://cr72kjil43vgj" path="res://demo/assets/textures/rock030_nrm_rgh.png" id="2_0wyvn"]
|
||||
|
||||
[resource]
|
||||
transparency = 1
|
||||
vertex_color_use_as_albedo = true
|
||||
albedo_color = Color(0.4, 0.4, 1, 0.556863)
|
||||
metallic_specular = 1.0
|
||||
roughness = 0.2
|
||||
roughness_texture = ExtResource("2_0wyvn")
|
||||
roughness_texture_channel = 3
|
||||
emission_enabled = true
|
||||
emission = Color(0.235294, 0.145098, 0.776471, 1)
|
||||
normal_enabled = true
|
||||
normal_scale = 0.4
|
||||
normal_texture = ExtResource("2_0wyvn")
|
||||
rim_enabled = true
|
||||
rim = 0.25
|
||||
clearcoat_roughness = 0.0
|
||||
ao_light_affect = 1.0
|
||||
ao_texture = ExtResource("1_uwd12")
|
||||
ao_texture_channel = 3
|
||||
refraction_enabled = true
|
||||
refraction_scale = -0.1
|
||||
14
demo/assets/materials/M_rock30.tres
Normal file
14
demo/assets/materials/M_rock30.tres
Normal file
@@ -0,0 +1,14 @@
|
||||
[gd_resource type="StandardMaterial3D" load_steps=3 format=3 uid="uid://dlmtxs0c66hj3"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://br7bfxcxh60df" path="res://demo/assets/textures/rock030_alb_ht.png" id="1_j5sdo"]
|
||||
[ext_resource type="Texture2D" uid="uid://cr72kjil43vgj" path="res://demo/assets/textures/rock030_nrm_rgh.png" id="2_yyurh"]
|
||||
|
||||
[resource]
|
||||
vertex_color_use_as_albedo = true
|
||||
albedo_color = Color(1.351, 1.321, 1.27, 1)
|
||||
albedo_texture = ExtResource("1_j5sdo")
|
||||
normal_enabled = true
|
||||
normal_texture = ExtResource("2_yyurh")
|
||||
uv1_scale = Vector3(4, 4, 4)
|
||||
uv1_triplanar_sharpness = 6.06286
|
||||
texture_filter = 5
|
||||
15
demo/assets/materials/M_rock30_tp.tres
Normal file
15
demo/assets/materials/M_rock30_tp.tres
Normal file
@@ -0,0 +1,15 @@
|
||||
[gd_resource type="StandardMaterial3D" load_steps=3 format=3 uid="uid://dkvsksxpkl1vj"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://br7bfxcxh60df" path="res://demo/assets/textures/rock030_alb_ht.png" id="1_j5sdo"]
|
||||
[ext_resource type="Texture2D" uid="uid://cr72kjil43vgj" path="res://demo/assets/textures/rock030_nrm_rgh.png" id="2_yyurh"]
|
||||
|
||||
[resource]
|
||||
vertex_color_use_as_albedo = true
|
||||
albedo_color = Color(1.351, 1.321, 1.27, 1)
|
||||
albedo_texture = ExtResource("1_j5sdo")
|
||||
normal_enabled = true
|
||||
normal_texture = ExtResource("2_yyurh")
|
||||
uv1_scale = Vector3(0.04, 0.04, 0.04)
|
||||
uv1_triplanar = true
|
||||
uv1_triplanar_sharpness = 6.06286
|
||||
texture_filter = 5
|
||||
16
demo/assets/models/CrystalC.tscn
Normal file
16
demo/assets/models/CrystalC.tscn
Normal file
File diff suppressed because one or more lines are too long
BIN
demo/assets/models/RockA.glb
Normal file
BIN
demo/assets/models/RockA.glb
Normal file
Binary file not shown.
43
demo/assets/models/RockA.glb.import
Normal file
43
demo/assets/models/RockA.glb.import
Normal file
@@ -0,0 +1,43 @@
|
||||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://bxwiqxgwoh630"
|
||||
path="res://.godot/imported/RockA.glb-2e416adf16cd89c5c5afc8e204027147.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://demo/assets/models/RockA.glb"
|
||||
dest_files=["res://.godot/imported/RockA.glb-2e416adf16cd89c5c5afc8e204027147.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type="StaticBody3D"
|
||||
nodes/root_name="Scene Root"
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
nodes/import_as_skeleton_bones=false
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
meshes/force_disable_compression=false
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
animation/import_rest_as_RESET=false
|
||||
import_script/path=""
|
||||
_subresources={
|
||||
"materials": {
|
||||
"@MATERIAL:0": {
|
||||
"use_external/enabled": true,
|
||||
"use_external/path": "res://demo/assets/materials/M_rock30.tres"
|
||||
}
|
||||
}
|
||||
}
|
||||
gltf/naming_version=0
|
||||
gltf/embedded_image_handling=1
|
||||
16
demo/assets/models/RockA.tscn
Normal file
16
demo/assets/models/RockA.tscn
Normal file
File diff suppressed because one or more lines are too long
BIN
demo/assets/models/RockB.glb
Normal file
BIN
demo/assets/models/RockB.glb
Normal file
Binary file not shown.
43
demo/assets/models/RockB.glb.import
Normal file
43
demo/assets/models/RockB.glb.import
Normal file
@@ -0,0 +1,43 @@
|
||||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://nta3sef6c2el"
|
||||
path="res://.godot/imported/RockB.glb-d0df90244ab14da61106a961f4faa07f.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://demo/assets/models/RockB.glb"
|
||||
dest_files=["res://.godot/imported/RockB.glb-d0df90244ab14da61106a961f4faa07f.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type="StaticBody3D"
|
||||
nodes/root_name="Scene Root"
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
nodes/import_as_skeleton_bones=false
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
meshes/force_disable_compression=false
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
animation/import_rest_as_RESET=false
|
||||
import_script/path=""
|
||||
_subresources={
|
||||
"materials": {
|
||||
"@MATERIAL:0": {
|
||||
"use_external/enabled": true,
|
||||
"use_external/path": "res://demo/assets/materials/M_rock30.tres"
|
||||
}
|
||||
}
|
||||
}
|
||||
gltf/naming_version=0
|
||||
gltf/embedded_image_handling=1
|
||||
16
demo/assets/models/RockB.tscn
Normal file
16
demo/assets/models/RockB.tscn
Normal file
File diff suppressed because one or more lines are too long
BIN
demo/assets/models/RockC.glb
Normal file
BIN
demo/assets/models/RockC.glb
Normal file
Binary file not shown.
43
demo/assets/models/RockC.glb.import
Normal file
43
demo/assets/models/RockC.glb.import
Normal file
@@ -0,0 +1,43 @@
|
||||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://c8cx4xjwluvxw"
|
||||
path="res://.godot/imported/RockC.glb-5881ee1ff2072066a3de122ce4239bee.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://demo/assets/models/RockC.glb"
|
||||
dest_files=["res://.godot/imported/RockC.glb-5881ee1ff2072066a3de122ce4239bee.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type="StaticBody3D"
|
||||
nodes/root_name="Scene Root"
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
nodes/import_as_skeleton_bones=false
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
meshes/force_disable_compression=false
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
animation/import_rest_as_RESET=false
|
||||
import_script/path=""
|
||||
_subresources={
|
||||
"materials": {
|
||||
"@MATERIAL:0": {
|
||||
"use_external/enabled": true,
|
||||
"use_external/path": "res://demo/assets/materials/M_rock30.tres"
|
||||
}
|
||||
}
|
||||
}
|
||||
gltf/naming_version=0
|
||||
gltf/embedded_image_handling=1
|
||||
16
demo/assets/models/RockC.tscn
Normal file
16
demo/assets/models/RockC.tscn
Normal file
File diff suppressed because one or more lines are too long
BIN
demo/assets/models/Tunnel.glb
Normal file
BIN
demo/assets/models/Tunnel.glb
Normal file
Binary file not shown.
43
demo/assets/models/Tunnel.glb.import
Normal file
43
demo/assets/models/Tunnel.glb.import
Normal file
@@ -0,0 +1,43 @@
|
||||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://jib546bbort5"
|
||||
path="res://.godot/imported/Tunnel.glb-09729773791c3078e933c866961e1b60.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://demo/assets/models/Tunnel.glb"
|
||||
dest_files=["res://.godot/imported/Tunnel.glb-09729773791c3078e933c866961e1b60.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type="StaticBody3D"
|
||||
nodes/root_name="Scene Root"
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
nodes/import_as_skeleton_bones=false
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
meshes/force_disable_compression=true
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
animation/import_rest_as_RESET=false
|
||||
import_script/path=""
|
||||
_subresources={
|
||||
"materials": {
|
||||
"material_0": {
|
||||
"use_external/enabled": true,
|
||||
"use_external/path": "res://demo/assets/materials/M_rock30_tp.tres"
|
||||
}
|
||||
}
|
||||
}
|
||||
gltf/naming_version=0
|
||||
gltf/embedded_image_handling=1
|
||||
12
demo/assets/models/Tunnel.tscn
Normal file
12
demo/assets/models/Tunnel.tscn
Normal file
File diff suppressed because one or more lines are too long
9
demo/assets/textures/asset_licenses.txt
Normal file
9
demo/assets/textures/asset_licenses.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
All ambientCG assets are provided under the
|
||||
Creative Commons CC0 1.0 Universal License.
|
||||
https://docs.ambientcg.com/license/
|
||||
|
||||
Grass:
|
||||
https://ambientcg.com/view?id=Ground037
|
||||
|
||||
Rock:
|
||||
https://ambientcg.com/view?id=Rock030
|
||||
BIN
demo/assets/textures/ground037_alb_ht.png
Normal file
BIN
demo/assets/textures/ground037_alb_ht.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.1 MiB |
35
demo/assets/textures/ground037_alb_ht.png.import
Normal file
35
demo/assets/textures/ground037_alb_ht.png.import
Normal file
@@ -0,0 +1,35 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://ddprscrpsofah"
|
||||
path.bptc="res://.godot/imported/ground037_alb_ht.png-d854c3c88beba9927351b95063edffa2.bptc.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://demo/assets/textures/ground037_alb_ht.png"
|
||||
dest_files=["res://.godot/imported/ground037_alb_ht.png-d854c3c88beba9927351b95063edffa2.bptc.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=2
|
||||
compress/high_quality=true
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=2
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
BIN
demo/assets/textures/ground037_nrm_rgh.png
Normal file
BIN
demo/assets/textures/ground037_nrm_rgh.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.1 MiB |
35
demo/assets/textures/ground037_nrm_rgh.png.import
Normal file
35
demo/assets/textures/ground037_nrm_rgh.png.import
Normal file
@@ -0,0 +1,35 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://c1ots7w6i0i1q"
|
||||
path.bptc="res://.godot/imported/ground037_nrm_rgh.png-02372c72ee87f1844ee708d952e43e96.bptc.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://demo/assets/textures/ground037_nrm_rgh.png"
|
||||
dest_files=["res://.godot/imported/ground037_nrm_rgh.png-02372c72ee87f1844ee708d952e43e96.bptc.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=2
|
||||
compress/high_quality=true
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=2
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
BIN
demo/assets/textures/rock030_alb_ht.png
Normal file
BIN
demo/assets/textures/rock030_alb_ht.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 MiB |
35
demo/assets/textures/rock030_alb_ht.png.import
Normal file
35
demo/assets/textures/rock030_alb_ht.png.import
Normal file
@@ -0,0 +1,35 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://br7bfxcxh60df"
|
||||
path.bptc="res://.godot/imported/rock030_alb_ht.png-b99cd41791a717b81a9364ed61908c19.bptc.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://demo/assets/textures/rock030_alb_ht.png"
|
||||
dest_files=["res://.godot/imported/rock030_alb_ht.png-b99cd41791a717b81a9364ed61908c19.bptc.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=2
|
||||
compress/high_quality=true
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=2
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=0
|
||||
BIN
demo/assets/textures/rock030_nrm_rgh.png
Normal file
BIN
demo/assets/textures/rock030_nrm_rgh.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.1 MiB |
35
demo/assets/textures/rock030_nrm_rgh.png.import
Normal file
35
demo/assets/textures/rock030_nrm_rgh.png.import
Normal file
@@ -0,0 +1,35 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cr72kjil43vgj"
|
||||
path.bptc="res://.godot/imported/rock030_nrm_rgh.png-2cdb7838da06bcbe8c41800e68b36b1b.bptc.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://demo/assets/textures/rock030_nrm_rgh.png"
|
||||
dest_files=["res://.godot/imported/rock030_nrm_rgh.png-2cdb7838da06bcbe8c41800e68b36b1b.bptc.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=2
|
||||
compress/high_quality=true
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=2
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=0
|
||||
69
demo/components/Borders.tscn
Normal file
69
demo/components/Borders.tscn
Normal file
@@ -0,0 +1,69 @@
|
||||
[gd_scene load_steps=8 format=3 uid="uid://dwnhqfjq7v1pq"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://cr72kjil43vgj" path="res://demo/assets/textures/rock030_nrm_rgh.png" id="1_nf248"]
|
||||
[ext_resource type="Texture2D" uid="uid://br7bfxcxh60df" path="res://demo/assets/textures/rock030_alb_ht.png" id="1_t4onm"]
|
||||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_1kfaq"]
|
||||
size = Vector3(1025.01, 4, 1)
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_6nmqq"]
|
||||
albedo_color = Color(0.670588, 0.670588, 0.670588, 1)
|
||||
albedo_texture = ExtResource("1_t4onm")
|
||||
roughness_texture = ExtResource("1_nf248")
|
||||
roughness_texture_channel = 3
|
||||
normal_enabled = true
|
||||
normal_texture = ExtResource("1_nf248")
|
||||
uv1_scale = Vector3(0.4, 0.4, 0.4)
|
||||
uv1_triplanar = true
|
||||
texture_filter = 5
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_s0c8u"]
|
||||
size = Vector3(1025, 100, 1)
|
||||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_kfxc8"]
|
||||
size = Vector3(3072, 4, 1)
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_pyqb2"]
|
||||
size = Vector3(1, 100, 3072)
|
||||
|
||||
[node name="Borders" type="StaticBody3D"]
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 512)
|
||||
mesh = SubResource("BoxMesh_1kfaq")
|
||||
skeleton = NodePath("../..")
|
||||
surface_material_override/0 = SubResource("StandardMaterial3D_6nmqq")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 50, 512)
|
||||
shape = SubResource("BoxShape3D_s0c8u")
|
||||
|
||||
[node name="MeshInstance3D2" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, -2560)
|
||||
mesh = SubResource("BoxMesh_1kfaq")
|
||||
skeleton = NodePath("../..")
|
||||
surface_material_override/0 = SubResource("StandardMaterial3D_6nmqq")
|
||||
|
||||
[node name="CollisionShape3D2" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 50, -2560)
|
||||
shape = SubResource("BoxShape3D_s0c8u")
|
||||
|
||||
[node name="MeshInstance3D3" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 512, 2, -1024)
|
||||
mesh = SubResource("BoxMesh_kfxc8")
|
||||
skeleton = NodePath("../..")
|
||||
surface_material_override/0 = SubResource("StandardMaterial3D_6nmqq")
|
||||
|
||||
[node name="CollisionShape3D3" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 512, 50, -1024)
|
||||
shape = SubResource("BoxShape3D_pyqb2")
|
||||
|
||||
[node name="MeshInstance3D4" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -512, 2, -1024)
|
||||
mesh = SubResource("BoxMesh_kfxc8")
|
||||
skeleton = NodePath("../..")
|
||||
surface_material_override/0 = SubResource("StandardMaterial3D_6nmqq")
|
||||
|
||||
[node name="CollisionShape3D4" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -512, 50, -1024)
|
||||
shape = SubResource("BoxShape3D_pyqb2")
|
||||
66
demo/components/DemoBase.tscn
Normal file
66
demo/components/DemoBase.tscn
Normal file
@@ -0,0 +1,66 @@
|
||||
[gd_scene load_steps=11 format=3 uid="uid://dyt8c2xqmddo2"]
|
||||
|
||||
[ext_resource type="Script" path="res://demo/src/DemoScene.gd" id="1_k7qca"]
|
||||
[ext_resource type="PackedScene" uid="uid://bb2lp50sjndus" path="res://demo/components/Environment.tscn" id="2_2yeq8"]
|
||||
[ext_resource type="PackedScene" uid="uid://dwnhqfjq7v1pq" path="res://demo/components/Borders.tscn" id="3_cw38j"]
|
||||
[ext_resource type="PackedScene" uid="uid://domhm87hbhbg1" path="res://demo/components/Player.tscn" id="3_ht63y"]
|
||||
[ext_resource type="PackedScene" uid="uid://d2jihfohphuue" path="res://demo/components/UI.tscn" id="4_gk532"]
|
||||
[ext_resource type="Terrain3DAssets" uid="uid://dal3jhw6241qg" path="res://demo/data/assets.tres" id="7_mnexy"]
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_vs32v"]
|
||||
offsets = PackedFloat32Array(0.3, 1)
|
||||
colors = PackedColorArray(1, 1, 1, 1, 0, 0, 0, 1)
|
||||
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_7glc1"]
|
||||
noise_type = 2
|
||||
frequency = 0.03
|
||||
cellular_jitter = 3.0
|
||||
cellular_return_type = 0
|
||||
domain_warp_enabled = true
|
||||
domain_warp_type = 1
|
||||
domain_warp_amplitude = 50.0
|
||||
domain_warp_fractal_type = 2
|
||||
domain_warp_fractal_lacunarity = 1.5
|
||||
domain_warp_fractal_gain = 1.0
|
||||
|
||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_pvx8q"]
|
||||
seamless = true
|
||||
color_ramp = SubResource("Gradient_vs32v")
|
||||
noise = SubResource("FastNoiseLite_7glc1")
|
||||
|
||||
[sub_resource type="Terrain3DMaterial" id="Terrain3DMaterial_q2wt2"]
|
||||
_shader_parameters = {
|
||||
"_mouse_layer": 2147483648,
|
||||
"blend_sharpness": 0.87,
|
||||
"height_blending": true,
|
||||
"macro_variation1": Color(1, 1, 1, 1),
|
||||
"macro_variation2": Color(1, 1, 1, 1),
|
||||
"noise1_angle": 0.0,
|
||||
"noise1_offset": Vector2(0.5, 0.5),
|
||||
"noise1_scale": 0.05,
|
||||
"noise2_scale": 0.03,
|
||||
"noise3_scale": 0.01,
|
||||
"noise_texture": SubResource("NoiseTexture2D_pvx8q"),
|
||||
"vertex_normals_distance": 128.0
|
||||
}
|
||||
|
||||
[node name="Demo" type="Node"]
|
||||
script = ExtResource("1_k7qca")
|
||||
|
||||
[node name="UI" parent="." instance=ExtResource("4_gk532")]
|
||||
|
||||
[node name="World" parent="." instance=ExtResource("2_2yeq8")]
|
||||
|
||||
[node name="Borders" parent="." instance=ExtResource("3_cw38j")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 512, 0, 512)
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("3_ht63y")]
|
||||
transform = Transform3D(0.134125, 0, -0.990965, 0, 1, 0, 0.990965, 0, 0.134125, 568, 85, -1926)
|
||||
|
||||
[node name="Terrain3D" type="Terrain3D" parent="."]
|
||||
data_directory = "res://demo/data"
|
||||
material = SubResource("Terrain3DMaterial_q2wt2")
|
||||
assets = ExtResource("7_mnexy")
|
||||
collision_mask = 3
|
||||
top_level = true
|
||||
metadata/_edit_lock_ = true
|
||||
34
demo/components/Enemy.tscn
Normal file
34
demo/components/Enemy.tscn
Normal file
@@ -0,0 +1,34 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://di5fovhcyd7re"]
|
||||
|
||||
[ext_resource type="Script" path="res://demo/src/Enemy.gd" id="1_yudyn"]
|
||||
|
||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_lwhhq"]
|
||||
height = 1.5
|
||||
|
||||
[sub_resource type="SeparationRayShape3D" id="SeparationRayShape3D_i8f01"]
|
||||
|
||||
[sub_resource type="CapsuleMesh" id="CapsuleMesh_lsqiy"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_d4cor"]
|
||||
albedo_color = Color(1, 0, 0, 1)
|
||||
|
||||
[node name="Enemy" type="CharacterBody3D"]
|
||||
collision_layer = 2
|
||||
script = ExtResource("1_yudyn")
|
||||
|
||||
[node name="CollisionShapeBody" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.25, 0)
|
||||
shape = SubResource("CapsuleShape3D_lwhhq")
|
||||
|
||||
[node name="CollisionShapeRay" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 1, 0)
|
||||
shape = SubResource("SeparationRayShape3D_i8f01")
|
||||
|
||||
[node name="Body" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||
mesh = SubResource("CapsuleMesh_lsqiy")
|
||||
surface_material_override/0 = SubResource("StandardMaterial3D_d4cor")
|
||||
|
||||
[node name="NavigationAgent3D" type="NavigationAgent3D" parent="."]
|
||||
path_desired_distance = 2.0
|
||||
debug_enabled = true
|
||||
34
demo/components/Environment.tscn
Normal file
34
demo/components/Environment.tscn
Normal file
@@ -0,0 +1,34 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://bb2lp50sjndus"]
|
||||
|
||||
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_vibap"]
|
||||
sky_top_color = Color(0.192157, 0.282353, 0.509804, 1)
|
||||
sky_horizon_color = Color(0.505882, 0.615686, 0.709804, 1)
|
||||
ground_bottom_color = Color(0.211765, 0.313726, 0.552941, 1)
|
||||
ground_horizon_color = Color(0.505882, 0.615686, 0.709804, 1)
|
||||
ground_curve = 0.13
|
||||
|
||||
[sub_resource type="Sky" id="Sky_srg7c"]
|
||||
sky_material = SubResource("ProceduralSkyMaterial_vibap")
|
||||
|
||||
[sub_resource type="Environment" id="Environment_8jcgm"]
|
||||
background_mode = 2
|
||||
sky = SubResource("Sky_srg7c")
|
||||
ambient_light_source = 3
|
||||
ambient_light_color = Color(0.55, 0.55, 0.55, 1)
|
||||
ambient_light_sky_contribution = 0.3
|
||||
tonemap_mode = 3
|
||||
|
||||
[sub_resource type="CameraAttributesPractical" id="CameraAttributesPractical_0gcl0"]
|
||||
|
||||
[node name="Environment" type="Node3D"]
|
||||
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||
environment = SubResource("Environment_8jcgm")
|
||||
camera_attributes = SubResource("CameraAttributesPractical_0gcl0")
|
||||
|
||||
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
|
||||
transform = Transform3D(-0.866024, -0.433016, 0.250001, 0, 0.499998, 0.866026, -0.500003, 0.749999, -0.43301, 0, 0, 0)
|
||||
shadow_enabled = true
|
||||
shadow_blur = 2.0
|
||||
directional_shadow_blend_splits = true
|
||||
directional_shadow_max_distance = 256.0
|
||||
44
demo/components/Player.tscn
Normal file
44
demo/components/Player.tscn
Normal file
@@ -0,0 +1,44 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://domhm87hbhbg1"]
|
||||
|
||||
[ext_resource type="Script" path="res://demo/src/Player.gd" id="1_nm1yx"]
|
||||
[ext_resource type="Script" path="res://demo/src/CameraManager.gd" id="2_loos7"]
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_smq6u"]
|
||||
|
||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_lwhhq"]
|
||||
height = 1.5
|
||||
|
||||
[sub_resource type="SeparationRayShape3D" id="SeparationRayShape3D_twc2s"]
|
||||
|
||||
[sub_resource type="CapsuleMesh" id="CapsuleMesh_lsqiy"]
|
||||
|
||||
[node name="Player" type="CharacterBody3D"]
|
||||
collision_layer = 2
|
||||
script = ExtResource("1_nm1yx")
|
||||
|
||||
[node name="CameraManager" type="Node3D" parent="."]
|
||||
script = ExtResource("2_loos7")
|
||||
|
||||
[node name="Arm" type="SpringArm3D" parent="CameraManager"]
|
||||
unique_name_in_owner = true
|
||||
transform = Transform3D(1, 0, 0, 0, 0.906308, 0.422618, 0, -0.422618, 0.906308, 0, 2.32515, -0.0321627)
|
||||
shape = SubResource("SphereShape3D_smq6u")
|
||||
spring_length = 6.0
|
||||
margin = 0.5
|
||||
|
||||
[node name="Camera3D" type="Camera3D" parent="CameraManager/Arm"]
|
||||
unique_name_in_owner = true
|
||||
near = 0.25
|
||||
far = 16384.0
|
||||
|
||||
[node name="CollisionShapeBody" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.25, 0)
|
||||
shape = SubResource("CapsuleShape3D_lwhhq")
|
||||
|
||||
[node name="CollisionShapeRay" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 1, 0)
|
||||
shape = SubResource("SeparationRayShape3D_twc2s")
|
||||
|
||||
[node name="Body" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||
mesh = SubResource("CapsuleMesh_lsqiy")
|
||||
189
demo/components/Tunnel.tscn
Normal file
189
demo/components/Tunnel.tscn
Normal file
@@ -0,0 +1,189 @@
|
||||
[gd_scene load_steps=12 format=3 uid="uid://djhl3foqkj4e2"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://be6nrf0b8j4l0" path="res://demo/assets/models/RockA.tscn" id="1_m1xck"]
|
||||
[ext_resource type="PackedScene" uid="uid://bwvtgwartxt0g" path="res://demo/assets/models/RockB.tscn" id="2_hybky"]
|
||||
[ext_resource type="PackedScene" uid="uid://lsvs8a7urkca" path="res://demo/assets/models/RockC.tscn" id="3_nbn1a"]
|
||||
[ext_resource type="PackedScene" uid="uid://vvayjv3rbx1d" path="res://demo/assets/models/Tunnel.tscn" id="4_klbpo"]
|
||||
[ext_resource type="PackedScene" uid="uid://cribhhvg03u8g" path="res://demo/assets/models/CrystalC.tscn" id="5_bb2w0"]
|
||||
[ext_resource type="Material" uid="uid://cso4f2iyuxpmc" path="res://demo/assets/materials/M_crystal_purple.tres" id="6_s6twx"]
|
||||
[ext_resource type="Texture2D" uid="uid://br7bfxcxh60df" path="res://demo/assets/textures/rock030_alb_ht.png" id="7_pqaf8"]
|
||||
[ext_resource type="Texture2D" uid="uid://cr72kjil43vgj" path="res://demo/assets/textures/rock030_nrm_rgh.png" id="8_hh7se"]
|
||||
[ext_resource type="Script" path="res://demo/src/CaveEntrance.gd" id="9_fn2ke"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_0v0nf"]
|
||||
transparency = 1
|
||||
albedo_color = Color(0.670588, 0.0588235, 0.384314, 0.509804)
|
||||
metallic_specular = 1.0
|
||||
roughness = 0.2
|
||||
roughness_texture = ExtResource("8_hh7se")
|
||||
roughness_texture_channel = 3
|
||||
emission_enabled = true
|
||||
emission = Color(0.258824, 0.0823529, 0.25098, 1)
|
||||
normal_enabled = true
|
||||
normal_scale = 0.4
|
||||
normal_texture = ExtResource("8_hh7se")
|
||||
rim_enabled = true
|
||||
rim = 0.25
|
||||
clearcoat_roughness = 0.0
|
||||
ao_light_affect = 1.0
|
||||
ao_texture = ExtResource("7_pqaf8")
|
||||
ao_texture_channel = 3
|
||||
refraction_enabled = true
|
||||
refraction_scale = -0.1
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_goiy4"]
|
||||
size = Vector3(530.482, 38.6343, 235.603)
|
||||
|
||||
[node name="Tunnel" type="Node3D"]
|
||||
|
||||
[node name="EntranceL" type="Node3D" parent="."]
|
||||
|
||||
[node name="RockA1" parent="EntranceL" instance=ExtResource("1_m1xck")]
|
||||
transform = Transform3D(5.82988, -5.4374, -4.00004, 6.04396, 6.55839, -0.106264, 3.00604, -2.64109, 7.9713, 807.937, 137.298, 467.411)
|
||||
|
||||
[node name="RockA2" parent="EntranceL" instance=ExtResource("1_m1xck")]
|
||||
transform = Transform3D(4.67905, 4.22076, -5.5926, 6.98724, -3.31022, 3.34764, -0.52024, -6.49718, -5.3387, 766.019, 104.95, 452.605)
|
||||
|
||||
[node name="RockA3" parent="EntranceL" instance=ExtResource("1_m1xck")]
|
||||
transform = Transform3D(1.19782, 11.0889, 4.42738, -11.9291, 0.921057, 0.9205, 0.510788, -4.49312, 11.1153, 793.166, 76.9378, 454.834)
|
||||
|
||||
[node name="RockB1" parent="EntranceL" instance=ExtResource("2_hybky")]
|
||||
transform = Transform3D(-2.10522, -4.25988, 3.15298, 3.05166, -3.74811, -3.02637, 4.33304, 0.570028, 3.66329, 824.574, 112.54, 446.946)
|
||||
|
||||
[node name="RockB3" parent="EntranceL" instance=ExtResource("2_hybky")]
|
||||
transform = Transform3D(4.29222, 4.57142, 1.24961, -2.49948, 3.61605, -4.6432, -4.02641, 2.62846, 4.21447, 773.937, 140.911, 469.972)
|
||||
|
||||
[node name="RockC1" parent="EntranceL" instance=ExtResource("3_nbn1a")]
|
||||
transform = Transform3D(-1.86839, -3.85072, -1.99813, -0.0474326, -2.1573, 4.20181, -4.33801, 1.6821, 0.814656, 786.081, 135.376, 453.531)
|
||||
|
||||
[node name="RockC2" parent="EntranceL" instance=ExtResource("3_nbn1a")]
|
||||
transform = Transform3D(-3.90856, -4.56077, 3.35866, 3.81036, 0.902037, 5.65911, -4.19074, 5.07383, 2.01294, 791.859, 164.408, 508.107)
|
||||
|
||||
[node name="EntranceR" type="Node3D" parent="."]
|
||||
|
||||
[node name="RockA1" parent="EntranceR" instance=ExtResource("1_m1xck")]
|
||||
transform = Transform3D(-0.271255, 1.28607, -2.97471, -1.25761, 2.70942, 1.28605, 2.98685, 1.25759, 0.271335, 299.644, 127.203, 424.309)
|
||||
|
||||
[node name="RockA2" parent="EntranceR" instance=ExtResource("1_m1xck")]
|
||||
transform = Transform3D(2.29164, -2.44454, 3.0731, 3.84134, 0.657286, -2.34167, 0.814771, 3.77671, 2.39666, 318.179, 95.8599, 421.731)
|
||||
|
||||
[node name="RockA5" parent="EntranceR" instance=ExtResource("1_m1xck")]
|
||||
transform = Transform3D(1.09929, -4.37397, 0.575562, 3.84134, 0.657286, -2.34167, 2.16957, 1.05247, 3.85443, 321.814, 95.8599, 436.931)
|
||||
|
||||
[node name="RockA3" parent="EntranceR" instance=ExtResource("1_m1xck")]
|
||||
transform = Transform3D(3.70822, 1.86229, 1.85804, 2.19079, -0.408409, -3.96295, -1.45634, 4.12752, -1.23046, 338.177, 116.66, 430.367)
|
||||
|
||||
[node name="RockA4" parent="EntranceR" instance=ExtResource("1_m1xck")]
|
||||
transform = Transform3D(1.9779, 0.270409, 4.08487, -4.00125, 1.0869, 1.86547, -0.865577, -4.40646, 0.710812, 320.977, 134.583, 441.012)
|
||||
|
||||
[node name="RockB1" parent="EntranceR" instance=ExtResource("2_hybky")]
|
||||
transform = Transform3D(-1.64956, -1.63286, 1.75857, 0.196316, 2.03499, 2.07367, -2.39171, 1.29322, -1.04267, 295.848, 109.828, 419.45)
|
||||
|
||||
[node name="RockB3" parent="EntranceR" instance=ExtResource("2_hybky")]
|
||||
transform = Transform3D(-2.03718, 1.29729, 2.88404, -2.82928, 0.784888, -2.35156, -1.41272, -3.44263, 0.550663, 306.288, 128.712, 434.042)
|
||||
|
||||
[node name="RockB4" parent="EntranceR" instance=ExtResource("2_hybky")]
|
||||
transform = Transform3D(1.97436, 2.87133, -1.41708, -2.82928, 0.784888, -2.35156, -1.49926, 2.30004, 2.57153, 328.686, 129.709, 427.63)
|
||||
|
||||
[node name="RockB2" parent="EntranceR" instance=ExtResource("2_hybky")]
|
||||
transform = Transform3D(-2.17746, 0.476253, -1.87396, -1.61495, 1.104, 2.15708, 1.06324, 2.65221, -0.561397, 303.461, 107.797, 428.826)
|
||||
|
||||
[node name="RockC1" parent="EntranceR" instance=ExtResource("3_nbn1a")]
|
||||
transform = Transform3D(1.74949, 1.15588, 0.576742, -1.01213, 1.82987, -0.597152, -0.802676, 0.21197, 2.01002, 335.27, 110.419, 418.362)
|
||||
|
||||
[node name="RockC2" parent="EntranceR" instance=ExtResource("3_nbn1a")]
|
||||
transform = Transform3D(4.31956, 5.88829, -1.29353, -3.67086, 1.30662, -6.31041, -4.78226, 4.31561, 3.67549, 345.465, 146.581, 480.747)
|
||||
|
||||
[node name="TunnelMesh" parent="." instance=ExtResource("4_klbpo")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 546.733, 112.043, 468.686)
|
||||
|
||||
[node name="CrystalGroup1" type="Node3D" parent="."]
|
||||
transform = Transform3D(0.567756, 0.0788585, -0.00345403, 0.0729824, -0.514888, 0.241124, 0.0300693, -0.239266, -0.520024, 415.722, 122.719, 611.385)
|
||||
|
||||
[node name="CrystalC" parent="CrystalGroup1" instance=ExtResource("5_bb2w0")]
|
||||
transform = Transform3D(0.990472, -0.134216, 0.0307963, 0.132893, 0.873058, -0.469155, 0.0360812, 0.468779, 0.882577, 0.050354, 1.72128, 4.54956)
|
||||
|
||||
[node name="CrystalC3" parent="CrystalGroup1" instance=ExtResource("5_bb2w0")]
|
||||
transform = Transform3D(0.999999, 2.98023e-08, 0, 1.40402e-08, 0.999999, 1.19209e-07, 6.89635e-09, -1.49012e-07, 0.999999, 4.00897, 3.69431, -0.617554)
|
||||
|
||||
[node name="CrystalC2" parent="CrystalGroup1" instance=ExtResource("5_bb2w0")]
|
||||
transform = Transform3D(-0.513116, -0.374576, 0.95887, -0.130632, 1.08641, 0.354495, -1.02111, 0.0492404, -0.527189, -1.70374, 4.03528, -0.568237)
|
||||
|
||||
[node name="OmniLight3D" type="OmniLight3D" parent="CrystalGroup1"]
|
||||
transform = Transform3D(1, 3.21278e-08, -1.96807e-08, -3.21278e-08, 1, 1.02499e-07, 1.96807e-08, -1.02499e-07, 1, 1.11737, 4.79865, 1.8949)
|
||||
light_color = Color(0.4, 0.760784, 1, 1)
|
||||
light_energy = 16.0
|
||||
shadow_enabled = true
|
||||
omni_range = 83.054
|
||||
|
||||
[node name="CrystalGroup2" type="Node3D" parent="."]
|
||||
transform = Transform3D(-0.536793, -0.0213862, -0.199931, -0.116106, 0.498308, 0.25843, 0.164163, 0.282504, -0.470976, 553.318, 103.571, 647.425)
|
||||
|
||||
[node name="CrystalC" parent="CrystalGroup2" instance=ExtResource("5_bb2w0")]
|
||||
transform = Transform3D(0.704558, -0.579782, 0.130258, 0.554941, 0.56972, -0.465804, 0.212495, 0.434496, 0.784585, 0.815979, 1.24854, 2.5437)
|
||||
|
||||
[node name="Rock3" parent="CrystalGroup2/CrystalC" index="0"]
|
||||
surface_material_override/0 = ExtResource("6_s6twx")
|
||||
|
||||
[node name="CrystalC3" parent="CrystalGroup2" instance=ExtResource("5_bb2w0")]
|
||||
transform = Transform3D(0.127208, -0.0568556, -1.06836, -0.317718, 1.02534, -0.0923969, 1.02161, 0.32596, 0.104294, 4.00861, 3.69458, -0.617188)
|
||||
|
||||
[node name="Rock3" parent="CrystalGroup2/CrystalC3" index="0"]
|
||||
surface_material_override/0 = ExtResource("6_s6twx")
|
||||
|
||||
[node name="CrystalC2" parent="CrystalGroup2" instance=ExtResource("5_bb2w0")]
|
||||
transform = Transform3D(-0.642172, -0.213226, 0.774009, 0.484154, 0.687794, 0.591163, -0.640428, 0.733767, -0.329203, 7.28876, 1.71277, 4.52783)
|
||||
|
||||
[node name="Rock3" parent="CrystalGroup2/CrystalC2" index="0"]
|
||||
surface_material_override/0 = ExtResource("6_s6twx")
|
||||
|
||||
[node name="OmniLight3D" type="OmniLight3D" parent="CrystalGroup2"]
|
||||
transform = Transform3D(1.74454, 2.98023e-08, -2.98023e-08, -5.60482e-08, 1.74454, 1.49012e-07, 3.43338e-08, -1.78814e-07, 1.74454, 1.11737, 4.79865, 1.8949)
|
||||
light_color = Color(0.396078, 0.333333, 0.878431, 1)
|
||||
light_energy = 16.0
|
||||
shadow_enabled = true
|
||||
omni_range = 83.054
|
||||
|
||||
[node name="CrystalGroup3" type="Node3D" parent="."]
|
||||
transform = Transform3D(-0.536793, -0.0213862, -0.199931, 0.0789312, -0.546626, -0.153451, -0.184932, -0.17123, 0.514837, 711.291, 124.136, 579.252)
|
||||
|
||||
[node name="CrystalC" parent="CrystalGroup3" instance=ExtResource("5_bb2w0")]
|
||||
transform = Transform3D(0.898105, -0.188271, 0.0864646, 0.196692, 0.654036, -0.618921, 0.0650697, 0.621535, 0.677476, 0.589844, 2.22089, 3.04785)
|
||||
|
||||
[node name="Rock3" parent="CrystalGroup3/CrystalC" index="0"]
|
||||
surface_material_override/0 = SubResource("StandardMaterial3D_0v0nf")
|
||||
|
||||
[node name="CrystalC3" parent="CrystalGroup3" instance=ExtResource("5_bb2w0")]
|
||||
transform = Transform3D(0.15544, 0.0752453, -1.06348, -0.370935, 1.01139, 0.0173435, 0.999527, 0.363637, 0.171821, 4.00867, 3.69458, -0.617432)
|
||||
|
||||
[node name="Rock3" parent="CrystalGroup3/CrystalC3" index="0"]
|
||||
surface_material_override/0 = SubResource("StandardMaterial3D_0v0nf")
|
||||
|
||||
[node name="CrystalC2" parent="CrystalGroup3" instance=ExtResource("5_bb2w0")]
|
||||
transform = Transform3D(-0.573134, -0.100696, 0.847536, 0.285048, 0.939695, 0.304405, -0.804489, 0.404691, -0.495942, 7.2887, 1.71283, 4.52771)
|
||||
|
||||
[node name="Rock3" parent="CrystalGroup3/CrystalC2" index="0"]
|
||||
surface_material_override/0 = SubResource("StandardMaterial3D_0v0nf")
|
||||
|
||||
[node name="OmniLight3D" type="OmniLight3D" parent="CrystalGroup3"]
|
||||
transform = Transform3D(1.74454, 2.98023e-08, -2.98023e-08, -5.60482e-08, 1.74454, 1.49012e-07, 3.43338e-08, -1.78814e-07, 1.74454, 1.11737, 4.79865, 1.8949)
|
||||
light_color = Color(0.388235, 0.101961, 0.2, 1)
|
||||
light_energy = 16.0
|
||||
shadow_enabled = true
|
||||
omni_range = 83.054
|
||||
|
||||
[node name="CaveArea3D" type="Area3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 549.961, 110.763, 526.656)
|
||||
collision_mask = 2
|
||||
script = ExtResource("9_fn2ke")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="CaveArea3D"]
|
||||
transform = Transform3D(0.998441, 0, -0.0558215, 0, 1, 0, 0.0558215, 0, 0.998441, -8.36676, 3.78637, 30.7709)
|
||||
shape = SubResource("BoxShape3D_goiy4")
|
||||
|
||||
[editable path="CrystalGroup2/CrystalC"]
|
||||
[editable path="CrystalGroup2/CrystalC3"]
|
||||
[editable path="CrystalGroup2/CrystalC2"]
|
||||
[editable path="CrystalGroup3/CrystalC"]
|
||||
[editable path="CrystalGroup3/CrystalC3"]
|
||||
[editable path="CrystalGroup3/CrystalC2"]
|
||||
66
demo/components/UI.tscn
Normal file
66
demo/components/UI.tscn
Normal file
@@ -0,0 +1,66 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://d2jihfohphuue"]
|
||||
|
||||
[ext_resource type="Script" path="res://demo/src/UI.gd" id="1_why5e"]
|
||||
|
||||
[node name="UI" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_why5e")
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 1
|
||||
offset_left = 5.0
|
||||
offset_top = 5.0
|
||||
offset_right = 275.0
|
||||
offset_bottom = 340.0
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 0.662745)
|
||||
theme_override_constants/shadow_offset_x = 1
|
||||
theme_override_constants/shadow_offset_y = 1
|
||||
text = "FPS: 100
|
||||
Position: (100, 100, 100)
|
||||
Move Speed: 10
|
||||
|
||||
Player
|
||||
Move: WASDEQ,Space,Mouse
|
||||
Move speed: Wheel,+/-,Shift
|
||||
Camera view: V
|
||||
Gravity toggle: G
|
||||
Collision toggle: C
|
||||
|
||||
Window
|
||||
Quit: F8
|
||||
UI toggle: F9
|
||||
Render mode: F10
|
||||
Full screen: F11
|
||||
Mouse toggle: Escape
|
||||
"
|
||||
|
||||
[node name="Panel" type="Panel" parent="Label"]
|
||||
modulate = Color(1, 1, 1, 0.392157)
|
||||
show_behind_parent = true
|
||||
layout_mode = 0
|
||||
offset_left = -5.0
|
||||
offset_top = -5.0
|
||||
offset_right = 248.0
|
||||
offset_bottom = 444.0
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="Label/Panel"]
|
||||
top_level = true
|
||||
layout_mode = 0
|
||||
offset_left = 6.0
|
||||
offset_top = 129.0
|
||||
offset_right = 246.0
|
||||
offset_bottom = 138.0
|
||||
|
||||
[node name="HSeparator2" type="HSeparator" parent="Label/Panel"]
|
||||
top_level = true
|
||||
layout_mode = 0
|
||||
offset_left = 6.0
|
||||
offset_top = 310.0
|
||||
offset_right = 246.0
|
||||
offset_bottom = 319.0
|
||||
39
demo/data/assets.tres
Normal file
39
demo/data/assets.tres
Normal file
@@ -0,0 +1,39 @@
|
||||
[gd_resource type="Terrain3DAssets" load_steps=9 format=3 uid="uid://dal3jhw6241qg"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://br7bfxcxh60df" path="res://demo/assets/textures/rock030_alb_ht.png" id="1_v81ad"]
|
||||
[ext_resource type="Texture2D" uid="uid://cr72kjil43vgj" path="res://demo/assets/textures/rock030_nrm_rgh.png" id="2_72dup"]
|
||||
[ext_resource type="Texture2D" uid="uid://ddprscrpsofah" path="res://demo/assets/textures/ground037_alb_ht.png" id="3_g8f2m"]
|
||||
[ext_resource type="Texture2D" uid="uid://c1ots7w6i0i1q" path="res://demo/assets/textures/ground037_nrm_rgh.png" id="4_aw5y1"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_aubfq"]
|
||||
transparency = 4
|
||||
cull_mode = 2
|
||||
vertex_color_use_as_albedo = true
|
||||
backlight_enabled = true
|
||||
backlight = Color(0.5, 0.5, 0.5, 1)
|
||||
distance_fade_mode = 1
|
||||
distance_fade_min_distance = 960.0
|
||||
distance_fade_max_distance = 480.0
|
||||
|
||||
[sub_resource type="Terrain3DMeshAsset" id="Terrain3DMeshAsset_dw1mh"]
|
||||
height_offset = 0.5
|
||||
density = 10.0
|
||||
material_override = SubResource("StandardMaterial3D_aubfq")
|
||||
generated_type = 1
|
||||
|
||||
[sub_resource type="Terrain3DTextureAsset" id="Terrain3DTextureAsset_mup2f"]
|
||||
name = "Rock"
|
||||
albedo_color = Color(1.596, 1.56, 1.5, 1)
|
||||
albedo_texture = ExtResource("1_v81ad")
|
||||
normal_texture = ExtResource("2_72dup")
|
||||
|
||||
[sub_resource type="Terrain3DTextureAsset" id="Terrain3DTextureAsset_od0q7"]
|
||||
name = "Grass"
|
||||
id = 1
|
||||
albedo_color = Color(0.67451, 0.74902, 0.686275, 1)
|
||||
albedo_texture = ExtResource("3_g8f2m")
|
||||
normal_texture = ExtResource("4_aw5y1")
|
||||
|
||||
[resource]
|
||||
mesh_list = Array[Terrain3DMeshAsset]([SubResource("Terrain3DMeshAsset_dw1mh")])
|
||||
texture_list = Array[Terrain3DTextureAsset]([SubResource("Terrain3DTextureAsset_mup2f"), SubResource("Terrain3DTextureAsset_od0q7")])
|
||||
BIN
demo/data/nav_mesh.res
Normal file
BIN
demo/data/nav_mesh.res
Normal file
Binary file not shown.
BIN
demo/data/terrain3d_00-01.res
Normal file
BIN
demo/data/terrain3d_00-01.res
Normal file
Binary file not shown.
BIN
demo/data/terrain3d_00-02.res
Normal file
BIN
demo/data/terrain3d_00-02.res
Normal file
Binary file not shown.
BIN
demo/data/terrain3d_00_00.res
Normal file
BIN
demo/data/terrain3d_00_00.res
Normal file
Binary file not shown.
29
demo/src/CameraManager.gd
Normal file
29
demo/src/CameraManager.gd
Normal file
@@ -0,0 +1,29 @@
|
||||
extends Node3D
|
||||
|
||||
const CAMERA_MAX_PITCH: float = deg_to_rad(70)
|
||||
const CAMERA_MIN_PITCH: float = deg_to_rad(-89.9)
|
||||
const CAMERA_RATIO: float = .625
|
||||
|
||||
@export var mouse_sensitivity: float = .002
|
||||
@export var mouse_y_inversion: float = -1.0
|
||||
|
||||
@onready var _camera_yaw: Node3D = self
|
||||
@onready var _camera_pitch: Node3D = %Arm
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
||||
|
||||
|
||||
func _input(p_event: InputEvent) -> void:
|
||||
if p_event is InputEventMouseMotion and Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
|
||||
rotate_camera(p_event.relative)
|
||||
get_viewport().set_input_as_handled()
|
||||
return
|
||||
|
||||
|
||||
func rotate_camera(p_relative:Vector2) -> void:
|
||||
_camera_yaw.rotation.y -= p_relative.x * mouse_sensitivity
|
||||
_camera_yaw.orthonormalize()
|
||||
_camera_pitch.rotation.x += p_relative.y * mouse_sensitivity * CAMERA_RATIO * mouse_y_inversion
|
||||
_camera_pitch.rotation.x = clamp(_camera_pitch.rotation.x, CAMERA_MIN_PITCH, CAMERA_MAX_PITCH)
|
||||
22
demo/src/CaveEntrance.gd
Normal file
22
demo/src/CaveEntrance.gd
Normal file
@@ -0,0 +1,22 @@
|
||||
extends Area3D
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
body_entered.connect(_on_body_entered)
|
||||
body_exited.connect(_on_body_exited)
|
||||
|
||||
|
||||
func _on_body_entered(body: Node3D) -> void:
|
||||
if body.name == "Player":
|
||||
var env: WorldEnvironment = get_node_or_null("../../Environment/WorldEnvironment")
|
||||
if env:
|
||||
var tween: Tween = get_tree().create_tween()
|
||||
tween.tween_property(env.environment, "ambient_light_energy", .1, .33)
|
||||
|
||||
|
||||
func _on_body_exited(body: Node3D) -> void:
|
||||
if body.name == "Player":
|
||||
var env: WorldEnvironment = get_node_or_null("../../Environment/WorldEnvironment")
|
||||
if env:
|
||||
var tween: Tween = get_tree().create_tween()
|
||||
tween.tween_property(env.environment, "ambient_light_energy", 1., .33)
|
||||
34
demo/src/CodeGenerated.gd
Normal file
34
demo/src/CodeGenerated.gd
Normal file
@@ -0,0 +1,34 @@
|
||||
extends Node
|
||||
|
||||
|
||||
func _ready():
|
||||
$UI.player = $Player
|
||||
|
||||
if has_node("RunThisSceneLabel3D"):
|
||||
$RunThisSceneLabel3D.queue_free()
|
||||
|
||||
# Create a terrain
|
||||
var terrain := Terrain3D.new()
|
||||
terrain.assets = Terrain3DAssets.new()
|
||||
terrain.name = "Terrain3D"
|
||||
terrain.set_collision_enabled(false)
|
||||
add_child(terrain, true)
|
||||
terrain.material.world_background = Terrain3DMaterial.NONE
|
||||
|
||||
# Generate 32-bit noise and import it with scale
|
||||
var noise := FastNoiseLite.new()
|
||||
noise.frequency = 0.0005
|
||||
var img: Image = Image.create(2048, 2048, false, Image.FORMAT_RF)
|
||||
for x in 2048:
|
||||
for y in 2048:
|
||||
img.set_pixel(x, y, Color(noise.get_noise_2d(x, y)*0.5, 0., 0., 1.))
|
||||
terrain.data.import_images([img, null, null], Vector3(-1024, 0, -1024), 0.0, 300.0)
|
||||
|
||||
# Enable collision. Enable the first if you wish to see it with Debug/Visible Collision Shapes
|
||||
#terrain.set_show_debug_collision(true)
|
||||
terrain.set_collision_enabled(true)
|
||||
|
||||
# Enable runtime navigation baking using the terrain
|
||||
$RuntimeNavigationBaker.terrain = terrain
|
||||
$RuntimeNavigationBaker.enabled = true
|
||||
|
||||
8
demo/src/DemoScene.gd
Normal file
8
demo/src/DemoScene.gd
Normal file
@@ -0,0 +1,8 @@
|
||||
@tool
|
||||
extends Node
|
||||
|
||||
|
||||
func _ready():
|
||||
if not Engine.is_editor_hint() and has_node("UI"):
|
||||
$UI.player = $Player
|
||||
|
||||
52
demo/src/Enemy.gd
Normal file
52
demo/src/Enemy.gd
Normal file
@@ -0,0 +1,52 @@
|
||||
extends CharacterBody3D
|
||||
|
||||
const RETARGET_COOLDOWN: float = 1.0
|
||||
|
||||
@export var MOVE_SPEED: float = 50.0
|
||||
@export var target: Node3D
|
||||
|
||||
@onready var nav_agent: NavigationAgent3D = $NavigationAgent3D
|
||||
|
||||
var _retarget_timer: float = 1.0
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
nav_agent.velocity_computed.connect(_on_velocity_computed)
|
||||
|
||||
|
||||
func _process(p_delta: float) -> void:
|
||||
_retarget_timer += p_delta
|
||||
if _retarget_timer > RETARGET_COOLDOWN and target:
|
||||
# Don't reset the target position every frame. It triggers an A* search, which is expensive.
|
||||
_retarget_timer = 0.0
|
||||
nav_agent.set_target_position(target.global_position)
|
||||
|
||||
|
||||
func is_on_nav_mesh() -> bool:
|
||||
var closest_point := NavigationServer3D.map_get_closest_point(nav_agent.get_navigation_map(), global_position)
|
||||
return global_position.distance_squared_to(closest_point) < nav_agent.path_max_distance ** 2
|
||||
|
||||
|
||||
func _physics_process(p_delta: float) -> void:
|
||||
if nav_agent.is_navigation_finished():
|
||||
velocity.x = 0.0
|
||||
velocity.z = 0.0
|
||||
else:
|
||||
var next_path_position: Vector3 = nav_agent.get_next_path_position()
|
||||
var current_agent_position: Vector3 = global_position
|
||||
var velocity_xz := (next_path_position - current_agent_position).normalized() * MOVE_SPEED
|
||||
velocity.x = velocity_xz.x
|
||||
velocity.z = velocity_xz.z
|
||||
|
||||
velocity.y -= 40 * p_delta
|
||||
|
||||
if nav_agent.avoidance_enabled:
|
||||
nav_agent.set_velocity(velocity)
|
||||
else:
|
||||
_on_velocity_computed(velocity)
|
||||
|
||||
|
||||
func _on_velocity_computed(p_safe_velocity: Vector3) -> void:
|
||||
velocity.x = p_safe_velocity.x
|
||||
velocity.z = p_safe_velocity.z
|
||||
move_and_slide()
|
||||
81
demo/src/Player.gd
Normal file
81
demo/src/Player.gd
Normal file
@@ -0,0 +1,81 @@
|
||||
extends CharacterBody3D
|
||||
|
||||
@export var MOVE_SPEED: float = 50.0
|
||||
@export var JUMP_SPEED: float = 2.0
|
||||
@export var first_person: bool = false :
|
||||
set(p_value):
|
||||
first_person = p_value
|
||||
if first_person:
|
||||
var tween: Tween = create_tween()
|
||||
tween.tween_property($CameraManager/Arm, "spring_length", 0.0, .33)
|
||||
tween.tween_callback($Body.set_visible.bind(false))
|
||||
else:
|
||||
$Body.visible = true
|
||||
create_tween().tween_property($CameraManager/Arm, "spring_length", 6.0, .33)
|
||||
|
||||
@export var gravity_enabled: bool = true :
|
||||
set(p_value):
|
||||
gravity_enabled = p_value
|
||||
if not gravity_enabled:
|
||||
velocity.y = 0
|
||||
|
||||
@export var collision_enabled: bool = true :
|
||||
set(p_value):
|
||||
collision_enabled = p_value
|
||||
$CollisionShapeBody.disabled = ! collision_enabled
|
||||
$CollisionShapeRay.disabled = ! collision_enabled
|
||||
|
||||
|
||||
func _physics_process(p_delta) -> void:
|
||||
var direction: Vector3 = get_camera_relative_input()
|
||||
var h_veloc: Vector2 = Vector2(direction.x, direction.z) * MOVE_SPEED
|
||||
if Input.is_key_pressed(KEY_SHIFT):
|
||||
h_veloc *= 2
|
||||
velocity.x = h_veloc.x
|
||||
velocity.z = h_veloc.y
|
||||
if gravity_enabled:
|
||||
velocity.y -= 40 * p_delta
|
||||
move_and_slide()
|
||||
|
||||
|
||||
# Returns the input vector relative to the camera. Forward is always the direction the camera is facing
|
||||
func get_camera_relative_input() -> Vector3:
|
||||
var input_dir: Vector3 = Vector3.ZERO
|
||||
if Input.is_key_pressed(KEY_A): # Left
|
||||
input_dir -= %Camera3D.global_transform.basis.x
|
||||
if Input.is_key_pressed(KEY_D): # Right
|
||||
input_dir += %Camera3D.global_transform.basis.x
|
||||
if Input.is_key_pressed(KEY_W): # Forward
|
||||
input_dir -= %Camera3D.global_transform.basis.z
|
||||
if Input.is_key_pressed(KEY_S): # Backward
|
||||
input_dir += %Camera3D.global_transform.basis.z
|
||||
if Input.is_key_pressed(KEY_E) or Input.is_key_pressed(KEY_SPACE): # Up
|
||||
velocity.y += JUMP_SPEED + MOVE_SPEED*.016
|
||||
if Input.is_key_pressed(KEY_Q): # Down
|
||||
velocity.y -= JUMP_SPEED + MOVE_SPEED*.016
|
||||
if Input.is_key_pressed(KEY_KP_ADD) or Input.is_key_pressed(KEY_EQUAL):
|
||||
MOVE_SPEED = clamp(MOVE_SPEED + .5, 5, 9999)
|
||||
if Input.is_key_pressed(KEY_KP_SUBTRACT) or Input.is_key_pressed(KEY_MINUS):
|
||||
MOVE_SPEED = clamp(MOVE_SPEED - .5, 5, 9999)
|
||||
return input_dir
|
||||
|
||||
|
||||
func _input(p_event: InputEvent) -> void:
|
||||
if p_event is InputEventMouseButton and p_event.pressed:
|
||||
if p_event.button_index == MOUSE_BUTTON_WHEEL_UP:
|
||||
MOVE_SPEED = clamp(MOVE_SPEED + 5, 5, 9999)
|
||||
elif p_event.button_index == MOUSE_BUTTON_WHEEL_DOWN:
|
||||
MOVE_SPEED = clamp(MOVE_SPEED - 5, 5, 9999)
|
||||
|
||||
elif p_event is InputEventKey:
|
||||
if p_event.pressed:
|
||||
if p_event.keycode == KEY_V:
|
||||
first_person = ! first_person
|
||||
elif p_event.keycode == KEY_G:
|
||||
gravity_enabled = ! gravity_enabled
|
||||
elif p_event.keycode == KEY_C:
|
||||
collision_enabled = ! collision_enabled
|
||||
|
||||
# Else if up/down released
|
||||
elif p_event.keycode in [ KEY_Q, KEY_E, KEY_SPACE ]:
|
||||
velocity.y = 0
|
||||
152
demo/src/RuntimeNavigationBaker.gd
Normal file
152
demo/src/RuntimeNavigationBaker.gd
Normal file
@@ -0,0 +1,152 @@
|
||||
extends Node
|
||||
|
||||
signal bake_finished
|
||||
|
||||
@export var enabled: bool = true : set = set_enabled
|
||||
@export var enter_cost: float = 0.0 : set = set_enter_cost
|
||||
@export var travel_cost: float = 1.0 : set = set_travel_cost
|
||||
@export_flags_3d_navigation var navigation_layers: int = 1 : set = set_navigation_layers
|
||||
@export var template: NavigationMesh : set = set_template
|
||||
@export var terrain: Terrain3D
|
||||
@export var player: Node3D
|
||||
@export var mesh_size := Vector3(256, 512, 256)
|
||||
@export var min_rebake_distance: float = 64.0
|
||||
@export var bake_cooldown: float = 1.0
|
||||
@export_group("Debug")
|
||||
@export var log_timing: bool = false
|
||||
|
||||
var _scene_geometry: NavigationMeshSourceGeometryData3D
|
||||
var _current_center := Vector3(INF,INF,INF)
|
||||
|
||||
var _bake_task_id: int = -1
|
||||
var _bake_task_timer: float = 0.0
|
||||
var _bake_cooldown_timer: float = 0.0
|
||||
var _nav_region: NavigationRegion3D
|
||||
|
||||
|
||||
func _ready():
|
||||
_nav_region = NavigationRegion3D.new()
|
||||
_nav_region.navigation_layers = navigation_layers
|
||||
_nav_region.enabled = enabled
|
||||
_nav_region.enter_cost = enter_cost
|
||||
_nav_region.travel_cost = travel_cost
|
||||
|
||||
# Enabling edge connections comes with a performance penalty that causes hitches whenever
|
||||
# the nav mesh is updated. The navigation server has to compare each edge, and it does this on
|
||||
# the main thread.
|
||||
_nav_region.use_edge_connections = false
|
||||
|
||||
add_child(_nav_region)
|
||||
|
||||
_update_map_cell_size()
|
||||
|
||||
# If you're using ProtonScatter, you will want to delay this next call until after all
|
||||
# your scatter nodes have finished setting up. Here, we just defer one frame so that nodes
|
||||
# after this one in the tree get set up first
|
||||
parse_scene.call_deferred()
|
||||
|
||||
|
||||
func set_enabled(p_value: bool) -> void:
|
||||
enabled = p_value
|
||||
if _nav_region:
|
||||
_nav_region.enabled = enabled
|
||||
set_process(enabled and template)
|
||||
|
||||
|
||||
func set_enter_cost(p_value: bool) -> void:
|
||||
enter_cost = p_value
|
||||
if _nav_region:
|
||||
_nav_region.enter_cost = enter_cost
|
||||
|
||||
|
||||
func set_travel_cost(p_value: bool) -> void:
|
||||
travel_cost = p_value
|
||||
if _nav_region:
|
||||
_nav_region.travel_cost = travel_cost
|
||||
|
||||
|
||||
func set_navigation_layers(p_value: int) -> void:
|
||||
navigation_layers = p_value
|
||||
if _nav_region:
|
||||
_nav_region.navigation_layers = navigation_layers
|
||||
|
||||
|
||||
func set_template(p_value: NavigationMesh) -> void:
|
||||
template = p_value
|
||||
set_process(enabled and template)
|
||||
_update_map_cell_size()
|
||||
|
||||
|
||||
func parse_scene() -> void:
|
||||
_scene_geometry = NavigationMeshSourceGeometryData3D.new()
|
||||
NavigationMeshGenerator.parse_source_geometry_data(template, _scene_geometry, self)
|
||||
|
||||
|
||||
func _update_map_cell_size() -> void:
|
||||
if get_viewport() and template:
|
||||
var map := get_viewport().find_world_3d().navigation_map
|
||||
NavigationServer3D.map_set_cell_size(map, template.cell_size)
|
||||
NavigationServer3D.map_set_cell_height(map, template.cell_height)
|
||||
|
||||
|
||||
func _process(p_delta: float) -> void:
|
||||
if _bake_task_id != -1:
|
||||
_bake_task_timer += p_delta
|
||||
|
||||
if not player or _bake_task_id != -1:
|
||||
return
|
||||
|
||||
if _bake_cooldown_timer > 0.0:
|
||||
_bake_cooldown_timer -= p_delta
|
||||
return
|
||||
|
||||
var track_pos := player.global_position
|
||||
if player is CharacterBody3D:
|
||||
# Center on where the player is likely _going to be_:
|
||||
track_pos += player.velocity * bake_cooldown
|
||||
|
||||
if track_pos.distance_squared_to(_current_center) >= min_rebake_distance * min_rebake_distance:
|
||||
_current_center = track_pos
|
||||
_rebake(_current_center)
|
||||
|
||||
|
||||
func _rebake(p_center: Vector3) -> void:
|
||||
assert(template != null)
|
||||
_bake_task_id = WorkerThreadPool.add_task(_task_bake.bind(p_center), false, "RuntimeNavigationBaker")
|
||||
_bake_task_timer = 0.0
|
||||
_bake_cooldown_timer = bake_cooldown
|
||||
|
||||
|
||||
func _task_bake(p_center: Vector3) -> void:
|
||||
var nav_mesh: NavigationMesh = template.duplicate()
|
||||
nav_mesh.filter_baking_aabb = AABB(-mesh_size * 0.5, mesh_size)
|
||||
nav_mesh.filter_baking_aabb_offset = p_center
|
||||
var source_geometry: NavigationMeshSourceGeometryData3D
|
||||
source_geometry = _scene_geometry.duplicate()
|
||||
|
||||
if terrain:
|
||||
var aabb: AABB = nav_mesh.filter_baking_aabb
|
||||
aabb.position += nav_mesh.filter_baking_aabb_offset
|
||||
var faces: PackedVector3Array = terrain.generate_nav_mesh_source_geometry(aabb, false)
|
||||
source_geometry.add_faces(faces, Transform3D.IDENTITY)
|
||||
|
||||
if source_geometry.has_data():
|
||||
NavigationMeshGenerator.bake_from_source_geometry_data(nav_mesh, source_geometry)
|
||||
_bake_finished.call_deferred(nav_mesh)
|
||||
else:
|
||||
_bake_finished.call_deferred(null)
|
||||
|
||||
|
||||
func _bake_finished(p_nav_mesh: NavigationMesh) -> void:
|
||||
if log_timing:
|
||||
print("Navigation bake took ", _bake_task_timer, "s")
|
||||
|
||||
_bake_task_timer = 0.0
|
||||
_bake_task_id = -1
|
||||
|
||||
if p_nav_mesh:
|
||||
_nav_region.navigation_mesh = p_nav_mesh
|
||||
|
||||
bake_finished.emit()
|
||||
assert(!NavigationServer3D.region_get_use_edge_connections(_nav_region.get_region_rid()))
|
||||
|
||||
65
demo/src/UI.gd
Normal file
65
demo/src/UI.gd
Normal file
@@ -0,0 +1,65 @@
|
||||
extends Control
|
||||
|
||||
|
||||
var player: Node
|
||||
var visible_mode: int = 1
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
RenderingServer.set_debug_generate_wireframes(true)
|
||||
|
||||
|
||||
func _process(p_delta) -> void:
|
||||
$Label.text = "FPS: %s\n" % str(Engine.get_frames_per_second())
|
||||
if(visible_mode == 1):
|
||||
$Label.text += "Move Speed: %.1f\n" % player.MOVE_SPEED if player else ""
|
||||
$Label.text += "Position: %.1v\n" % player.global_position if player else ""
|
||||
$Label.text += """
|
||||
Player
|
||||
Move: WASDEQ,Space,Mouse
|
||||
Move speed: Wheel,+/-,Shift
|
||||
Camera View: V
|
||||
Gravity toggle: G
|
||||
Collision toggle: C
|
||||
|
||||
Window
|
||||
Quit: F8
|
||||
UI toggle: F9
|
||||
Render mode: F10
|
||||
Full screen: F11
|
||||
Mouse toggle: Escape
|
||||
"""
|
||||
|
||||
|
||||
func _unhandled_key_input(p_event: InputEvent) -> void:
|
||||
if p_event is InputEventKey and p_event.pressed:
|
||||
match p_event.keycode:
|
||||
KEY_F8:
|
||||
get_tree().quit()
|
||||
KEY_F9:
|
||||
visible_mode = (visible_mode + 1 ) % 3
|
||||
$Label/Panel.visible = (visible_mode == 1)
|
||||
visible = visible_mode > 0
|
||||
KEY_F10:
|
||||
var vp = get_viewport()
|
||||
vp.debug_draw = (vp.debug_draw + 1 ) % 6
|
||||
get_viewport().set_input_as_handled()
|
||||
KEY_F11:
|
||||
toggle_fullscreen()
|
||||
get_viewport().set_input_as_handled()
|
||||
KEY_ESCAPE:
|
||||
if Input.get_mouse_mode() == Input.MOUSE_MODE_VISIBLE:
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
||||
else:
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
||||
get_viewport().set_input_as_handled()
|
||||
|
||||
|
||||
func toggle_fullscreen() -> void:
|
||||
if DisplayServer.window_get_mode() == DisplayServer.WINDOW_MODE_EXCLUSIVE_FULLSCREEN or \
|
||||
DisplayServer.window_get_mode() == DisplayServer.WINDOW_MODE_FULLSCREEN:
|
||||
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED)
|
||||
DisplayServer.window_set_size(Vector2(1280, 720))
|
||||
else:
|
||||
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_EXCLUSIVE_FULLSCREEN)
|
||||
|
||||
Reference in New Issue
Block a user