add wind + dust
This commit is contained in:
15
Assets/Meshes/Wind.tres
Normal file
15
Assets/Meshes/Wind.tres
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
[gd_resource type="TubeTrailMesh" format=3 uid="uid://2wmnftxwg8wt"]
|
||||||
|
|
||||||
|
[ext_resource type="Material" uid="uid://c2rg73saqofnw" path="res://Materials/Wind.tres" id="1_a26dm"]
|
||||||
|
|
||||||
|
[sub_resource type="Curve" id="Curve_1jvvv"]
|
||||||
|
_data = [Vector2(0, 0.50861245), 0.0, 0.0, 0, 0, Vector2(0.5024876, 1), 0.0, 0.0, 0, 0, Vector2(0.98507464, 0.4837321), 0.0, 0.0, 0, 0]
|
||||||
|
point_count = 3
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
material = ExtResource("1_a26dm")
|
||||||
|
custom_aabb = AABB(20, 20, 20, 0, 0, 0)
|
||||||
|
radius = 0.06
|
||||||
|
radial_steps = 16
|
||||||
|
section_length = 2.0
|
||||||
|
curve = SubResource("Curve_1jvvv")
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
[gd_resource type="ShaderMaterial" format=3 uid="uid://codq5gx71rj4o"]
|
[gd_resource type="ShaderMaterial" format=3 uid="uid://codq5gx71rj4o"]
|
||||||
|
|
||||||
[ext_resource type="Shader" uid="uid://svdmjppqell5" path="res://Scenes/PolvereAtmosferica.gdshader" id="1_ppnru"]
|
[ext_resource type="Shader" uid="uid://svdmjppqell5" path="res://Shaders/PolvereAtmosferica.gdshader" id="1_ppnru"]
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
shader = ExtResource("1_ppnru")
|
shader = ExtResource("1_ppnru")
|
||||||
|
|||||||
10
Materials/Wind.tres
Normal file
10
Materials/Wind.tres
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
[gd_resource type="ShaderMaterial" format=3 uid="uid://c2rg73saqofnw"]
|
||||||
|
|
||||||
|
[ext_resource type="Shader" uid="uid://ch7g8q4utqci8" path="res://Scenes/Wind.gdshader" id="1_b53de"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
render_priority = 0
|
||||||
|
shader = ExtResource("1_b53de")
|
||||||
|
shader_parameter/time_scale = 3.065
|
||||||
|
shader_parameter/wave_amplitude = 0.3
|
||||||
|
shader_parameter/wave_frequency = 0.25
|
||||||
@@ -30,6 +30,7 @@
|
|||||||
[ext_resource type="Shader" uid="uid://cglb64vpwpgpu" path="res://Shaders/Water2.gdshader" id="19_6k3cw"]
|
[ext_resource type="Shader" uid="uid://cglb64vpwpgpu" path="res://Shaders/Water2.gdshader" id="19_6k3cw"]
|
||||||
[ext_resource type="PackedScene" uid="uid://cpebna545ihfh" path="res://Scenes/Chunk_Scene/Chunk/Foresta/Chunk_F_L_2.tscn" id="20_00nhk"]
|
[ext_resource type="PackedScene" uid="uid://cpebna545ihfh" path="res://Scenes/Chunk_Scene/Chunk/Foresta/Chunk_F_L_2.tscn" id="20_00nhk"]
|
||||||
[ext_resource type="PackedScene" uid="uid://bp5gnv0noxcpc" path="res://Scenes/Test/Scogliera_Blockout.tscn" id="20_16mw0"]
|
[ext_resource type="PackedScene" uid="uid://bp5gnv0noxcpc" path="res://Scenes/Test/Scogliera_Blockout.tscn" id="20_16mw0"]
|
||||||
|
[ext_resource type="TubeTrailMesh" uid="uid://2wmnftxwg8wt" path="res://Assets/Meshes/Wind.tres" id="21_l1dl0"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dk85mk0hapngf" path="res://Assets/Test/rock2.glb" id="21_qdxup"]
|
[ext_resource type="PackedScene" uid="uid://dk85mk0hapngf" path="res://Assets/Test/rock2.glb" id="21_qdxup"]
|
||||||
[ext_resource type="Shader" uid="uid://c0dy1aqj1b4q3" path="res://Shaders/trunk_shader.gdshader" id="22_tbvi6"]
|
[ext_resource type="Shader" uid="uid://c0dy1aqj1b4q3" path="res://Shaders/trunk_shader.gdshader" id="22_tbvi6"]
|
||||||
[ext_resource type="Texture2D" uid="uid://8sdgkykyg5l5" path="res://Assets/Textures/rock_color.png" id="23_4udcq"]
|
[ext_resource type="Texture2D" uid="uid://8sdgkykyg5l5" path="res://Assets/Textures/rock_color.png" id="23_4udcq"]
|
||||||
@@ -47,8 +48,8 @@
|
|||||||
[ext_resource type="PackedScene" uid="uid://jqqiendhdgqq" path="res://Scenes/Test/Test_Chunk_Rettilineo.tscn" id="33_mvcuv"]
|
[ext_resource type="PackedScene" uid="uid://jqqiendhdgqq" path="res://Scenes/Test/Test_Chunk_Rettilineo.tscn" id="33_mvcuv"]
|
||||||
[ext_resource type="PackedScene" uid="uid://bhcut7ndtdo2w" path="res://Assets/Test/SK_Mannequin.FBX" id="34_3nw1o"]
|
[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"]
|
[ext_resource type="PackedScene" uid="uid://xebpudhewwwj" path="res://Scenes/Chunk_Scene/Chunk/Campagna/Chunk_C_L_2.tscn" id="35_n33lw"]
|
||||||
[ext_resource type="Shader" uid="uid://bl1dwh2k06yy5" path="res://Scenes/Blur.gdshader" id="46_nonqo"]
|
[ext_resource type="Shader" uid="uid://bl1dwh2k06yy5" path="res://Shaders/Blur.gdshader" id="46_nonqo"]
|
||||||
[ext_resource type="Shader" uid="uid://bttmyh64kihyr" path="res://Scenes/Nebbia2D.gdshader" id="47_7j5hj"]
|
[ext_resource type="Shader" uid="uid://bttmyh64kihyr" path="res://Shaders/Nebbia2D.gdshader" id="47_7j5hj"]
|
||||||
|
|
||||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_10fbe"]
|
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_10fbe"]
|
||||||
noise = ExtResource("6_00nhk")
|
noise = ExtResource("6_00nhk")
|
||||||
@@ -257,24 +258,51 @@ shader_parameter/cast_shadow_strength = 0.6
|
|||||||
|
|
||||||
[sub_resource type="PlaneMesh" id="PlaneMesh_gsfny"]
|
[sub_resource type="PlaneMesh" id="PlaneMesh_gsfny"]
|
||||||
|
|
||||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_oqwsk"]
|
[sub_resource type="Gradient" id="Gradient_u10x4"]
|
||||||
|
offsets = PackedFloat32Array(0, 0.49127907, 1)
|
||||||
|
colors = PackedColorArray(0, 0, 0, 0, 1, 0.89900386, 0.37477228, 1, 1, 1, 1, 0)
|
||||||
|
|
||||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_8vrnd"]
|
[sub_resource type="GradientTexture1D" id="GradientTexture1D_l1dl0"]
|
||||||
noise = SubResource("FastNoiseLite_oqwsk")
|
gradient = SubResource("Gradient_u10x4")
|
||||||
seamless = true
|
|
||||||
|
|
||||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_l1dl0"]
|
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_kjb07"]
|
||||||
render_priority = 0
|
emission_shape = 3
|
||||||
shader = ExtResource("23_u10x4")
|
emission_box_extents = Vector3(15, 3, 15)
|
||||||
shader_parameter/fog_noise = SubResource("NoiseTexture2D_8vrnd")
|
gravity = Vector3(0, 0.2, 0)
|
||||||
shader_parameter/use_red_as_alpha = true
|
color_ramp = SubResource("GradientTexture1D_l1dl0")
|
||||||
shader_parameter/fog_color = Color(0.8, 0.8509804, 0.9019608, 1)
|
turbulence_enabled = true
|
||||||
shader_parameter/scroll_speed = Vector2(0.01, 0.01)
|
|
||||||
shader_parameter/texture_scale = Vector2(1, 1)
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_on20a"]
|
||||||
shader_parameter/edge_softness_y = 0.5
|
transparency = 1
|
||||||
shader_parameter/edge_softness_x = 0.5
|
shading_mode = 0
|
||||||
shader_parameter/night_intensity = 0.0
|
vertex_color_use_as_albedo = true
|
||||||
shader_parameter/sun_color = Color(1, 1, 1, 1)
|
billboard_mode = 3
|
||||||
|
particles_anim_h_frames = 1
|
||||||
|
particles_anim_v_frames = 1
|
||||||
|
particles_anim_loop = false
|
||||||
|
|
||||||
|
[sub_resource type="QuadMesh" id="QuadMesh_6k3cw"]
|
||||||
|
material = SubResource("StandardMaterial3D_on20a")
|
||||||
|
size = Vector2(0.1, 0.1)
|
||||||
|
|
||||||
|
[sub_resource type="Gradient" id="Gradient_kjb07"]
|
||||||
|
offsets = PackedFloat32Array(0, 0.49709302, 1)
|
||||||
|
colors = PackedColorArray(0, 0, 0, 0, 1, 1, 1, 0.7647059, 1, 1, 1, 0)
|
||||||
|
|
||||||
|
[sub_resource type="GradientTexture1D" id="GradientTexture1D_on20a"]
|
||||||
|
gradient = SubResource("Gradient_kjb07")
|
||||||
|
|
||||||
|
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_6k3cw"]
|
||||||
|
lifetime_randomness = 0.5
|
||||||
|
emission_shape_scale = Vector3(5, 5, 5)
|
||||||
|
emission_shape = 3
|
||||||
|
emission_box_extents = Vector3(1, 1, 1)
|
||||||
|
direction = Vector3(0, 1, 0)
|
||||||
|
spread = 0.0
|
||||||
|
initial_velocity_min = 6.0
|
||||||
|
initial_velocity_max = 6.0
|
||||||
|
gravity = Vector3(0, 0, 0)
|
||||||
|
color_ramp = SubResource("GradientTexture1D_on20a")
|
||||||
|
|
||||||
[sub_resource type="Curve3D" id="Curve3D_bedag"]
|
[sub_resource type="Curve3D" id="Curve3D_bedag"]
|
||||||
closed = true
|
closed = true
|
||||||
@@ -287,6 +315,12 @@ point_count = 93
|
|||||||
|
|
||||||
[sub_resource type="PlaneMesh" id="PlaneMesh_l1dl0"]
|
[sub_resource type="PlaneMesh" id="PlaneMesh_l1dl0"]
|
||||||
|
|
||||||
|
[sub_resource type="FastNoiseLite" id="FastNoiseLite_oqwsk"]
|
||||||
|
|
||||||
|
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_8vrnd"]
|
||||||
|
noise = SubResource("FastNoiseLite_oqwsk")
|
||||||
|
seamless = true
|
||||||
|
|
||||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_kjb07"]
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_kjb07"]
|
||||||
render_priority = 0
|
render_priority = 0
|
||||||
shader = ExtResource("23_u10x4")
|
shader = ExtResource("23_u10x4")
|
||||||
@@ -672,9 +706,9 @@ shadow_mesh = SubResource("ArrayMesh_odcbb")
|
|||||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_u10x4"]
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_u10x4"]
|
||||||
shader = ExtResource("47_7j5hj")
|
shader = ExtResource("47_7j5hj")
|
||||||
shader_parameter/fog_color = Color(0.85, 0.9, 0.95, 1)
|
shader_parameter/fog_color = Color(0.85, 0.9, 0.95, 1)
|
||||||
shader_parameter/clear_center_radius = 0.4
|
shader_parameter/clear_center_radius = 0.4650000220875
|
||||||
shader_parameter/edge_softness = 0.25000001117647996
|
shader_parameter/edge_softness = 0.30900001397898
|
||||||
shader_parameter/max_opacity = 0.150000007125
|
shader_parameter/max_opacity = 0.1350000064125
|
||||||
|
|
||||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_kwbnj"]
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_kwbnj"]
|
||||||
shader = ExtResource("46_nonqo")
|
shader = ExtResource("46_nonqo")
|
||||||
@@ -682,7 +716,7 @@ shader_parameter/blur_amount = 0.70000003325
|
|||||||
shader_parameter/focus_size = 0.450000021375
|
shader_parameter/focus_size = 0.450000021375
|
||||||
shader_parameter/transition_softness = 0.3
|
shader_parameter/transition_softness = 0.3
|
||||||
|
|
||||||
[node name="DemoForest" type="Node3D" unique_id=265279494 node_paths=PackedStringArray("nodo_polvere")]
|
[node name="DemoForest" type="Node3D" unique_id=265279494 node_paths=PackedStringArray("nodo_polvere", "particelle_lucciole", "particelle_vento")]
|
||||||
script = ExtResource("1_cr3ar")
|
script = ExtResource("1_cr3ar")
|
||||||
color_pomeriggio = Color(0.9999996, 0.6887105, 0.42199263, 1)
|
color_pomeriggio = Color(0.9999996, 0.6887105, 0.42199263, 1)
|
||||||
color_notte = Color(0.18353948, 0.18552834, 0.48496485, 1)
|
color_notte = Color(0.18353948, 0.18552834, 0.48496485, 1)
|
||||||
@@ -705,6 +739,11 @@ godray_spawn_radius = 100.0
|
|||||||
godray_spawn_offset = Vector3(20, 80, 20)
|
godray_spawn_offset = Vector3(20, 80, 20)
|
||||||
godray_rotation_degrees = Vector3(50, 30, 0)
|
godray_rotation_degrees = Vector3(50, 30, 0)
|
||||||
godray_scale = Vector3(2, 25, 50)
|
godray_scale = Vector3(2, 25, 50)
|
||||||
|
particelle_lucciole = NodePath("SubViewportContainer/SubViewport/World/Camere/CameraPivot/Lucciole")
|
||||||
|
quantita_lucciole = 400
|
||||||
|
raggio_spawn_lucciole = 40.0
|
||||||
|
particelle_vento = NodePath("SubViewportContainer/SubViewport/World/Camere/CameraPivot/Wind")
|
||||||
|
quantita_vento = 50
|
||||||
|
|
||||||
[node name="CanvasLayer" type="CanvasLayer" parent="." unique_id=427161585]
|
[node name="CanvasLayer" type="CanvasLayer" parent="." unique_id=427161585]
|
||||||
|
|
||||||
@@ -878,17 +917,22 @@ mesh = SubResource("PlaneMesh_gsfny")
|
|||||||
skeleton = NodePath("../../../../../..")
|
skeleton = NodePath("../../../../../..")
|
||||||
surface_material_override/0 = ExtResource("2_4xv0h")
|
surface_material_override/0 = ExtResource("2_4xv0h")
|
||||||
|
|
||||||
[node name="Fog3" type="MeshInstance3D" parent="SubViewportContainer/SubViewport/World/Camere/CameraPivot" unique_id=1510712731]
|
[node name="Lucciole" type="GPUParticles3D" parent="SubViewportContainer/SubViewport/World/Camere/CameraPivot" unique_id=1589413685]
|
||||||
transform = Transform3D(0.23348677, 23.566315, 10.13246, 0.16955252, 16.852575, -13.287166, -85.35561, 20.688768, -0.20234334, -40.737335, -6.168863, 49.11189)
|
transform = Transform3D(1, 0, 0, 0, 0.99999976, 0, 0, 0, 0.99999976, 0, 1.9999999, 4.7141495)
|
||||||
mesh = SubResource("PlaneMesh_gsfny")
|
amount = 50
|
||||||
skeleton = NodePath("../../../../../..")
|
lifetime = 4.0
|
||||||
surface_material_override/0 = SubResource("ShaderMaterial_l1dl0")
|
process_material = SubResource("ParticleProcessMaterial_kjb07")
|
||||||
|
draw_pass_1 = SubResource("QuadMesh_6k3cw")
|
||||||
|
|
||||||
[node name="Fog4" type="MeshInstance3D" parent="SubViewportContainer/SubViewport/World/Camere/CameraPivot" unique_id=1074990597]
|
[node name="Wind" type="GPUParticles3D" parent="SubViewportContainer/SubViewport/World/Camere/CameraPivot" unique_id=1116712570]
|
||||||
transform = Transform3D(-4.157295, -22.59027, -10.13105, 0.16955031, 16.852552, -13.287153, 85.25453, -21.750288, -0.2636921, 34.739395, -6.168857, 49.111843)
|
transform = Transform3D(-0.9999765, 4.341205e-08, -0.006824123, -0.006824125, 4.400863e-08, 0.9999762, 4.3711378e-08, 0.99999934, -4.371136e-08, 0, 4.5733867, 21.045607)
|
||||||
mesh = SubResource("PlaneMesh_gsfny")
|
cast_shadow = 0
|
||||||
skeleton = NodePath("../../../../../..")
|
emitting = false
|
||||||
surface_material_override/0 = SubResource("ShaderMaterial_l1dl0")
|
amount = 25
|
||||||
|
lifetime = 3.0
|
||||||
|
fixed_fps = 60
|
||||||
|
process_material = SubResource("ParticleProcessMaterial_6k3cw")
|
||||||
|
draw_pass_1 = ExtResource("21_l1dl0")
|
||||||
|
|
||||||
[node name="CameraIso" type="Camera3D" parent="SubViewportContainer/SubViewport/World/Camere/CameraPivot" unique_id=375499667]
|
[node name="CameraIso" type="Camera3D" parent="SubViewportContainer/SubViewport/World/Camere/CameraPivot" unique_id=375499667]
|
||||||
transform = Transform3D(0.5778576, -0.57709634, 0.57709634, 0, 0.7071067, 0.7071067, -0.8161376, -0.408607, 0.408607, 231.45, 290, 173.79)
|
transform = Transform3D(0.5778576, -0.57709634, 0.57709634, 0, 0.7071067, 0.7071067, -0.8161376, -0.408607, 0.408607, 231.45, 290, 173.79)
|
||||||
|
|||||||
26
Scenes/Wind.gdshader
Normal file
26
Scenes/Wind.gdshader
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
shader_type spatial;
|
||||||
|
render_mode unshaded;
|
||||||
|
|
||||||
|
// --- PARAMETRI ---
|
||||||
|
uniform float time_scale = 3.0;
|
||||||
|
uniform float wave_amplitude = 0.5; // Quanto curva a destra/sinistra
|
||||||
|
uniform float wave_frequency = 1.0; // Ogni quanto fa la curva
|
||||||
|
|
||||||
|
void vertex() {
|
||||||
|
// Creiamo un offset unico per ogni particella in modo che non si muovano tutte uguali
|
||||||
|
float random_seed_offset = INSTANCE_CUSTOM.x * 100.0;
|
||||||
|
float scaled_time = (TIME + random_seed_offset) * time_scale;
|
||||||
|
|
||||||
|
// Applichiamo SOLO la curva morbida all'asse X (o Z, a seconda di come orienti la scena)
|
||||||
|
// Usiamo VERTEX.y per far sì che la curva si propaghi lungo tutta la lunghezza della scia
|
||||||
|
VERTEX.x += sin(VERTEX.y * wave_frequency + scaled_time) * wave_amplitude;
|
||||||
|
|
||||||
|
// Niente più "VERTEX.y += t;", quindi niente più teletrasporti!
|
||||||
|
}
|
||||||
|
|
||||||
|
void fragment() {
|
||||||
|
// Il colore e l'alpha (per lo spawn dolce e la morte lenta)
|
||||||
|
// vengono comandati dalla Color Ramp del GPUParticles3D!
|
||||||
|
ALBEDO = COLOR.rgb;
|
||||||
|
ALPHA = COLOR.a;
|
||||||
|
}
|
||||||
1
Scenes/Wind.gdshader.uid
Normal file
1
Scenes/Wind.gdshader.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://ch7g8q4utqci8
|
||||||
26
Scenes/Wind.tscn
Normal file
26
Scenes/Wind.tscn
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
[gd_scene format=3 uid="uid://btljgq47ug1g5"]
|
||||||
|
|
||||||
|
[ext_resource type="Shader" uid="uid://ch7g8q4utqci8" path="res://Scenes/Wind.gdshader" id="1_ceua7"]
|
||||||
|
|
||||||
|
[sub_resource type="TubeTrailMesh" id="TubeTrailMesh_d85b2"]
|
||||||
|
custom_aabb = AABB(20, 20, 20, 0, 0, 0)
|
||||||
|
radius = 0.04
|
||||||
|
section_length = 0.5
|
||||||
|
|
||||||
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_uwdnm"]
|
||||||
|
render_priority = 0
|
||||||
|
shader = ExtResource("1_ceua7")
|
||||||
|
shader_parameter/color = Color(1, 1, 1, 0.40392157)
|
||||||
|
shader_parameter/fade_time = 5.0
|
||||||
|
shader_parameter/time_scale = 3.0
|
||||||
|
shader_parameter/wave_amplitude = 0.1
|
||||||
|
shader_parameter/wave_frequency = 1.0
|
||||||
|
shader_parameter/wave_length = 2.0
|
||||||
|
shader_parameter/wave_count = 3.0
|
||||||
|
shader_parameter/loop_radius = 0.0
|
||||||
|
shader_parameter/loop_count = 0.0
|
||||||
|
|
||||||
|
[node name="MeshInstance3D" type="MeshInstance3D" unique_id=202410879]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, -4.3711385e-08, -0.9999999, 0, 0.9999999, -4.3711385e-08, 0, 0, 0)
|
||||||
|
mesh = SubResource("TubeTrailMesh_d85b2")
|
||||||
|
surface_material_override/0 = SubResource("ShaderMaterial_uwdnm")
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
[gd_scene format=3 uid="uid://bdhphg2oi4n1v"]
|
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://bbdaxcrf48xsr" path="res://Assets/Meshes/House/Test_NoRoof.fbx" id="1_k6nmq"]
|
|
||||||
[ext_resource type="Material" uid="uid://biaudrjlfoflm" path="res://Materials/House.tres" id="2_si57c"]
|
|
||||||
|
|
||||||
[node name="Test_NoRoof" unique_id=1047340045 instance=ExtResource("1_k6nmq")]
|
|
||||||
|
|
||||||
[node name="Cube_005" parent="." index="0" unique_id=1082356799]
|
|
||||||
surface_material_override/0 = ExtResource("2_si57c")
|
|
||||||
surface_material_override/1 = ExtResource("2_si57c")
|
|
||||||
surface_material_override/2 = ExtResource("2_si57c")
|
|
||||||
surface_material_override/3 = ExtResource("2_si57c")
|
|
||||||
surface_material_override/4 = ExtResource("2_si57c")
|
|
||||||
surface_material_override/5 = ExtResource("2_si57c")
|
|
||||||
surface_material_override/6 = ExtResource("2_si57c")
|
|
||||||
surface_material_override/7 = ExtResource("2_si57c")
|
|
||||||
surface_material_override/8 = ExtResource("2_si57c")
|
|
||||||
@@ -24,7 +24,6 @@ extends Node3D
|
|||||||
@export var materiale_nebbia: ShaderMaterial
|
@export var materiale_nebbia: ShaderMaterial
|
||||||
@export var materiale_pioggia_gocce: StandardMaterial3D
|
@export var materiale_pioggia_gocce: StandardMaterial3D
|
||||||
@export var materiale_nuvole: ShaderMaterial
|
@export var materiale_nuvole: ShaderMaterial
|
||||||
# --- NUOVO: SLOT NODO POLVERE ---
|
|
||||||
@export var nodo_polvere: ColorRect
|
@export var nodo_polvere: ColorRect
|
||||||
|
|
||||||
@export_group("Meteo (Pioggia & Fulmini)")
|
@export_group("Meteo (Pioggia & Fulmini)")
|
||||||
@@ -49,6 +48,19 @@ extends Node3D
|
|||||||
@export var godray_spawn_height: float = 5.0
|
@export var godray_spawn_height: float = 5.0
|
||||||
@export var godray_scale: Vector3 = Vector3(2.0, 6.0, 2.0)
|
@export var godray_scale: Vector3 = Vector3(2.0, 6.0, 2.0)
|
||||||
|
|
||||||
|
@export_group("Lucciole")
|
||||||
|
@export var particelle_lucciole: GPUParticles3D
|
||||||
|
@export var quantita_lucciole: int = 60
|
||||||
|
@export var raggio_spawn_lucciole: float = 20.0
|
||||||
|
@export var altezza_spawn_lucciole: float = 3.0
|
||||||
|
|
||||||
|
# --- NUOVO: GRUPPO VENTO ---
|
||||||
|
@export_group("Vento")
|
||||||
|
@export var particelle_vento: GPUParticles3D
|
||||||
|
@export var quantita_vento: int = 100
|
||||||
|
@export var raggio_spawn_vento: float = 25.0
|
||||||
|
@export var altezza_spawn_vento: float = 5.0
|
||||||
|
|
||||||
@onready var sole: DirectionalLight3D = $DirectionalLight3D
|
@onready var sole: DirectionalLight3D = $DirectionalLight3D
|
||||||
@onready var ambiente: WorldEnvironment = $WorldEnvironment
|
@onready var ambiente: WorldEnvironment = $WorldEnvironment
|
||||||
@onready var menu_giornata: OptionButton = $CanvasLayer/OptionButton
|
@onready var menu_giornata: OptionButton = $CanvasLayer/OptionButton
|
||||||
@@ -82,6 +94,22 @@ func _ready() -> void:
|
|||||||
if particelle_pioggia:
|
if particelle_pioggia:
|
||||||
particelle_pioggia.emitting = false
|
particelle_pioggia.emitting = false
|
||||||
|
|
||||||
|
# Inizializzazione Lucciole
|
||||||
|
if particelle_lucciole:
|
||||||
|
particelle_lucciole.emitting = false
|
||||||
|
particelle_lucciole.amount = quantita_lucciole
|
||||||
|
var proc_mat = particelle_lucciole.process_material as ParticleProcessMaterial
|
||||||
|
if proc_mat:
|
||||||
|
proc_mat.emission_box_extents = Vector3(raggio_spawn_lucciole, altezza_spawn_lucciole, raggio_spawn_lucciole)
|
||||||
|
|
||||||
|
# --- NUOVO: INIZIALIZZAZIONE VENTO ---
|
||||||
|
if particelle_vento:
|
||||||
|
particelle_vento.emitting = false
|
||||||
|
particelle_vento.amount = quantita_vento
|
||||||
|
var proc_mat_vento = particelle_vento.process_material as ParticleProcessMaterial
|
||||||
|
if proc_mat_vento:
|
||||||
|
proc_mat_vento.emission_box_extents = Vector3(raggio_spawn_vento, altezza_spawn_vento, raggio_spawn_vento)
|
||||||
|
|
||||||
_resetta_timer_fulmine()
|
_resetta_timer_fulmine()
|
||||||
|
|
||||||
func _input(event: InputEvent) -> void:
|
func _input(event: InputEvent) -> void:
|
||||||
@@ -199,16 +227,30 @@ func _process(delta: float) -> void:
|
|||||||
materiale_nebbia.set_shader_parameter("sun_color", final_tint)
|
materiale_nebbia.set_shader_parameter("sun_color", final_tint)
|
||||||
|
|
||||||
# ==========================================
|
# ==========================================
|
||||||
# --- NUOVO: GESTIONE POLVERE INFALLIBILE ---
|
# --- GESTIONE POLVERE, LUCCIOLE E VENTO ---
|
||||||
# ==========================================
|
# ==========================================
|
||||||
|
var e_notte = tempo_giorno >= 2.5
|
||||||
|
|
||||||
|
# Polvere (2D): Solo di giorno e senza pioggia
|
||||||
if nodo_polvere:
|
if nodo_polvere:
|
||||||
var e_notte = tempo_giorno >= 2.5
|
|
||||||
|
|
||||||
# Accende/Spegne brutalmente il nodo
|
|
||||||
if not is_raining and not e_notte:
|
if not is_raining and not e_notte:
|
||||||
nodo_polvere.visible = true
|
nodo_polvere.visible = true
|
||||||
else:
|
else:
|
||||||
nodo_polvere.visible = false
|
nodo_polvere.visible = false
|
||||||
|
|
||||||
|
# Lucciole (3D): Solo di notte e senza pioggia
|
||||||
|
if particelle_lucciole:
|
||||||
|
if not is_raining and e_notte:
|
||||||
|
particelle_lucciole.emitting = true
|
||||||
|
else:
|
||||||
|
particelle_lucciole.emitting = false
|
||||||
|
|
||||||
|
# Vento (3D): Solo di giorno e senza pioggia
|
||||||
|
if particelle_vento:
|
||||||
|
if not is_raining and not e_notte:
|
||||||
|
particelle_vento.emitting = true
|
||||||
|
else:
|
||||||
|
particelle_vento.emitting = false
|
||||||
|
|
||||||
func _genera_evento_meteo_casuale() -> void:
|
func _genera_evento_meteo_casuale() -> void:
|
||||||
sto_cambiando_in_cinematic = true
|
sto_cambiando_in_cinematic = true
|
||||||
|
|||||||
Reference in New Issue
Block a user