From 609b70a114947bfbdb02e544ed6e7b597f1c2ca1 Mon Sep 17 00:00:00 2001 From: Matteo Sonaglioni Date: Wed, 11 Mar 2026 18:51:31 +0100 Subject: [PATCH] add cloud shadow - godrays --- Assets/Meshes/Chunk/Prop/gpdrays_planes.obj | 120 +++++++++++++++ .../Chunk/Prop/gpdrays_planes.obj.import | 25 ++++ Assets/Textures/Noise_Clouds.tres | 6 + Assets/Textures/noise.tres | 3 +- Materials/GodRays.tres | 26 ++++ Materials/ShadowPostProcess.tres | 26 ++++ .../Chunk/Campagna/Chunk_C_L_2.tscn | 2 +- .../Chunk/Campagna/chunk_c_e_1.tscn | 2 +- .../Chunk/Campagna/chunk_c_f_1.tscn | 2 +- .../Chunk/Campagna/chunk_c_l_1.tscn | 2 +- .../Chunk/Campagna/chunk_c_r_1.tscn | 2 +- .../Chunk/Campagna/chunk_c_t_1_1.tscn | 2 +- .../Chunk/Campagna/chunk_c_t_3_1.tscn | 2 +- .../Chunk/Campagna/chunk_c_t_3_2.tscn | 2 +- .../Chunk/Campagna/chunk_c_t_3_3.tscn | 2 +- .../Chunk/Campagna/chunk_c_x_1.tscn | 2 +- .../Chunk/Foresta/Chunk_F_L_2.tscn | 2 +- .../Chunk/Foresta/chunk_F_e_1.tscn | 2 +- .../Chunk/Foresta/chunk_F_f_1.tscn | 2 +- .../Chunk/Foresta/chunk_F_l_1.tscn | 2 +- .../Chunk/Foresta/chunk_F_r_1.tscn | 2 +- .../Chunk/Foresta/chunk_F_t_1_1.tscn | 2 +- .../Chunk/Foresta/chunk_F_t_3_1.tscn | 2 +- .../Chunk/Foresta/chunk_F_t_3_2.tscn | 2 +- .../Chunk/Foresta/chunk_F_t_3_3.tscn | 2 +- .../Chunk/Foresta/chunk_F_x_1.tscn | 2 +- Scenes/Gameplay.tscn | 70 ++++++--- Scenes/camera_subpixel.gd | 29 ---- Scenes/camera_subpixel.gd.uid | 1 - Scripts/Binari.gd | 10 +- Scripts/Day_night_Cycle.gd | 49 +++++-- {Scenes => Scripts}/generatore_bioma.gd | 137 ++++++++++-------- {Scenes => Scripts}/generatore_bioma.gd.uid | 0 .../generatore_mappa.gd | 0 .../generatore_mappa.gd.uid | 0 {Test_Procedurale => Scripts}/info_chunk.gd | 0 .../info_chunk.gd.uid | 0 {Scenes => Shaders}/Edge_detector.gdshader | 0 .../Edge_detector.gdshader.uid | 0 Shaders/Shadow_postProcess.gdshader | 81 +++++++++++ Shaders/Shadow_postProcess.gdshader.uid | 1 + Shaders/godrays.gdshader | 62 ++++++++ Shaders/godrays.gdshader.uid | 1 + Shaders/tree_leaves.gdshader | 2 + 44 files changed, 532 insertions(+), 157 deletions(-) create mode 100644 Assets/Meshes/Chunk/Prop/gpdrays_planes.obj create mode 100644 Assets/Meshes/Chunk/Prop/gpdrays_planes.obj.import create mode 100644 Assets/Textures/Noise_Clouds.tres create mode 100644 Materials/GodRays.tres create mode 100644 Materials/ShadowPostProcess.tres delete mode 100644 Scenes/camera_subpixel.gd delete mode 100644 Scenes/camera_subpixel.gd.uid rename {Scenes => Scripts}/generatore_bioma.gd (66%) rename {Scenes => Scripts}/generatore_bioma.gd.uid (100%) rename {Test_Procedurale => Scripts}/generatore_mappa.gd (100%) rename {Test_Procedurale => Scripts}/generatore_mappa.gd.uid (100%) rename {Test_Procedurale => Scripts}/info_chunk.gd (100%) rename {Test_Procedurale => Scripts}/info_chunk.gd.uid (100%) rename {Scenes => Shaders}/Edge_detector.gdshader (100%) rename {Scenes => Shaders}/Edge_detector.gdshader.uid (100%) create mode 100644 Shaders/Shadow_postProcess.gdshader create mode 100644 Shaders/Shadow_postProcess.gdshader.uid create mode 100644 Shaders/godrays.gdshader create mode 100644 Shaders/godrays.gdshader.uid diff --git a/Assets/Meshes/Chunk/Prop/gpdrays_planes.obj b/Assets/Meshes/Chunk/Prop/gpdrays_planes.obj new file mode 100644 index 0000000..b97545b --- /dev/null +++ b/Assets/Meshes/Chunk/Prop/gpdrays_planes.obj @@ -0,0 +1,120 @@ +# Blender 4.5.3 LTS +# www.blender.org +o Plane.021 +v -5.000001 15.000000 10.000000 +v -5.000000 15.000000 -10.000000 +v -5.000000 -5.000000 10.000000 +v -4.999999 -5.000000 -10.000000 +v 9.999999 0.000000 10.000000 +v 10.000001 0.000000 -10.000000 +v -10.000000 0.000000 10.000000 +v -9.999999 0.000000 -10.000000 +v 9.999999 1.000000 10.000000 +v 10.000001 1.000000 -10.000000 +v -10.000000 1.000000 10.000000 +v -9.999999 1.000000 -10.000000 +v 9.999999 2.000000 10.000000 +v 10.000001 2.000000 -10.000000 +v -10.000000 2.000000 10.000000 +v -9.999999 2.000000 -10.000000 +v 9.999999 3.000000 10.000000 +v 10.000001 3.000000 -10.000000 +v -10.000000 3.000000 10.000000 +v -9.999999 3.000000 -10.000000 +v 9.999999 4.000000 10.000000 +v 10.000001 4.000000 -10.000000 +v -10.000000 4.000000 10.000000 +v -9.999999 4.000000 -10.000000 +v 9.999999 5.000000 10.000000 +v 10.000001 5.000000 -10.000000 +v -10.000001 5.000000 10.000000 +v -9.999999 5.000000 -10.000000 +v 9.999999 6.000000 10.000000 +v 10.000001 6.000000 -10.000000 +v -10.000000 6.000000 10.000000 +v -9.999999 6.000000 -10.000000 +v 9.999999 7.000000 10.000000 +v 10.000001 7.000000 -10.000000 +v -10.000000 7.000000 10.000000 +v -9.999999 7.000000 -10.000000 +v 9.999999 8.000000 10.000000 +v 10.000001 8.000000 -10.000000 +v -10.000000 8.000000 10.000000 +v -9.999999 8.000000 -10.000000 +v 9.999999 9.000000 10.000000 +v 10.000001 9.000000 -10.000000 +v -10.000000 9.000000 10.000000 +v -9.999999 9.000000 -10.000000 +v 9.999999 10.000000 10.000000 +v 10.000001 10.000000 -10.000000 +v -10.000000 10.000000 10.000000 +v -9.999999 10.000000 -10.000000 +v 4.999999 15.000000 10.000000 +v 5.000000 15.000000 -10.000000 +v 5.000000 -5.000000 10.000000 +v 5.000001 -5.000000 -10.000000 +v 3.999999 15.000000 10.000000 +v 4.000000 15.000000 -10.000000 +v 4.000000 -5.000000 10.000000 +v 4.000001 -5.000000 -10.000000 +v 2.999999 15.000000 10.000000 +v 3.000000 15.000000 -10.000000 +v 3.000000 -5.000000 10.000000 +v 3.000001 -5.000000 -10.000000 +v 1.999999 15.000000 10.000000 +v 2.000000 15.000000 -10.000000 +v 2.000000 -5.000000 10.000000 +v 2.000001 -5.000000 -10.000000 +v 0.999999 15.000000 10.000000 +v 1.000000 15.000000 -10.000000 +v 1.000000 -5.000000 10.000000 +v 1.000001 -5.000000 -10.000000 +v -0.000001 15.000000 10.000000 +v 0.000000 15.000000 -10.000000 +v -0.000000 -5.000000 10.000000 +v 0.000001 -5.000000 -10.000000 +v -1.000001 15.000000 10.000000 +v -1.000000 15.000000 -10.000000 +v -1.000000 -5.000000 10.000000 +v -0.999999 -5.000000 -10.000000 +v -2.000001 15.000000 10.000000 +v -2.000000 15.000000 -10.000000 +v -2.000000 -5.000000 10.000000 +v -1.999999 -5.000000 -10.000000 +v -3.000001 15.000000 10.000000 +v -3.000000 15.000000 -10.000000 +v -3.000000 -5.000000 10.000000 +v -2.999999 -5.000000 -10.000000 +v -4.000001 15.000000 10.000000 +v -4.000000 15.000000 -10.000000 +v -4.000000 -5.000000 10.000000 +v -3.999999 -5.000000 -10.000000 +vn -1.0000 -0.0000 -0.0000 +vn -0.0000 1.0000 -0.0000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +s 0 +f 1/1/1 2/2/1 4/3/1 3/4/1 +f 5/1/2 6/2/2 8/3/2 7/4/2 +f 9/1/2 10/2/2 12/3/2 11/4/2 +f 13/1/2 14/2/2 16/3/2 15/4/2 +f 17/1/2 18/2/2 20/3/2 19/4/2 +f 21/1/2 22/2/2 24/3/2 23/4/2 +f 25/1/2 26/2/2 28/3/2 27/4/2 +f 29/1/2 30/2/2 32/3/2 31/4/2 +f 33/1/2 34/2/2 36/3/2 35/4/2 +f 37/1/2 38/2/2 40/3/2 39/4/2 +f 41/1/2 42/2/2 44/3/2 43/4/2 +f 45/1/2 46/2/2 48/3/2 47/4/2 +f 49/1/1 50/2/1 52/3/1 51/4/1 +f 53/1/1 54/2/1 56/3/1 55/4/1 +f 57/1/1 58/2/1 60/3/1 59/4/1 +f 61/1/1 62/2/1 64/3/1 63/4/1 +f 65/1/1 66/2/1 68/3/1 67/4/1 +f 69/1/1 70/2/1 72/3/1 71/4/1 +f 73/1/1 74/2/1 76/3/1 75/4/1 +f 77/1/1 78/2/1 80/3/1 79/4/1 +f 81/1/1 82/2/1 84/3/1 83/4/1 +f 85/1/1 86/2/1 88/3/1 87/4/1 diff --git a/Assets/Meshes/Chunk/Prop/gpdrays_planes.obj.import b/Assets/Meshes/Chunk/Prop/gpdrays_planes.obj.import new file mode 100644 index 0000000..c84fbad --- /dev/null +++ b/Assets/Meshes/Chunk/Prop/gpdrays_planes.obj.import @@ -0,0 +1,25 @@ +[remap] + +importer="wavefront_obj" +importer_version=1 +type="Mesh" +uid="uid://dhoajfy0bq3yd" +path="res://.godot/imported/gpdrays_planes.obj-aebdf6aa7871a31e32d010cafc1a6472.mesh" + +[deps] + +files=["res://.godot/imported/gpdrays_planes.obj-aebdf6aa7871a31e32d010cafc1a6472.mesh"] + +source_file="res://Assets/Meshes/Chunk/Prop/gpdrays_planes.obj" +dest_files=["res://.godot/imported/gpdrays_planes.obj-aebdf6aa7871a31e32d010cafc1a6472.mesh", "res://.godot/imported/gpdrays_planes.obj-aebdf6aa7871a31e32d010cafc1a6472.mesh"] + +[params] + +generate_tangents=true +generate_lods=true +generate_shadow_mesh=true +generate_lightmap_uv2=false +generate_lightmap_uv2_texel_size=0.2 +scale_mesh=Vector3(1, 1, 1) +offset_mesh=Vector3(0, 0, 0) +force_disable_mesh_compression=false diff --git a/Assets/Textures/Noise_Clouds.tres b/Assets/Textures/Noise_Clouds.tres new file mode 100644 index 0000000..6d91707 --- /dev/null +++ b/Assets/Textures/Noise_Clouds.tres @@ -0,0 +1,6 @@ +[gd_resource type="FastNoiseLite" format=3 uid="uid://c0mtwrkptjcuw"] + +[resource] +fractal_lacunarity = 1.915 +fractal_gain = 0.53 +fractal_weighted_strength = 0.35 diff --git a/Assets/Textures/noise.tres b/Assets/Textures/noise.tres index affa2ef..9ce3798 100644 --- a/Assets/Textures/noise.tres +++ b/Assets/Textures/noise.tres @@ -1,8 +1,9 @@ [gd_resource type="NoiseTexture2D" format=3 uid="uid://bpswbjh4jj1ou"] [sub_resource type="FastNoiseLite" id="FastNoiseLite_xa3jw"] +noise_type = 3 seed = 1 -frequency = 0.0185 +frequency = 0.005 metadata/_preview_in_3d_space_ = true [resource] diff --git a/Materials/GodRays.tres b/Materials/GodRays.tres new file mode 100644 index 0000000..f5bcd89 --- /dev/null +++ b/Materials/GodRays.tres @@ -0,0 +1,26 @@ +[gd_resource type="ShaderMaterial" format=3 uid="uid://cwbxvmtih5wsc"] + +[ext_resource type="Shader" uid="uid://dkmdtejrbks8n" path="res://Shaders/godrays.gdshader" id="1_pbkwa"] + +[sub_resource type="FastNoiseLite" id="FastNoiseLite_xa3jw"] +noise_type = 3 +seed = 4 +frequency = 0.0096 +metadata/_preview_in_3d_space_ = true + +[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_eyx0r"] +noise = SubResource("FastNoiseLite_xa3jw") +seamless = true + +[resource] +render_priority = 0 +shader = ExtResource("1_pbkwa") +shader_parameter/noise_texture = SubResource("NoiseTexture2D_eyx0r") +shader_parameter/ray_color = Color(1, 0.9, 0.7, 1) +shader_parameter/base_alpha = 1.0 +shader_parameter/noise_stretching = 1.4890000232275 +shader_parameter/noise_scale = 0.18500000552762 +shader_parameter/scrolling_speed = Vector2(0, 0.05) +shader_parameter/depth_softness = 1.0 +shader_parameter/edge_fade_power = 2.0 +shader_parameter/intensity_multiplier = 0.5330000253175 diff --git a/Materials/ShadowPostProcess.tres b/Materials/ShadowPostProcess.tres new file mode 100644 index 0000000..36c0b51 --- /dev/null +++ b/Materials/ShadowPostProcess.tres @@ -0,0 +1,26 @@ +[gd_resource type="ShaderMaterial" format=3 uid="uid://cknq8qhom7ral"] + +[ext_resource type="Shader" uid="uid://c0gopfoe0ij8g" path="res://Shaders/Shadow_postProcess.gdshader" id="1_23efu"] +[ext_resource type="FastNoiseLite" uid="uid://c0mtwrkptjcuw" path="res://Assets/Textures/Noise_Clouds.tres" id="2_n0ip8"] + +[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_5lko7"] +noise = ExtResource("2_n0ip8") +seamless = true + +[resource] +render_priority = 0 +shader = ExtResource("1_23efu") +shader_parameter/noise_texture = SubResource("NoiseTexture2D_5lko7") +shader_parameter/cloud_scale = 0.007000000332500001 +shader_parameter/cloud_speed = 0.0030000001425 +shader_parameter/direction = Vector2(1, 0.2) +shader_parameter/sun_angle = Vector2(0.5, 0.5) +shader_parameter/cloud_density = 0.400000019 +shader_parameter/center_sharpness = 0.138000006555 +shader_parameter/shadow_color = Color(0, 0, 0, 1) +shader_parameter/opacity_center = 0.5 +shader_parameter/opacity_edge = 0.2 +shader_parameter/fade_start = 150.0 +shader_parameter/fade_end = 800.000035625 +shader_parameter/height_fade_start = 10.0 +shader_parameter/height_fade_end = 50.0 diff --git a/Scenes/Chunk_Scene/Chunk/Campagna/Chunk_C_L_2.tscn b/Scenes/Chunk_Scene/Chunk/Campagna/Chunk_C_L_2.tscn index a868782..80a755f 100644 --- a/Scenes/Chunk_Scene/Chunk/Campagna/Chunk_C_L_2.tscn +++ b/Scenes/Chunk_Scene/Chunk/Campagna/Chunk_C_L_2.tscn @@ -1,7 +1,7 @@ [gd_scene format=4 uid="uid://xebpudhewwwj"] [ext_resource type="PackedScene" uid="uid://bxnd5v67eaypf" path="res://Assets/Meshes/Chunk/Bioma_C/Test_Chunk_C_L_2.fbx" id="1_xe3ww"] -[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Test_Procedurale/info_chunk.gd" id="2_qr4wy"] +[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Scripts/info_chunk.gd" id="2_qr4wy"] [ext_resource type="Material" uid="uid://couj6glsrm6h3" path="res://Materials/Sentiero.tres" id="2_xlq82"] [ext_resource type="PackedScene" uid="uid://jj15telqu3rp" path="res://Scenes/Test/Grass_Test.tscn" id="3_eyx8o"] [ext_resource type="Texture2D" uid="uid://3ot7glyivagg" path="res://Assets/Textures/Texture_Sentiero.png" id="3_odndq"] diff --git a/Scenes/Chunk_Scene/Chunk/Campagna/chunk_c_e_1.tscn b/Scenes/Chunk_Scene/Chunk/Campagna/chunk_c_e_1.tscn index 3ec8f32..81e314b 100644 --- a/Scenes/Chunk_Scene/Chunk/Campagna/chunk_c_e_1.tscn +++ b/Scenes/Chunk_Scene/Chunk/Campagna/chunk_c_e_1.tscn @@ -1,7 +1,7 @@ [gd_scene format=3 uid="uid://botm0dqtr5whb"] [ext_resource type="PackedScene" uid="uid://d3loscamahf5y" path="res://Assets/Meshes/Chunk/Bioma_C/Chunk_C_E_1.fbx" id="1_hycya"] -[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Test_Procedurale/info_chunk.gd" id="2_0urj0"] +[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Scripts/info_chunk.gd" id="2_0urj0"] [ext_resource type="Material" uid="uid://cit5uciejjoou" path="res://Materials/Grass_Chunk.tres" id="2_oixxl"] [node name="Chunk_C_E_1" unique_id=1874739368 instance=ExtResource("1_hycya")] diff --git a/Scenes/Chunk_Scene/Chunk/Campagna/chunk_c_f_1.tscn b/Scenes/Chunk_Scene/Chunk/Campagna/chunk_c_f_1.tscn index 73c6eed..3b804ac 100644 --- a/Scenes/Chunk_Scene/Chunk/Campagna/chunk_c_f_1.tscn +++ b/Scenes/Chunk_Scene/Chunk/Campagna/chunk_c_f_1.tscn @@ -1,7 +1,7 @@ [gd_scene format=4 uid="uid://givg3dyrxsk5"] [ext_resource type="PackedScene" uid="uid://d3loscamahf5y" path="res://Assets/Meshes/Chunk/Bioma_C/Chunk_C_E_1.fbx" id="1_jpp2r"] -[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Test_Procedurale/info_chunk.gd" id="2_02kkq"] +[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Scripts/info_chunk.gd" id="2_02kkq"] [ext_resource type="Material" uid="uid://cit5uciejjoou" path="res://Materials/Grass_Chunk.tres" id="3_sf2c4"] [ext_resource type="PackedScene" uid="uid://8jtrp8ckqf1a" path="res://Scenes/Chunk_Scene/House/House_muraglione.tscn" id="4_lunjj"] [ext_resource type="PackedScene" uid="uid://5sod22d0vnip" path="res://Scenes/Chunk_Scene/House/House_XL_4.tscn" id="5_tf2ul"] diff --git a/Scenes/Chunk_Scene/Chunk/Campagna/chunk_c_l_1.tscn b/Scenes/Chunk_Scene/Chunk/Campagna/chunk_c_l_1.tscn index bc0c230..a0e10c0 100644 --- a/Scenes/Chunk_Scene/Chunk/Campagna/chunk_c_l_1.tscn +++ b/Scenes/Chunk_Scene/Chunk/Campagna/chunk_c_l_1.tscn @@ -1,7 +1,7 @@ [gd_scene format=3 uid="uid://birttctl11th8"] [ext_resource type="PackedScene" uid="uid://deqp06tkp4orv" path="res://Assets/Meshes/Chunk/Bioma_C/Chunk_C_L_1.fbx" id="1_xwass"] -[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Test_Procedurale/info_chunk.gd" id="2_ib4lo"] +[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Scripts/info_chunk.gd" id="2_ib4lo"] [ext_resource type="Material" uid="uid://cit5uciejjoou" path="res://Materials/Grass_Chunk.tres" id="3_3x6ti"] [ext_resource type="Material" uid="uid://couj6glsrm6h3" path="res://Materials/Sentiero.tres" id="4_kwc5e"] [ext_resource type="Material" uid="uid://cd34mgvhj1d0r" path="res://Materials/GrassBlockout.tres" id="5_ag87g"] diff --git a/Scenes/Chunk_Scene/Chunk/Campagna/chunk_c_r_1.tscn b/Scenes/Chunk_Scene/Chunk/Campagna/chunk_c_r_1.tscn index 0d4c152..3747eae 100644 --- a/Scenes/Chunk_Scene/Chunk/Campagna/chunk_c_r_1.tscn +++ b/Scenes/Chunk_Scene/Chunk/Campagna/chunk_c_r_1.tscn @@ -1,7 +1,7 @@ [gd_scene format=3 uid="uid://badmwcxptjfvo"] [ext_resource type="PackedScene" uid="uid://bign7y2duatrm" path="res://Assets/Meshes/Chunk/Bioma_C/Chunk_C_R_1.fbx" id="1_c6sxq"] -[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Test_Procedurale/info_chunk.gd" id="2_thhmo"] +[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Scripts/info_chunk.gd" id="2_thhmo"] [ext_resource type="Material" uid="uid://cit5uciejjoou" path="res://Materials/Grass_Chunk.tres" id="3_0cnk2"] [ext_resource type="Material" uid="uid://couj6glsrm6h3" path="res://Materials/Sentiero.tres" id="4_moww1"] [ext_resource type="Material" uid="uid://df1ghvw3d61x8" path="res://Materials/Treno1.tres" id="5_ccs0r"] diff --git a/Scenes/Chunk_Scene/Chunk/Campagna/chunk_c_t_1_1.tscn b/Scenes/Chunk_Scene/Chunk/Campagna/chunk_c_t_1_1.tscn index dd7f6c9..10febe7 100644 --- a/Scenes/Chunk_Scene/Chunk/Campagna/chunk_c_t_1_1.tscn +++ b/Scenes/Chunk_Scene/Chunk/Campagna/chunk_c_t_1_1.tscn @@ -1,7 +1,7 @@ [gd_scene format=3 uid="uid://r7gp3qvjpehw"] [ext_resource type="PackedScene" uid="uid://c7ax77lnixftt" path="res://Assets/Meshes/Chunk/Bioma_C/Chunk_C_T1_1.fbx" id="1_rjil6"] -[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Test_Procedurale/info_chunk.gd" id="2_2ckt0"] +[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Scripts/info_chunk.gd" id="2_2ckt0"] [ext_resource type="Material" uid="uid://cit5uciejjoou" path="res://Materials/Grass_Chunk.tres" id="3_vcefh"] [ext_resource type="Material" uid="uid://couj6glsrm6h3" path="res://Materials/Sentiero.tres" id="4_hu7g2"] [ext_resource type="Material" uid="uid://df1ghvw3d61x8" path="res://Materials/Treno1.tres" id="5_dfedt"] diff --git a/Scenes/Chunk_Scene/Chunk/Campagna/chunk_c_t_3_1.tscn b/Scenes/Chunk_Scene/Chunk/Campagna/chunk_c_t_3_1.tscn index 1389422..b9e011a 100644 --- a/Scenes/Chunk_Scene/Chunk/Campagna/chunk_c_t_3_1.tscn +++ b/Scenes/Chunk_Scene/Chunk/Campagna/chunk_c_t_3_1.tscn @@ -1,7 +1,7 @@ [gd_scene format=3 uid="uid://b3l7mu5ompcb6"] [ext_resource type="PackedScene" uid="uid://0fj7s2vhg2vl" path="res://Assets/Meshes/Chunk/Bioma_C/Chunk_C_T3_1.fbx" id="1_fgokx"] -[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Test_Procedurale/info_chunk.gd" id="2_bmm2h"] +[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Scripts/info_chunk.gd" id="2_bmm2h"] [ext_resource type="Material" uid="uid://couj6glsrm6h3" path="res://Materials/Sentiero.tres" id="3_0yqxy"] [ext_resource type="Material" uid="uid://cd34mgvhj1d0r" path="res://Materials/GrassBlockout.tres" id="4_umpqw"] diff --git a/Scenes/Chunk_Scene/Chunk/Campagna/chunk_c_t_3_2.tscn b/Scenes/Chunk_Scene/Chunk/Campagna/chunk_c_t_3_2.tscn index 354f6ef..e5f3167 100644 --- a/Scenes/Chunk_Scene/Chunk/Campagna/chunk_c_t_3_2.tscn +++ b/Scenes/Chunk_Scene/Chunk/Campagna/chunk_c_t_3_2.tscn @@ -1,7 +1,7 @@ [gd_scene format=3 uid="uid://cor3j8w3wewl5"] [ext_resource type="PackedScene" uid="uid://bgbmyk84rks48" path="res://Assets/Meshes/Chunk/Bioma_C/Chunk_C_T3_2.fbx" id="1_d8gt8"] -[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Test_Procedurale/info_chunk.gd" id="2_ojveg"] +[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Scripts/info_chunk.gd" id="2_ojveg"] [ext_resource type="Material" uid="uid://cit5uciejjoou" path="res://Materials/Grass_Chunk.tres" id="2_q2qw3"] [ext_resource type="Material" uid="uid://couj6glsrm6h3" path="res://Materials/Sentiero.tres" id="3_ojveg"] [ext_resource type="Material" uid="uid://cd34mgvhj1d0r" path="res://Materials/GrassBlockout.tres" id="4_qts5w"] diff --git a/Scenes/Chunk_Scene/Chunk/Campagna/chunk_c_t_3_3.tscn b/Scenes/Chunk_Scene/Chunk/Campagna/chunk_c_t_3_3.tscn index 65d754f..3fb72c8 100644 --- a/Scenes/Chunk_Scene/Chunk/Campagna/chunk_c_t_3_3.tscn +++ b/Scenes/Chunk_Scene/Chunk/Campagna/chunk_c_t_3_3.tscn @@ -1,7 +1,7 @@ [gd_scene format=3 uid="uid://bqc1txstk8y5v"] [ext_resource type="PackedScene" uid="uid://bbe7lqa1ayf51" path="res://Assets/Meshes/Chunk/Bioma_C/Chunk_C_T3_3.fbx" id="1_ig2h0"] -[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Test_Procedurale/info_chunk.gd" id="2_o43cy"] +[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Scripts/info_chunk.gd" id="2_o43cy"] [ext_resource type="Material" uid="uid://cit5uciejjoou" path="res://Materials/Grass_Chunk.tres" id="2_ywcu1"] [ext_resource type="Material" uid="uid://couj6glsrm6h3" path="res://Materials/Sentiero.tres" id="3_o43cy"] [ext_resource type="Material" uid="uid://cd34mgvhj1d0r" path="res://Materials/GrassBlockout.tres" id="4_o4cox"] diff --git a/Scenes/Chunk_Scene/Chunk/Campagna/chunk_c_x_1.tscn b/Scenes/Chunk_Scene/Chunk/Campagna/chunk_c_x_1.tscn index 579095f..d78d060 100644 --- a/Scenes/Chunk_Scene/Chunk/Campagna/chunk_c_x_1.tscn +++ b/Scenes/Chunk_Scene/Chunk/Campagna/chunk_c_x_1.tscn @@ -2,7 +2,7 @@ [ext_resource type="PackedScene" uid="uid://bhpk5c2ydvf3m" path="res://Assets/Meshes/Chunk/Bioma_C/Chunk_C_X_1.fbx" id="1_voing"] [ext_resource type="Material" uid="uid://cit5uciejjoou" path="res://Materials/Grass_Chunk.tres" id="2_0cv2v"] -[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Test_Procedurale/info_chunk.gd" id="2_oqrjr"] +[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Scripts/info_chunk.gd" id="2_oqrjr"] [ext_resource type="Material" uid="uid://couj6glsrm6h3" path="res://Materials/Sentiero.tres" id="3_oqrjr"] [ext_resource type="Material" uid="uid://cd34mgvhj1d0r" path="res://Materials/GrassBlockout.tres" id="4_kcdhn"] diff --git a/Scenes/Chunk_Scene/Chunk/Foresta/Chunk_F_L_2.tscn b/Scenes/Chunk_Scene/Chunk/Foresta/Chunk_F_L_2.tscn index 2d76e87..617a305 100644 --- a/Scenes/Chunk_Scene/Chunk/Foresta/Chunk_F_L_2.tscn +++ b/Scenes/Chunk_Scene/Chunk/Foresta/Chunk_F_L_2.tscn @@ -1,7 +1,7 @@ [gd_scene format=4 uid="uid://cpebna545ihfh"] [ext_resource type="PackedScene" uid="uid://bxnd5v67eaypf" path="res://Assets/Meshes/Chunk/Bioma_C/Test_Chunk_C_L_2.fbx" id="1_sr7sh"] -[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Test_Procedurale/info_chunk.gd" id="2_5cl6b"] +[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Scripts/info_chunk.gd" id="2_5cl6b"] [ext_resource type="Material" uid="uid://couj6glsrm6h3" path="res://Materials/Sentiero.tres" id="3_hj70d"] [ext_resource type="Texture2D" uid="uid://3ot7glyivagg" path="res://Assets/Textures/Texture_Sentiero.png" id="4_g8efw"] [ext_resource type="Material" uid="uid://cufolpn48xxmv" path="res://Materials/Treno2.tres" id="5_wgav2"] diff --git a/Scenes/Chunk_Scene/Chunk/Foresta/chunk_F_e_1.tscn b/Scenes/Chunk_Scene/Chunk/Foresta/chunk_F_e_1.tscn index 9e23cd8..7fb85eb 100644 --- a/Scenes/Chunk_Scene/Chunk/Foresta/chunk_F_e_1.tscn +++ b/Scenes/Chunk_Scene/Chunk/Foresta/chunk_F_e_1.tscn @@ -1,7 +1,7 @@ [gd_scene format=3 uid="uid://bi12g5nj421jv"] [ext_resource type="PackedScene" uid="uid://d3loscamahf5y" path="res://Assets/Meshes/Chunk/Bioma_C/Chunk_C_E_1.fbx" id="1_anwxh"] -[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Test_Procedurale/info_chunk.gd" id="2_scq5d"] +[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Scripts/info_chunk.gd" id="2_scq5d"] [ext_resource type="PackedScene" uid="uid://ddupqq1tx1jxu" path="res://Scenes/Test/Tree_Sad.tscn" id="4_cdmr2"] [ext_resource type="PackedScene" uid="uid://d12t04rs47jq3" path="res://Scenes/Test/Tree_V1.tscn" id="5_vyg4h"] diff --git a/Scenes/Chunk_Scene/Chunk/Foresta/chunk_F_f_1.tscn b/Scenes/Chunk_Scene/Chunk/Foresta/chunk_F_f_1.tscn index 2161562..d6eddb7 100644 --- a/Scenes/Chunk_Scene/Chunk/Foresta/chunk_F_f_1.tscn +++ b/Scenes/Chunk_Scene/Chunk/Foresta/chunk_F_f_1.tscn @@ -1,7 +1,7 @@ [gd_scene format=4 uid="uid://boxnrd3pwpjx5"] [ext_resource type="PackedScene" uid="uid://d3loscamahf5y" path="res://Assets/Meshes/Chunk/Bioma_C/Chunk_C_E_1.fbx" id="1_453cn"] -[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Test_Procedurale/info_chunk.gd" id="2_fas56"] +[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Scripts/info_chunk.gd" id="2_fas56"] [ext_resource type="Material" uid="uid://cit5uciejjoou" path="res://Materials/Grass_Chunk.tres" id="3_kllpc"] [ext_resource type="PackedScene" uid="uid://8jtrp8ckqf1a" path="res://Scenes/Chunk_Scene/House/House_muraglione.tscn" id="4_kg6th"] [ext_resource type="PackedScene" uid="uid://5sod22d0vnip" path="res://Scenes/Chunk_Scene/House/House_XL_4.tscn" id="5_gvooa"] diff --git a/Scenes/Chunk_Scene/Chunk/Foresta/chunk_F_l_1.tscn b/Scenes/Chunk_Scene/Chunk/Foresta/chunk_F_l_1.tscn index 985ea12..6224703 100644 --- a/Scenes/Chunk_Scene/Chunk/Foresta/chunk_F_l_1.tscn +++ b/Scenes/Chunk_Scene/Chunk/Foresta/chunk_F_l_1.tscn @@ -1,7 +1,7 @@ [gd_scene format=3 uid="uid://uc4lteo7ebjb"] [ext_resource type="PackedScene" uid="uid://deqp06tkp4orv" path="res://Assets/Meshes/Chunk/Bioma_C/Chunk_C_L_1.fbx" id="1_t2h3f"] -[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Test_Procedurale/info_chunk.gd" id="2_mx3ua"] +[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Scripts/info_chunk.gd" id="2_mx3ua"] [ext_resource type="Material" uid="uid://couj6glsrm6h3" path="res://Materials/Sentiero.tres" id="4_l5m85"] [ext_resource type="Material" uid="uid://cd34mgvhj1d0r" path="res://Materials/GrassBlockout.tres" id="5_l352o"] diff --git a/Scenes/Chunk_Scene/Chunk/Foresta/chunk_F_r_1.tscn b/Scenes/Chunk_Scene/Chunk/Foresta/chunk_F_r_1.tscn index bc18424..da175fb 100644 --- a/Scenes/Chunk_Scene/Chunk/Foresta/chunk_F_r_1.tscn +++ b/Scenes/Chunk_Scene/Chunk/Foresta/chunk_F_r_1.tscn @@ -1,7 +1,7 @@ [gd_scene format=3 uid="uid://51n0mv0hpnu0"] [ext_resource type="PackedScene" uid="uid://bign7y2duatrm" path="res://Assets/Meshes/Chunk/Bioma_C/Chunk_C_R_1.fbx" id="1_w4ilb"] -[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Test_Procedurale/info_chunk.gd" id="2_0ctfe"] +[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Scripts/info_chunk.gd" id="2_0ctfe"] [ext_resource type="Material" uid="uid://couj6glsrm6h3" path="res://Materials/Sentiero.tres" id="4_tgve8"] [ext_resource type="Material" uid="uid://df1ghvw3d61x8" path="res://Materials/Treno1.tres" id="5_e2fgg"] [ext_resource type="Material" uid="uid://cd34mgvhj1d0r" path="res://Materials/GrassBlockout.tres" id="6_iyerk"] diff --git a/Scenes/Chunk_Scene/Chunk/Foresta/chunk_F_t_1_1.tscn b/Scenes/Chunk_Scene/Chunk/Foresta/chunk_F_t_1_1.tscn index 5fce7ce..4162266 100644 --- a/Scenes/Chunk_Scene/Chunk/Foresta/chunk_F_t_1_1.tscn +++ b/Scenes/Chunk_Scene/Chunk/Foresta/chunk_F_t_1_1.tscn @@ -1,7 +1,7 @@ [gd_scene format=3 uid="uid://c0trecscea4xr"] [ext_resource type="PackedScene" uid="uid://c7ax77lnixftt" path="res://Assets/Meshes/Chunk/Bioma_C/Chunk_C_T1_1.fbx" id="1_i7r44"] -[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Test_Procedurale/info_chunk.gd" id="2_177li"] +[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Scripts/info_chunk.gd" id="2_177li"] [ext_resource type="Material" uid="uid://couj6glsrm6h3" path="res://Materials/Sentiero.tres" id="4_gocca"] [ext_resource type="Material" uid="uid://df1ghvw3d61x8" path="res://Materials/Treno1.tres" id="5_u17b2"] [ext_resource type="Material" uid="uid://cd34mgvhj1d0r" path="res://Materials/GrassBlockout.tres" id="6_iaosl"] diff --git a/Scenes/Chunk_Scene/Chunk/Foresta/chunk_F_t_3_1.tscn b/Scenes/Chunk_Scene/Chunk/Foresta/chunk_F_t_3_1.tscn index b3fb5a3..e144fc7 100644 --- a/Scenes/Chunk_Scene/Chunk/Foresta/chunk_F_t_3_1.tscn +++ b/Scenes/Chunk_Scene/Chunk/Foresta/chunk_F_t_3_1.tscn @@ -1,7 +1,7 @@ [gd_scene format=3 uid="uid://bkgfmga5y03wo"] [ext_resource type="PackedScene" uid="uid://0fj7s2vhg2vl" path="res://Assets/Meshes/Chunk/Bioma_C/Chunk_C_T3_1.fbx" id="1_4jfhy"] -[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Test_Procedurale/info_chunk.gd" id="2_0bnc8"] +[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Scripts/info_chunk.gd" id="2_0bnc8"] [ext_resource type="Material" uid="uid://couj6glsrm6h3" path="res://Materials/Sentiero.tres" id="3_vf36v"] [ext_resource type="Material" uid="uid://cd34mgvhj1d0r" path="res://Materials/GrassBlockout.tres" id="4_vlk7m"] diff --git a/Scenes/Chunk_Scene/Chunk/Foresta/chunk_F_t_3_2.tscn b/Scenes/Chunk_Scene/Chunk/Foresta/chunk_F_t_3_2.tscn index 614d735..1f5e17f 100644 --- a/Scenes/Chunk_Scene/Chunk/Foresta/chunk_F_t_3_2.tscn +++ b/Scenes/Chunk_Scene/Chunk/Foresta/chunk_F_t_3_2.tscn @@ -1,7 +1,7 @@ [gd_scene format=3 uid="uid://doa52qwel85w3"] [ext_resource type="PackedScene" uid="uid://bgbmyk84rks48" path="res://Assets/Meshes/Chunk/Bioma_C/Chunk_C_T3_2.fbx" id="1_u7do2"] -[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Test_Procedurale/info_chunk.gd" id="2_ruqbe"] +[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Scripts/info_chunk.gd" id="2_ruqbe"] [ext_resource type="Material" uid="uid://couj6glsrm6h3" path="res://Materials/Sentiero.tres" id="4_dkigq"] [ext_resource type="Material" uid="uid://cd34mgvhj1d0r" path="res://Materials/GrassBlockout.tres" id="5_j3d8l"] [ext_resource type="Material" uid="uid://df1ghvw3d61x8" path="res://Materials/Treno1.tres" id="6_5nlrv"] diff --git a/Scenes/Chunk_Scene/Chunk/Foresta/chunk_F_t_3_3.tscn b/Scenes/Chunk_Scene/Chunk/Foresta/chunk_F_t_3_3.tscn index 7fb8863..04ea4df 100644 --- a/Scenes/Chunk_Scene/Chunk/Foresta/chunk_F_t_3_3.tscn +++ b/Scenes/Chunk_Scene/Chunk/Foresta/chunk_F_t_3_3.tscn @@ -1,7 +1,7 @@ [gd_scene format=3 uid="uid://d16askvk5gdjy"] [ext_resource type="PackedScene" uid="uid://bbe7lqa1ayf51" path="res://Assets/Meshes/Chunk/Bioma_C/Chunk_C_T3_3.fbx" id="1_b25ct"] -[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Test_Procedurale/info_chunk.gd" id="2_t8uks"] +[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Scripts/info_chunk.gd" id="2_t8uks"] [ext_resource type="Material" uid="uid://couj6glsrm6h3" path="res://Materials/Sentiero.tres" id="4_3l5th"] [ext_resource type="Material" uid="uid://cd34mgvhj1d0r" path="res://Materials/GrassBlockout.tres" id="5_3xark"] [ext_resource type="Material" uid="uid://cufolpn48xxmv" path="res://Materials/Treno2.tres" id="6_ckigp"] diff --git a/Scenes/Chunk_Scene/Chunk/Foresta/chunk_F_x_1.tscn b/Scenes/Chunk_Scene/Chunk/Foresta/chunk_F_x_1.tscn index a5cd94c..9c517dd 100644 --- a/Scenes/Chunk_Scene/Chunk/Foresta/chunk_F_x_1.tscn +++ b/Scenes/Chunk_Scene/Chunk/Foresta/chunk_F_x_1.tscn @@ -1,7 +1,7 @@ [gd_scene format=3 uid="uid://c7tntbuu6xauu"] [ext_resource type="PackedScene" uid="uid://bhpk5c2ydvf3m" path="res://Assets/Meshes/Chunk/Bioma_C/Chunk_C_X_1.fbx" id="1_krvni"] -[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Test_Procedurale/info_chunk.gd" id="2_8bqar"] +[ext_resource type="Script" uid="uid://byluxssk112ca" path="res://Scripts/info_chunk.gd" id="2_8bqar"] [ext_resource type="Material" uid="uid://couj6glsrm6h3" path="res://Materials/Sentiero.tres" id="4_d4n6v"] [ext_resource type="Material" uid="uid://cd34mgvhj1d0r" path="res://Materials/GrassBlockout.tres" id="5_dss04"] diff --git a/Scenes/Gameplay.tscn b/Scenes/Gameplay.tscn index 282d6d4..3bb72af 100644 --- a/Scenes/Gameplay.tscn +++ b/Scenes/Gameplay.tscn @@ -2,13 +2,16 @@ [ext_resource type="Script" uid="uid://dcaxomfkulrig" path="res://Scripts/Day_night_Cycle.gd" id="1_cr3ar"] [ext_resource type="Material" uid="uid://dknvdsov2jrg6" path="res://Materials/Fog.tres" id="2_4xv0h"] +[ext_resource type="Material" uid="uid://cwbxvmtih5wsc" path="res://Materials/GodRays.tres" id="2_vpybn"] [ext_resource type="Material" uid="uid://7bu5f4o0v8vw" path="res://Materials/Rain.tres" id="3_4wepm"] +[ext_resource type="Material" uid="uid://cknq8qhom7ral" path="res://Materials/ShadowPostProcess.tres" id="4_00nhk"] [ext_resource type="Texture2D" uid="uid://v4gyjc8j7ygj" path="res://Assets/Textures/Lightingl.png" id="4_gffi5"] [ext_resource type="Shader" uid="uid://l6rkqonic7dj" path="res://Shaders/Sky.gdshader" id="5_bedag"] +[ext_resource type="FastNoiseLite" uid="uid://c0mtwrkptjcuw" path="res://Assets/Textures/Noise_Clouds.tres" id="6_00nhk"] [ext_resource type="Texture2D" uid="uid://dxahudyvihk8b" path="res://Assets/Textures/Stars.png" id="6_jawsd"] [ext_resource type="Script" uid="uid://brcimd12tx3dm" path="res://Scripts/edge_detection_compositor.gd" id="7_4xv0h"] [ext_resource type="Texture2D" uid="uid://dey5onb6mwp3f" path="res://Assets/Textures/leaf_particle.png" id="7_vufuq"] -[ext_resource type="Script" uid="uid://c5xr1w2tvcxl1" path="res://Scenes/generatore_bioma.gd" id="8_7j5hj"] +[ext_resource type="Script" uid="uid://c5xr1w2tvcxl1" path="res://Scripts/generatore_bioma.gd" id="8_7j5hj"] [ext_resource type="Script" uid="uid://b8x6nf7u6iopv" path="res://Scripts/CameraMove.gd" id="8_17jdd"] [ext_resource type="PackedScene" uid="uid://bx2amm4q66ei" path="res://Scenes/MainMap.tscn" id="8_bedag"] [ext_resource type="Script" uid="uid://bhdoxc2oak88u" path="res://Scripts/palette_manager.gd" id="8_gffi5"] @@ -58,13 +61,8 @@ [ext_resource type="PackedScene" uid="uid://bhcut7ndtdo2w" path="res://Assets/Test/SK_Mannequin.FBX" id="34_3nw1o"] [ext_resource type="PackedScene" uid="uid://xebpudhewwwj" path="res://Scenes/Chunk_Scene/Chunk/Campagna/Chunk_C_L_2.tscn" id="35_n33lw"] -[sub_resource type="FastNoiseLite" id="FastNoiseLite_jfpsf"] -fractal_lacunarity = 1.915 -fractal_gain = 0.53 -fractal_weighted_strength = 0.35 - [sub_resource type="NoiseTexture2D" id="NoiseTexture2D_10fbe"] -noise = SubResource("FastNoiseLite_jfpsf") +noise = ExtResource("6_00nhk") seamless = true [sub_resource type="ShaderMaterial" id="ShaderMaterial_h0pi8"] @@ -130,6 +128,9 @@ metadata/_custom_type_script = "uid://brcimd12tx3dm" [sub_resource type="Compositor" id="Compositor_17jdd"] compositor_effects = Array[CompositorEffect]([SubResource("CompositorEffect_vufuq")]) +[sub_resource type="QuadMesh" id="QuadMesh_00nhk"] +size = Vector2(2, 2) + [sub_resource type="Curve" id="Curve_o35ae"] _limits = [-360.0, 360.0, 0.0, 1.0] _data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0] @@ -229,6 +230,9 @@ material = SubResource("ShaderMaterial_gpe07") subdivide_depth = 3 orientation = 1 +[sub_resource type="PlaneMesh" id="PlaneMesh_vpybn"] +size = Vector2(2, 10) + [sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_qqnw7"] particle_flag_align_y = true emission_shape_scale = Vector3(70, 70, 70) @@ -247,12 +251,13 @@ material = ExtResource("3_4wepm") size = Vector2(0.05, 1) [sub_resource type="Curve3D" id="Curve3D_bedag"] +closed = true bake_interval = 50.0 _data = { -"points": PackedVector3Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, 120, 0, 0, 0, 0, 0, 0, -4.372, 0, 140, 0, 0, 0, 0, 0, 0, -20.963, 0, 160, 0, 0, 0, 0, 0, 0, -40.62518, 0, 168.52754, 0, 0, 0, 0, 0, 0, -60, 0, 170, 0, 0, 0, 0, 0, 0, -80, 0, 170, 0, 0, 0, 0, 0, 0, -100, 0, 170, 0, 0, 0, 0, 0, 0, -120.42937, 0, 171.50279, 0, 0, 0, 0, 0, 0, -141.41747, 7.6293945e-06, 180.5982, 0, 0, 0, 0, 0, 0, -155.77005, 7.6293945e-06, 198.35184, 0, 0, 0, 0, 0, 0, -160.14105, 7.6293945e-06, 219.80951, 0, 0, 0, 0, 0, 0, -163.99007, 7.6293945e-06, 239.36005, 0, 0, 0, 0, 0, 0, -175.77509, 7.6293945e-06, 256.16028, 0, 0, 0, 0, 0, 0, -195.62283, 7.6293945e-06, 267.46912, 0, 0, 0, 0, 0, 0, -219.9999, 7.6293945e-06, 270.11758, 0, 0, 0, 0, 0, 0, -240, 0, 270.118, 0, 0, 0, 0, 0, 0, -260, 0, 270.118, 0, 0, 0, 0, 0, 0, -275.19666, 7.6293945e-06, 270.55228, 0, 0, 0, 0, 0, 0, -294.2925, 7.6293945e-06, 276.05307, 0, 0, 0, 0, 0, 0, -307.19006, 7.6293945e-06, 286.9095, 0, 0, 0, 0, 0, 0, -317.32443, 7.6293945e-06, 303.14682, 0, 0, 0, 0, 0, 0, -320, 0, 320, 0, 0, 0, 0, 0, 0, -320, 0, 340, 0, 0, 0, 0, 0, 0, -320, 0, 360, 0, 0, 0, 0, 0, 0, -320, 0, 380, 0, 0, 0, 0, 0, 0, -316.78876, 7.6293945e-06, 396.91193, 0, 0, 0, 0, 0, 0, -307.68207, 7.6293945e-06, 412.70596, 0, 0, 0, 0, 0, 0, -291.08273, 7.6293945e-06, 424.7491, 0, 0, 0, 0, 0, 0, -270, 0, 429.994, 0, 0, 0, 0, 0, 0, -250, 0, 429.994), -"tilts": PackedFloat32Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) +"points": PackedVector3Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, 120, 0, 0, 0, 0, 0, 0, -4.372, 0, 140, 0, 0, 0, 0, 0, 0, -20.963, 0, 160, 0, 0, 0, 0, 0, 0, -40.62518, 0, 168.52754, 0, 0, 0, 0, 0, 0, -60, 0, 170, 0, 0, 0, 0, 0, 0, -80, 0, 170, 0, 0, 0, 0, 0, 0, -100, 0, 170, 0, 0, 0, 0, 0, 0, -120.42937, 0, 171.50279, 0, 0, 0, 0, 0, 0, -141.41747, 7.6293945e-06, 180.5982, 0, 0, 0, 0, 0, 0, -155.77005, 7.6293945e-06, 198.35184, 0, 0, 0, 0, 0, 0, -160.14105, 7.6293945e-06, 219.80951, 0, 0, 0, 0, 0, 0, -163.99007, 7.6293945e-06, 239.36005, 0, 0, 0, 0, 0, 0, -175.77509, 7.6293945e-06, 256.16028, 0, 0, 0, 0, 0, 0, -195.62283, 7.6293945e-06, 267.46912, 0, 0, 0, 0, 0, 0, -219.9999, 7.6293945e-06, 270.11758, 0, 0, 0, 0, 0, 0, -240, 0, 270.118, 0, 0, 0, 0, 0, 0, -260, 0, 270.118, 0, 0, 0, 0, 0, 0, -275.19666, 7.6293945e-06, 270.55228, 0, 0, 0, 0, 0, 0, -294.2925, 7.6293945e-06, 276.05307, 0, 0, 0, 0, 0, 0, -307.19006, 7.6293945e-06, 286.9095, 0, 0, 0, 0, 0, 0, -317.32443, 7.6293945e-06, 303.14682, 0, 0, 0, 0, 0, 0, -320, 0, 320, 0, 0, 0, 0, 0, 0, -320, 0, 340, 0, 0, 0, 0, 0, 0, -320, 0, 360, 0, 0, 0, 0, 0, 0, -320, 0, 380, 0, 0, 0, 0, 0, 0, -316.78876, 7.6293945e-06, 396.91193, 0, 0, 0, 0, 0, 0, -307.68207, 7.6293945e-06, 412.70596, 0, 0, 0, 0, 0, 0, -291.08273, 7.6293945e-06, 424.7491, 0, 0, 0, 0, 0, 0, -270, 0, 429.994, 0, 0, 0, 0, 0, 0, -250, 0, 429.994, 0, 0, 0, 0, 0, 0, -229.90146, 7.6293945e-06, 433.90823, 0, 0, 0, 0, 0, 0, -217.15442, 7.6293945e-06, 442.98242, 0, 0, 0, 0, 0, 0, -204.60803, 7.6293945e-06, 459.93704, 0, 0, 0, 0, 0, 0, -200, 0, 480, 0, 0, 0, 0, 0, 0, -200, 0, 500, 0, 0, 0, 0, 0, 0, -195.5338, 7.6293945e-06, 520.0368, 0, 0, 0, 0, 0, 0, -184.9173, 7.6293945e-06, 535.07776, 0, 0, 0, 0, 0, 0, -170.36423, 7.6293945e-06, 545.0799, 0, 0, 0, 0, 0, 0, -150.56184, 0, 549.8127, 0, 0, 0, 0, 0, 0, -130, 0, 550, 0, 0, 0, 0, 0, 0, -110, 0, 550, 0, 0, 0, 0, 0, 0, -90, 0, 550, 0, 0, 0, 0, 0, 0, -70, 0, 550, 0, 0, 0, 0, 0, 0, -50, 0, 550, 0, 0, 0, 0, 0, 0, -29.862535, 7.6293945e-06, 545.3371, 0, 0, 0, 0, 0, 0, -13.215244, 7.6293945e-06, 533.0626, 0, 0, 0, 0, 0, 0, -4.098665, 7.6293945e-06, 519.6814, 0, 0, 0, 0, 0, 0, -0.048213482, 7.6293945e-06, 500.107, 0, 0, 0, 0, 0, 0, 3.7920675, 7.6293945e-06, 480.64902, 0, 0, 0, 0, 0, 0, 13.513225, 7.6293945e-06, 465.9133, 0, 0, 0, 0, 0, 0, 29.76715, 7.6293945e-06, 454.41486, 0, 0, 0, 0, 0, 0, 49.711926, 7.6293945e-06, 450.12488, 0, 0, 0, 0, 0, 0, 70, 0, 450, 0, 0, 0, 0, 0, 0, 90, 0, 450, 0, 0, 0, 0, 0, 0, 110.055405, 7.6293945e-06, 445.42627, 0, 0, 0, 0, 0, 0, 126.975784, 7.6293945e-06, 432.8683, 0, 0, 0, 0, 0, 0, 136.95703, 7.6293945e-06, 417.5506, 0, 0, 0, 0, 0, 0, 140, 0, 400, 0, 0, 0, 0, 0, 0, 140, 0, 380, 0, 0, 0, 0, 0, 0, 140, 0, 360, 0, 0, 0, 0, 0, 0, 140, 0, 340, 0, 0, 0, 0, 0, 0, 140, 0, 320, 0, 0, 0, 0, 0, 0, 140, 0, 300, 0, 0, 0, 0, 0, 0, 140, 0, 280, 0, 0, 0, 0, 0, 0, 140, 0, 260, 0, 0, 0, 0, 0, 0, 140, 0, 240, 0, 0, 0, 0, 0, 0, 140, 0, 220, 0, 0, 0, 0, 0, 0, 140, 0, 200, 0, 0, 0, 0, 0, 0, 140, 0, 180, 0, 0, 0, 0, 0, 0, 140, 0, 160, 0, 0, 0, 0, 0, 0, 140, 0, 140, 0, 0, 0, 0, 0, 0, 140, 0, 120, 0, 0, 0, 0, 0, 0, 140, 0, 100, 0, 0, 0, 0, 0, 0, 140, 0, 80, 0, 0, 0, 0, 0, 0, 140, 0, 60, 0, 0, 0, 0, 0, 0, 140, 0, 40, 0, 0, 0, 0, 0, 0, 140, 0, 20, 0, 0, 0, 0, 0, 0, 140, 0, 0, 0, 0, 0, 0, 0, 0, 136.2151, 7.6293945e-06, -18.930761, 0, 0, 0, 0, 0, 0, 124.47424, 7.6293945e-06, -35.771675, 0, 0, 0, 0, 0, 0, 109.556854, 7.6293945e-06, -45.911987, 0, 0, 0, 0, 0, 0, 90, 0, -50, 0, 0, 0, 0, 0, 0, 70, 0, -50, 0, 0, 0, 0, 0, 0, 50, 0, -50, 0, 0, 0, 0, 0, 0, 30.626865, 7.6293945e-06, -46.35706, 0, 0, 0, 0, 0, 0, 14.519331, 7.6293945e-06, -35.468895, 0, 0, 0, 0, 0, 0, 3.52941, 7.6293945e-06, -19.590664), +"tilts": PackedFloat32Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) } -point_count = 36 +point_count = 93 [sub_resource type="PlaneMesh" id="PlaneMesh_gsfny"] @@ -679,6 +684,12 @@ sky_horizon_pomeriggio = Color(0.58704865, 0.36022854, 0.09941775, 1) energia_luce_notte = 0.998 materiale_nebbia = ExtResource("2_4xv0h") materiale_pioggia_gocce = ExtResource("3_4wepm") +materiale_nuvole = ExtResource("4_00nhk") +colore_fulmine = Color(0.99999946, 0.9857114, 0.46342158, 1) +fulmini_min = 2 +fulmini_max = 4 +scala_min_fulmine = 2.0 +scala_max_fulmine = 5.0 [node name="CanvasLayer" type="CanvasLayer" parent="." unique_id=427161585] @@ -699,13 +710,6 @@ grow_vertical = 0 transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -21.428604, -6.3361816, 43.268837) size = Vector3(51.92697, 11.827637, 85.98999) -[node name="SpriteFulmine" type="Sprite3D" parent="." unique_id=1820121693] -transform = Transform3D(4, 0, 0, 0, 7.32, 0, 0, 0, 7.3, 0, 17.324, 30.411049) -modulate = Color(1, 1, 1, 0) -billboard = 2 -alpha_cut = 1 -texture = ExtResource("4_gffi5") - [node name="LuceLampo" type="DirectionalLight3D" parent="." unique_id=2067456343] transform = Transform3D(-0.6238797, -0.342596, 0.7024259, 0, 0.89879405, 0.43837115, -0.7815204, 0.27349085, -0.56073934, 0, 0, 30.411049) light_color = Color(0.8, 1, 1, 1) @@ -716,7 +720,7 @@ shadow_enabled = true transform = Transform3D(0.4848096, 0.6108477, 0.62595904, -6.256785e-08, -0.71569276, 0.6984152, 0.8746197, -0.33859846, -0.34697473, 0, 4.540125, 24.469929) shadow_enabled = true shadow_bias = 0.2 -shadow_opacity = 0.9 +shadow_opacity = 0.8 shadow_blur = 0.0 directional_shadow_mode = 0 directional_shadow_fade_start = 0.9 @@ -746,11 +750,17 @@ render_target_update_mode = 4 [node name="World" type="Node3D" parent="SubViewportContainer/SubViewport" unique_id=735268770] +[node name="FiltroOmbreGlobali" type="MeshInstance3D" parent="SubViewportContainer/SubViewport/World" unique_id=605840663] +extra_cull_margin = 16384.0 +mesh = SubResource("QuadMesh_00nhk") +surface_material_override/0 = ExtResource("4_00nhk") + [node name="GeneratoreBioma" type="Node3D" parent="SubViewportContainer/SubViewport/World" unique_id=757461529 node_paths=PackedStringArray("path_treno")] script = ExtResource("8_7j5hj") path_treno = NodePath("../Path3D") bioma_campagna = Array[PackedScene]([ExtResource("9_u10x4"), ExtResource("10_l1dl0"), ExtResource("35_n33lw"), ExtResource("12_kjb07"), ExtResource("13_on20a"), ExtResource("14_6k3cw"), ExtResource("15_16mw0"), ExtResource("16_qdxup"), ExtResource("17_tbvi6")]) bioma_foresta = Array[PackedScene]([ExtResource("18_4udcq"), ExtResource("19_vj0n5"), ExtResource("20_00nhk"), ExtResource("21_vpybn"), ExtResource("22_5lko7"), ExtResource("23_j2rq4"), ExtResource("24_eyx0r"), ExtResource("25_vmtna"), ExtResource("26_am4st")]) +scala_distretti = 0.08 [node name="MainMap" parent="SubViewportContainer/SubViewport/World" unique_id=1895741703 instance=ExtResource("8_bedag")] transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 0, 0, 0) @@ -781,6 +791,20 @@ draw_pass_1 = SubResource("QuadMesh_twefy") [node name="Camere" type="Node3D" parent="SubViewportContainer/SubViewport/World" unique_id=1348180511] +[node name="MeshInstance3D" type="MeshInstance3D" parent="SubViewportContainer/SubViewport/World/Camere" unique_id=70247470] +transform = Transform3D(2.9879434, -2.3589852, 4.245042, -2.4571407, -1.9655121e-07, 5.760314, -1.0171789, -6.929473, -1.4451305, 18.895258, 25.821028, 0) +visible = false +mesh = SubResource("PlaneMesh_vpybn") +skeleton = NodePath("../SpriteFulmine") +surface_material_override/0 = ExtResource("2_vpybn") + +[node name="SpriteFulmine" type="Sprite3D" parent="SubViewportContainer/SubViewport/World/Camere" unique_id=1820121693] +transform = Transform3D(4, 0, 0, 0, 7.32, 0, 0, 0, 7.3, 0, 17.324, 30.411049) +modulate = Color(1, 1, 1, 0) +billboard = 2 +alpha_cut = 1 +texture = ExtResource("4_gffi5") + [node name="PioggiaCadente" type="GPUParticles3D" parent="SubViewportContainer/SubViewport/World/Camere" unique_id=1150140046] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 30.411049) cast_shadow = 0 @@ -791,7 +815,7 @@ process_material = SubResource("ParticleProcessMaterial_qqnw7") draw_pass_1 = SubResource("QuadMesh_54p3t") [node name="CameraFrontale" type="Camera3D" parent="SubViewportContainer/SubViewport/World/Camere" unique_id=1311130431] -transform = Transform3D(-1, 0, 8.742278e-08, 0, 1, 0, -8.742278e-08, 0, -1, 0, 2.55, 7.5862045) +transform = Transform3D(-1, 0, 8.742278e-08, 0, 1, 0, -8.742278e-08, 0, -1, 0, 2.55, 7.102539) fov = 86.0 size = 8.692 near = 0.001 @@ -805,12 +829,12 @@ near = 0.001 far = 5000.0 [node name="CameraLaterale" type="Camera3D" parent="SubViewportContainer/SubViewport/World/Camere" unique_id=1451175697] -transform = Transform3D(-0.18395132, 0, 0.98293537, 0, 1, 0, -0.98293537, 0, -0.18395132, -0.68400574, 2.257, 2.8508348) +transform = Transform3D(-0.18395132, 0, 0.98293537, 0, 1, 0, -0.98293537, 0, -0.18395132, -0.57942104, 2.257, 2.7764177) fov = 60.0 size = 8.692 [node name="CameraLaterale2" type="Camera3D" parent="SubViewportContainer/SubViewport/World/Camere" unique_id=1248525079] -transform = Transform3D(-4.371139e-08, 0.005235964, -0.9999863, 0, 0.9999863, 0.005235964, 1, 2.2887126e-10, -4.3710788e-08, 0.41860962, 2.207, 2.814024) +transform = Transform3D(-4.371139e-08, 0.005235964, -0.9999863, 0, 0.9999863, 0.005235964, 1, 2.2887126e-10, -4.3710788e-08, 0.89004993, 2.207, 2.814024) fov = 96.6 size = 15.0 far = 5000.0 @@ -876,7 +900,7 @@ skeleton = NodePath("../../../../..") surface_material_override/0 = ExtResource("2_4xv0h") [node name="MeshInstance3D24" type="MeshInstance3D" parent="SubViewportContainer/SubViewport/World/Fog" unique_id=1013039618] -transform = Transform3D(-0.0005423392, -0.37123534, 6.900085e-09, -5.620008e-23, -1.6227206e-08, -0.15785554, 1.0714161, -0.00018791536, 3.4927482e-12, -0.17415822, 0.027557772, 2.2087526) +transform = Transform3D(-0.0005423392, -0.37123534, 6.900085e-09, -5.620008e-23, -1.6227206e-08, -0.15785554, 1.0714161, -0.00018791536, 3.4927482e-12, -0.11607209, 0.027557772, 2.2087526) mesh = SubResource("PlaneMesh_gsfny") skeleton = NodePath("../../../../..") surface_material_override/0 = ExtResource("2_4xv0h") @@ -1042,7 +1066,7 @@ skeleton = NodePath("../../../../..") surface_material_override/0 = SubResource("ShaderMaterial_xjipq") [node name="MeshInstance3D17" type="MeshInstance3D" parent="SubViewportContainer/SubViewport/World/Fondali" unique_id=969086818] -transform = Transform3D(-0.01834004, 0, 1.0015494, 0, 0.08176457, 0, -0.2723837, 0, -0.06743593, 0.0008721038, -0.34356952, 0.57443184) +transform = Transform3D(-0.01834004, 0, 1.0015494, 0, 0.08176457, 0, -0.27238372, 0, -0.067435935, 0.08823083, -0.34356952, 0.57443184) mesh = SubResource("QuadMesh_jfpsf") skeleton = NodePath("../../../../..") surface_material_override/0 = SubResource("ShaderMaterial_xjipq") diff --git a/Scenes/camera_subpixel.gd b/Scenes/camera_subpixel.gd deleted file mode 100644 index 7108384..0000000 --- a/Scenes/camera_subpixel.gd +++ /dev/null @@ -1,29 +0,0 @@ -extends Camera3D - -@export var pixel_art_resolution := Vector2(320, 180) # Change to your low-res viewport size - -func _process(_delta: float) -> void: - if projection != Camera3D.PROJECTION_ORTHOGONAL: - push_warning("Camera snapping script requires Orthogonal projection!") - return - - # 1. Reset offsets to 0 first so they don't compound from the last frame - h_offset = 0.0 - v_offset = 0.0 - - # 2. Get the exact 2D screen position of the camera's 3D origin - var exact_screen_pos := unproject_position(global_position) - - # 3. Find the nearest perfect integer pixel coordinate - var snapped_screen_pos := exact_screen_pos.round() - - # 4. Calculate the sub-pixel difference (the floating-point remainder) - var subpixel_diff := exact_screen_pos - snapped_screen_pos - - # 5. Convert 1 pixel into 3D world units based on your orthogonal size - var units_per_pixel: float = size / pixel_art_resolution.y - - # 6. Counteract the movement by shifting the camera's rendering frustum - # (Y is inverted because Godot's 2D screen Y goes down, but 3D world Y goes up) - h_offset = subpixel_diff.x * units_per_pixel - v_offset = -subpixel_diff.y * units_per_pixel diff --git a/Scenes/camera_subpixel.gd.uid b/Scenes/camera_subpixel.gd.uid deleted file mode 100644 index e4dde8b..0000000 --- a/Scenes/camera_subpixel.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://clj8j1acbg8ds diff --git a/Scripts/Binari.gd b/Scripts/Binari.gd index b8e49e7..7914768 100644 --- a/Scripts/Binari.gd +++ b/Scripts/Binari.gd @@ -221,13 +221,9 @@ func _gestione_movimento_treno(delta: float) -> void: treno_istanziato.rotate_y(PI) if gruppo_camere: - gruppo_camere.global_position = gruppo_camere.global_position.lerp(pos_centro, delta * 12.0) - - # Usiamo orthonormalized() per pulire le micro-imperfezioni matematiche - var rot_cam = gruppo_camere.global_basis.orthonormalized().get_rotation_quaternion() - var rot_treno = treno_istanziato.global_basis.orthonormalized().get_rotation_quaternion() - - gruppo_camere.global_basis = Basis(rot_cam.slerp(rot_treno, delta * 8.0)) + # Nessun ritardo, nessuna molla: posizione e rotazione sono incollate a quelle del treno! + gruppo_camere.global_position = pos_centro + gruppo_camere.global_basis = treno_istanziato.global_basis if not fermata_in_corso: var vel_reale = abs(velocita_treno * moltiplicatore_stazione) diff --git a/Scripts/Day_night_Cycle.gd b/Scripts/Day_night_Cycle.gd index 35e1a41..a4cba78 100644 --- a/Scripts/Day_night_Cycle.gd +++ b/Scripts/Day_night_Cycle.gd @@ -1,5 +1,7 @@ extends Node3D + + @export_group("Luce Direzionale e Ambiente") @export var color_mattina: Color = Color(1.0, 0.9, 0.8, 1.0) @export var color_pomeriggio: Color = Color(1.0, 0.6, 0.2, 1.0) @@ -21,8 +23,11 @@ extends Node3D @export_range(0.0, 1.0) var energia_luce_notte: float = 0.3 @export_group("Materiali Extra") + @export var materiale_nebbia: ShaderMaterial @export var materiale_pioggia_gocce: StandardMaterial3D +# --- NUOVA VARIABILE PER LE NUVOLE --- +@export var materiale_nuvole: ShaderMaterial @export_group("Meteo (Pioggia & Fulmini)") @export var colore_mood_pioggia: Color = Color(0.5, 0.6, 0.7, 1.0) @@ -46,7 +51,7 @@ extends Node3D # --- NODI FULMINE --- @onready var luce_lampo: DirectionalLight3D = $LuceLampo -@onready var sprite_fulmine: Sprite3D = $SpriteFulmine +@onready var sprite_fulmine: Sprite3D = $SubViewportContainer/SubViewport/World/Camere/SpriteFulmine var tween_giorno: Tween var is_raining: bool = false @@ -107,6 +112,10 @@ func _on_giornata_selezionata(index: int) -> void: tween_giorno = create_tween() tween_giorno.set_trans(Tween.TRANS_SINE).set_ease(Tween.EASE_IN_OUT) tween_giorno.tween_property(self, "tempo_giorno", target_tempo, durata_transizione) + + + + func _on_pioggia_toggled(toggled_on: bool) -> void: # Se l'utente clicca il bottone della pioggia a mano, spegni la cinematic mode @@ -117,6 +126,9 @@ func _on_pioggia_toggled(toggled_on: bool) -> void: is_raining = toggled_on if particelle_pioggia: particelle_pioggia.emitting = is_raining + + + func _process(delta: float) -> void: # --- LOGICA EVENTI CASUALI CINEMATIC MODE --- @@ -124,7 +136,6 @@ func _process(delta: float) -> void: timer_cinematic_env -= delta if timer_cinematic_env <= 0.0: _genera_evento_meteo_casuale() - # Reset timer con un po' di casualità per non renderlo troppo robotico timer_cinematic_env = randf_range(intervallo_eventi_meteo * 0.8, intervallo_eventi_meteo * 1.5) # --- LOGICA NORMALE AMBIENTE --- @@ -141,6 +152,14 @@ func _process(delta: float) -> void: _resetta_timer_fulmine() else: intensita_pioggia = move_toward(intensita_pioggia, 0.0, delta * 0.5) + + # --- LOGICA NUVOLE: SI ADDENSANO CON LA PIOGGIA --- + if materiale_nuvole: + # lerp fa una transizione fluida tra 0.4 (limpido) e 1.0 (coperto) in base all'intensità della pioggia + var densita_attuale = lerp(0.4, 1.0, intensita_pioggia) + materiale_nuvole.set_shader_parameter("cloud_density", densita_attuale) + var sharpness_attuale = lerp(0.14, 0.0, intensita_pioggia) + materiale_nuvole.set_shader_parameter("center_sharpness", sharpness_attuale) if tempo_giorno <= 2.0: var t = tempo_giorno - 1.0 @@ -187,39 +206,36 @@ func _process(delta: float) -> void: # --- FUNZIONE GENERATORE CASUALE --- func _genera_evento_meteo_casuale() -> void: - sto_cambiando_in_cinematic = true # Avvisiamo il codice che stiamo facendo modifiche "automatiche" + sto_cambiando_in_cinematic = true var scelta = randi() % 3 if scelta == 0: - # Cambia orario var nuovo_orario = randi() % 3 if menu_giornata: menu_giornata.selected = nuovo_orario _on_giornata_selezionata(nuovo_orario) elif scelta == 1: - # Cambia meteo (accende o spegne la pioggia) var piove = randf() > 0.5 if bottone_pioggia: bottone_pioggia.set_pressed_no_signal(piove) _on_pioggia_toggled(piove) elif scelta == 2: - # Forza un fulmine (se non piove, fa iniziare a piovere per dare senso al fulmine!) if not is_raining: if bottone_pioggia: bottone_pioggia.set_pressed_no_signal(true) _on_pioggia_toggled(true) _scatena_fulmine() - sto_cambiando_in_cinematic = false # Fine modifiche automatiche + sto_cambiando_in_cinematic = false # --- FUNZIONI FULMINI --- - func _resetta_timer_fulmine() -> void: timer_prossimo_fulmine = randf_range(tempo_min_fulmine, tempo_max_fulmine) +# --- FUNZIONI FULMINI --- func _scatena_fulmine() -> void: if luce_lampo: var tween_luce = create_tween() @@ -235,9 +251,13 @@ func _scatena_fulmine() -> void: for i in numero_scariche: if sprite_fulmine: - var angolo_casuale = randf() * PI * 2.0 - var distanza = 20.0 - sprite_fulmine.position = Vector3(cos(angolo_casuale) * distanza, 20.0, sin(angolo_casuale) * distanza) + var angolo_casuale = randf() * TAU + var distanza = randf_range(10.0, 40.0) + + # Ho abbassato la Y da 20.0 a 10.0. Se non lo vedi ancora, abbassala a 5.0! + sprite_fulmine.position = Vector3(cos(angolo_casuale) * distanza, 10.0, sin(angolo_casuale) * distanza) + + # VIA LA RIGA LOOK_AT! Ci pensa il Billboard dell'Inspector ora. sprite_fulmine.modulate = colore_fulmine sprite_fulmine.modulate.a = 1.0 @@ -246,8 +266,11 @@ func _scatena_fulmine() -> void: sprite_fulmine.scale = Vector3(s, s, s) var tween_sprite = create_tween() - tween_sprite.tween_interval(0.1) - tween_sprite.tween_property(sprite_fulmine, "modulate:a", 0.0, 0.2) + # Ora rimane visibile al 100% per 0.2 secondi (il doppio) + tween_sprite.tween_interval(0.2) + # Ora ci mette 0.4 secondi a svanire dolcemente (il doppio) + tween_sprite.tween_property(sprite_fulmine, "modulate:a", 0.0, 0.4) if numero_scariche > 1: await get_tree().create_timer(randf_range(0.05, 0.15)).timeout + # --- FUNZIONI GOD RAYS --- diff --git a/Scenes/generatore_bioma.gd b/Scripts/generatore_bioma.gd similarity index 66% rename from Scenes/generatore_bioma.gd rename to Scripts/generatore_bioma.gd index 61bdc58..3c85ae2 100644 --- a/Scenes/generatore_bioma.gd +++ b/Scripts/generatore_bioma.gd @@ -17,9 +17,12 @@ var scacchiera: Dictionary = {} var ultima_pos_griglia_treno: Vector2i = Vector2i(999999, 999999) var generatore_rumore: FastNoiseLite -# Variabile per il Toggle del terzo bioma var usa_terzo_bioma: bool = true +# --- VARIABILI PER L'INTERFACCIA A SCHERMO --- +var lbl_bioma: Label +var lbl_distanza: Label + func _ready() -> void: if bioma_campagna.is_empty() or path_treno == null: print("❌ ERRORE: Assegna almeno il 'Bioma Campagna' e il 'Path Treno' nell'Inspector!") @@ -30,17 +33,55 @@ func _ready() -> void: generatore_rumore.seed = randi() generatore_rumore.frequency = scala_distretti + # Creiamo l'interfaccia a schermo! + _crea_ui_gps() + print("✅ Generatore a Distretti Dinamici Pronto.") print("Premere il tasto 'B' per abilitare/disabilitare il terzo bioma.") +# --- NUOVA FUNZIONE: CREA LE SCRITTE A SCHERMO --- +# --- NUOVA FUNZIONE: CREA LE SCRITTE A SCHERMO (CORRETTA) --- +# --- NUOVA FUNZIONE: CREA LE SCRITTE A SCHERMO --- +func _crea_ui_gps() -> void: + var canvas = CanvasLayer.new() + canvas.layer = 10 + add_child(canvas) + + var margin = MarginContainer.new() + margin.set_anchors_preset(Control.PRESET_FULL_RECT) + margin.add_theme_constant_override("margin_top", 20) + margin.add_theme_constant_override("margin_right", 20) + canvas.add_child(margin) + + var vbox = VBoxContainer.new() + vbox.size_flags_horizontal = Control.SIZE_SHRINK_END + margin.add_child(vbox) + + # --- SCRITTA BIOMA ATTUALE (Titolo) --- + lbl_bioma = Label.new() + lbl_bioma.add_theme_font_size_override("font_size", 10) # <--- QUI CAMBI LA GRANDEZZA (Prima era 26) + lbl_bioma.add_theme_color_override("font_color", Color(1, 0.9, 0.4)) + lbl_bioma.add_theme_color_override("font_outline_color", Color.BLACK) + lbl_bioma.add_theme_constant_override("outline_size", 3) # Ho ridotto anche il bordo nero per non impastare il testo piccolo + lbl_bioma.text = "📍 Avvio GPS..." + vbox.add_child(lbl_bioma) + + # --- SCRITTA METRI MANCANTI (Sottotitolo) --- + lbl_distanza = Label.new() + lbl_distanza.add_theme_font_size_override("font_size", 8) # <--- QUI CAMBI LA GRANDEZZA (Prima era 20) + lbl_distanza.add_theme_color_override("font_outline_color", Color.BLACK) + lbl_distanza.add_theme_constant_override("outline_size", 3) # Bordo ridotto proporzionalmente + lbl_distanza.text = "Calcolo tragitto..." + vbox.add_child(lbl_distanza) + + _radar_bioma_treno() + func _input(event: InputEvent) -> void: if event is InputEventKey and event.pressed and not event.echo: if event.keycode == KEY_B: usa_terzo_bioma = !usa_terzo_bioma - if usa_terzo_bioma: - print("🌍 Terzo Bioma: ATTIVATO") - else: - print("🌍 Terzo Bioma: DISATTIVATO (La mappa si ferma alla Foresta)") + # E forziamo un aggiornamento del radar per aggiornare le scritte subito + _radar_bioma_treno() func _physics_process(_delta: float) -> void: if path_treno == null or path_treno.treno_istanziato == null: return @@ -54,7 +95,7 @@ func _physics_process(_delta: float) -> void: ultima_pos_griglia_treno = pos_attuale _genera_attorno_al_treno(pos_attuale) - # Accendiamo il GPS + # Il treno ha fatto 20 metri (ha cambiato cella), quindi aggiorniamo il GPS a schermo! _radar_bioma_treno() func _genera_attorno_al_treno(centro: Vector2i) -> void: @@ -64,43 +105,26 @@ func _genera_attorno_al_treno(centro: Vector2i) -> void: if not scacchiera.has(pos_griglia): var ce_ostacolo = _registra_cella_con_laser(pos_griglia) - if not ce_ostacolo: _piazza_bioma_compatibile(pos_griglia) -# --- SCELTA DEI CATALOGHI CON IL 50/50 MATEMATICO --- func _scegli_catalogo_per_cella(pos_griglia: Vector2i) -> Array[PackedScene]: var valore = generatore_rumore.get_noise_2d(pos_griglia.x, pos_griglia.y) var nome_bioma_scelto = _get_nome_bioma(valore) var catalogo_scelto: Array[PackedScene] = [] - if nome_bioma_scelto == "Campagna": - catalogo_scelto = bioma_campagna - - elif nome_bioma_scelto == "Misto Campagna-Foresta": - # Lancia la moneta: 50% Campagna, 50% Foresta - catalogo_scelto = bioma_campagna if randf() > 0.5 else bioma_foresta - - elif nome_bioma_scelto == "Foresta": - catalogo_scelto = bioma_foresta - - elif nome_bioma_scelto == "Misto Foresta-Altro": - # Lancia la moneta: 50% Foresta, 50% Altro - catalogo_scelto = bioma_foresta if randf() > 0.5 else bioma_altro - - else: - catalogo_scelto = bioma_altro + if nome_bioma_scelto == "Campagna": catalogo_scelto = bioma_campagna + elif nome_bioma_scelto == "Campagna-Foresta": catalogo_scelto = bioma_campagna if randf() > 0.5 else bioma_foresta + elif nome_bioma_scelto == "Foresta": catalogo_scelto = bioma_foresta + elif nome_bioma_scelto == "Foresta-Altro": catalogo_scelto = bioma_foresta if randf() > 0.5 else bioma_altro + else: catalogo_scelto = bioma_altro if catalogo_scelto.is_empty(): catalogo_scelto = bioma_campagna - nome_bioma_scelto += " (FALLBACK)" - - print("🌱 Generato: [", nome_bioma_scelto, "] in cella ", pos_griglia) return catalogo_scelto -# --- IL LASER INTELLIGENTE --- func _registra_cella_con_laser(pos_griglia: Vector2i) -> bool: if scacchiera.has(pos_griglia): return true @@ -129,7 +153,6 @@ func _registra_cella_con_laser(pos_griglia: Vector2i) -> bool: return false -# --- WAVE FUNCTION COLLAPSE --- func _piazza_bioma_compatibile(pos_griglia: Vector2i) -> void: var req_nord = _richiede_connessione(pos_griglia + Vector2i(0, -1), "sud") var req_est = _richiede_connessione(pos_griglia + Vector2i(1, 0), "ovest") @@ -152,11 +175,7 @@ func _piazza_bioma_compatibile(pos_griglia: Vector2i) -> void: var match_o = (req_ovest == -1) or ((req_ovest == 1) == u["ovest"]) if match_n and match_e and match_s and match_o: - candidati.append({ - "scena": scena, - "rotazione": rot, - "uscite": u - }) + candidati.append({"scena": scena, "rotazione": rot, "uscite": u}) test_chunk.queue_free() @@ -174,42 +193,31 @@ func _piazza_bioma_compatibile(pos_griglia: Vector2i) -> void: scacchiera[pos_griglia] = {"tipo": "bioma", "uscite": {"nord":false, "est":false, "sud":false, "ovest":false}} func _richiede_connessione(pos_vicino: Vector2i, lato_richiesto: String) -> int: - if not scacchiera.has(pos_vicino): - _registra_cella_con_laser(pos_vicino) - + if not scacchiera.has(pos_vicino): _registra_cella_con_laser(pos_vicino) if scacchiera.has(pos_vicino): - if scacchiera[pos_vicino]["uscite"][lato_richiesto] == true: - return 1 - else: - return 0 - + return 1 if scacchiera[pos_vicino]["uscite"][lato_richiesto] else 0 return -1 -# --- DIZIONARIO DEI BIOMI (SOGLIE RIGOROSE PER EVITARE SALTI) --- func _get_nome_bioma(valore: float) -> String: - # Convertiamo il valore da [-1.0 a 1.0] a un percorso continuo - # per assicurare la presenza dei mix - if valore < -0.4: - return "Campagna" - elif valore < -0.15: - return "Misto Campagna-Foresta" + if valore < -0.4: return "Campagna" + elif valore < -0.15: return "Campagna-Foresta" - if not usa_terzo_bioma: - return "Foresta" + if not usa_terzo_bioma: return "Foresta" - if valore < 0.15: - return "Foresta" - elif valore < 0.4: - return "Misto Foresta-Altro" - else: - return "Altro (Deserto/Neve)" + if valore < 0.15: return "Foresta" + elif valore < 0.4: return "Foresta-Altro" + else: return "Altro (Deserto/Neve)" -# --- IL GPS DEL TRENO --- +# --- AGGIORNAMENTO GPS A SCHERMO --- +# --- AGGIORNAMENTO GPS A SCHERMO --- func _radar_bioma_treno() -> void: - if path_treno == null or path_treno.curve == null: return + # SICUREZZA: Controlliamo che il treno esista davvero prima di leggerne la posizione! + if path_treno == null or path_treno.curve == null or path_treno.treno_istanziato == null: + return var pos_treno = path_treno.treno_istanziato.global_position var grid_x = roundi(pos_treno.x / dimensione_chunk) +# ... il resto del codice rimane identico ... var grid_z = roundi(pos_treno.z / dimensione_chunk) var valore_attuale = generatore_rumore.get_noise_2d(grid_x, grid_z) var bioma_attuale = _get_nome_bioma(valore_attuale) @@ -234,7 +242,10 @@ func _radar_bioma_treno() -> void: prossimo_bioma = bioma_futuro break - if prossimo_bioma != "": - print("🚂 [GPS TRENO] Sei in: ", bioma_attuale, " | Tra circa ", distanza_cambio, " metri entrerai in: ", prossimo_bioma) - else: - print("🚂 [GPS TRENO] Sei in: ", bioma_attuale, " | Nessun cambio in vista per 600m.") + # MODIFICA: Invece di usare print, aggiorniamo l'interfaccia a schermo! + if lbl_bioma and lbl_distanza: + lbl_bioma.text = bioma_attuale + if prossimo_bioma != "": + lbl_distanza.text = str(distanza_cambio) + "m ➔ " + prossimo_bioma + else: + lbl_distanza.text = "Nessun cambio nei prossimi 600m" diff --git a/Scenes/generatore_bioma.gd.uid b/Scripts/generatore_bioma.gd.uid similarity index 100% rename from Scenes/generatore_bioma.gd.uid rename to Scripts/generatore_bioma.gd.uid diff --git a/Test_Procedurale/generatore_mappa.gd b/Scripts/generatore_mappa.gd similarity index 100% rename from Test_Procedurale/generatore_mappa.gd rename to Scripts/generatore_mappa.gd diff --git a/Test_Procedurale/generatore_mappa.gd.uid b/Scripts/generatore_mappa.gd.uid similarity index 100% rename from Test_Procedurale/generatore_mappa.gd.uid rename to Scripts/generatore_mappa.gd.uid diff --git a/Test_Procedurale/info_chunk.gd b/Scripts/info_chunk.gd similarity index 100% rename from Test_Procedurale/info_chunk.gd rename to Scripts/info_chunk.gd diff --git a/Test_Procedurale/info_chunk.gd.uid b/Scripts/info_chunk.gd.uid similarity index 100% rename from Test_Procedurale/info_chunk.gd.uid rename to Scripts/info_chunk.gd.uid diff --git a/Scenes/Edge_detector.gdshader b/Shaders/Edge_detector.gdshader similarity index 100% rename from Scenes/Edge_detector.gdshader rename to Shaders/Edge_detector.gdshader diff --git a/Scenes/Edge_detector.gdshader.uid b/Shaders/Edge_detector.gdshader.uid similarity index 100% rename from Scenes/Edge_detector.gdshader.uid rename to Shaders/Edge_detector.gdshader.uid diff --git a/Shaders/Shadow_postProcess.gdshader b/Shaders/Shadow_postProcess.gdshader new file mode 100644 index 0000000..2dd0dcf --- /dev/null +++ b/Shaders/Shadow_postProcess.gdshader @@ -0,0 +1,81 @@ +shader_type spatial; + +render_mode unshaded, depth_test_disabled, cull_disabled; + +uniform sampler2D depth_texture : hint_depth_texture, repeat_disable, filter_nearest; +uniform sampler2D noise_texture : repeat_enable, filter_linear; + +uniform float cloud_scale : hint_range(0.001, 0.2) = 0.05; +uniform float cloud_speed : hint_range(0.0, 1.0) = 0.05; +uniform vec2 direction = vec2(1.0, 0.2); +uniform vec2 sun_angle = vec2(0.5, 0.5); + +group_uniforms Forma_Nuvola; +uniform float cloud_density : hint_range(0.0, 1.0) = 0.5; +uniform float center_sharpness : hint_range(0.0, 0.99) = 0.7; + +group_uniforms Estetica; +uniform vec3 shadow_color : source_color = vec3(0.0, 0.0, 0.0); +uniform float opacity_center : hint_range(0.0, 1.0) = 0.5; +uniform float opacity_edge : hint_range(0.0, 1.0) = 0.2; + +group_uniforms Distanza_Sfumo; +// Sfumo basato sulla distanza dalla telecamera (Profondità) +uniform float fade_start : hint_range(10.0, 1000.0) = 150.0; +uniform float fade_end : hint_range(50.0, 2000.0) = 300.0; + +group_uniforms Altezza_Sfumo; +// Sfumo basato sull'altezza dal suolo (Asse Y) +uniform float height_fade_start : hint_range(0.0, 500.0) = 10.0; // Inizia a svanire sopra i 10 metri +uniform float height_fade_end : hint_range(0.0, 1000.0) = 50.0; // Scompare del tutto a 50 metri di altezza + +void vertex() { + POSITION = vec4(VERTEX.xy, 1.0, 1.0); +} + +void fragment() { + float depth = texture(depth_texture, SCREEN_UV).x; + + if (depth >= 0.9999) { + ALPHA = 0.0; + } else { + vec3 ndc = vec3(SCREEN_UV * 2.0 - 1.0, depth); + vec4 view_pos = INV_PROJECTION_MATRIX * vec4(ndc, 1.0); + view_pos /= view_pos.w; + // world_pos.y è l'altezza assoluta di questo pixel nel mondo 3D! + vec4 world_pos = INV_VIEW_MATRIX * view_pos; + + // 1. Sfumo di Distanza + float dist = length(view_pos.xyz); + float dist_fade = smoothstep(fade_end, fade_start, dist); + + // 2. Sfumo di Altezza (LA NOVITÀ) + // Se world_pos.y supera height_fade_start inizia a svanire. A height_fade_end è zero. + float height_fade = smoothstep(height_fade_end, height_fade_start, world_pos.y); + + // Moltiplichiamo i due sfumi. Se uno dei due dice "zero", l'ombra sparisce. + float final_fade = dist_fade * height_fade; + + if (final_fade <= 0.001) { + ALPHA = 0.0; + } else { + vec2 projected_xz = world_pos.xz + (world_pos.y * sun_angle); + vec2 uv = projected_xz * cloud_scale; + uv += TIME * cloud_speed * vec2(-direction.x, direction.y); + + float n = texture(noise_texture, uv).r; + + if (n < (1.0 - cloud_density)) { + ALPHA = 0.0; + } else { + float internal_n = (n - (1.0 - cloud_density)) / cloud_density; + float is_center = step(center_sharpness, internal_n); + + ALBEDO = shadow_color; + + // Applichiamo il colore e lo sbiadiamo in base a distanza e altezza! + ALPHA = mix(opacity_edge, opacity_center, is_center) * final_fade; + } + } + } +} \ No newline at end of file diff --git a/Shaders/Shadow_postProcess.gdshader.uid b/Shaders/Shadow_postProcess.gdshader.uid new file mode 100644 index 0000000..94f0a45 --- /dev/null +++ b/Shaders/Shadow_postProcess.gdshader.uid @@ -0,0 +1 @@ +uid://c0gopfoe0ij8g diff --git a/Shaders/godrays.gdshader b/Shaders/godrays.gdshader new file mode 100644 index 0000000..22be8b8 --- /dev/null +++ b/Shaders/godrays.gdshader @@ -0,0 +1,62 @@ +shader_type spatial; + +// RENDER MODE ESSENZIALI PER EFFETTI LUCE +// blend_add: Somma i colori, perfetto per la luce pura. +// unshaded: Non riceve ombre, è lui che illumina. +// depth_draw_never: Non blocca gli oggetti dietro, evita artefatti. +// cull_disabled: Visibile da entrambi i lati. +render_mode blend_add, depth_draw_never, cull_disabled, unshaded; + +uniform sampler2D depth_texture : hint_depth_texture, filter_nearest; +uniform sampler2D noise_texture : repeat_enable, filter_linear; + +uniform vec3 ray_color : source_color = vec3(1.0, 0.9, 0.7); +uniform float base_alpha : hint_range(0.0, 1.0) = 0.5; + +group_uniforms Noise_Stirato; +// --- I PARAMETRI CHE CERCAVI --- +uniform float noise_stretching : hint_range(1.0, 50.0) = 20.0; // Quanto allungare il noise +uniform float noise_scale : hint_range(0.1, 10.0) = 1.0; // Grandezza generale +uniform vec2 scrolling_speed = vec2(0.0, -0.1); // Velocità e direzione del movimento (Y negativa va in giù) + +group_uniforms Fades; +uniform float depth_softness = 1.0; // Ammorbidisce il contatto con terreno/alberi +uniform float edge_fade_power = 2.0; // Sfuma i bordi laterali del piano + +// --- IL PARAMETRO PER LO SCRIPT --- +uniform float intensity_multiplier : hint_range(0.0, 1.0) = 0.0; + +void fragment() { + // 1. LA MAGIA DEL NOISE STIRATO E IN MOVIMENTO + // Prendiamo le coordinate UV standard + vec2 stretchy_uv = UV * noise_scale; + + // STIRAMENTO: Moltiplichiamo X per allungare il noise in verticale + stretchy_uv.x *= noise_stretching; + + // MOVIMENTO: Aggiungiamo il tempo moltiplicato per la velocità + stretchy_uv += TIME * scrolling_speed; + + // Leggiamo il noise (basta un canale perché è in bianco e nero) + float noise = texture(noise_texture, stretchy_uv).r; + + // 2. SISTEMA DI DISSOLVENZE (FADES) PER NASCONDERE IL PIANO + // A. Soft Intersection: Legge la profondità per sfumare il contatto con gli oggetti + float depth = textureLod(depth_texture, SCREEN_UV, 0.0).r; + vec4 upos = INV_PROJECTION_MATRIX * vec4(SCREEN_UV * 2.0 - 1.0, depth, 1.0); + vec3 pixel_position = upos.xyz / upos.w; + float depth_fade = clamp((VERTEX.z - pixel_position.z) / depth_softness, 0.0, 1.0); + + // B. Edge Fade: Sfuma orizzontalmente (UV.x) per non avere bordi netti ai lati del piano + float edge_fade = smoothstep(0.0, 0.5, UV.x) * smoothstep(1.0, 0.5, UV.x); + edge_fade = pow(edge_fade, edge_fade_power); // Rende la sfumatura più o meno aggressiva + + // C. Vertical Fade: Sfuma verticalmente (UV.y) per far sparire la base nel nulla + float vertical_fade = smoothstep(0.0, 0.2, UV.y) * smoothstep(1.0, 0.7, UV.y); + + // 3. COMPOSIZIONE FINALE + ALBEDO = ray_color; + + // Combiniamo tutte le sfumature con il noise e il moltiplicatore dello script + ALPHA = noise * base_alpha * depth_fade * edge_fade * vertical_fade * intensity_multiplier; +} \ No newline at end of file diff --git a/Shaders/godrays.gdshader.uid b/Shaders/godrays.gdshader.uid new file mode 100644 index 0000000..c093288 --- /dev/null +++ b/Shaders/godrays.gdshader.uid @@ -0,0 +1 @@ +uid://dkmdtejrbks8n diff --git a/Shaders/tree_leaves.gdshader b/Shaders/tree_leaves.gdshader index 46ef105..5065225 100644 --- a/Shaders/tree_leaves.gdshader +++ b/Shaders/tree_leaves.gdshader @@ -100,6 +100,8 @@ void fragment() { // Moltiplichiamo l'alpha della texture per il nuovo parametro opacity ALPHA = tex.r * opacity; ALPHA_SCISSOR_THRESHOLD = 0.5; + + ROUGHNESS = 0.02; } // --- NUOVA LOGICA LUCE (Ombre Proiettate e Fix Quadrati) ---