diff --git a/core/daynight/blur.gdshader b/core/daynight/blur.gdshader index 22b0dcb..2adb3ba 100644 --- a/core/daynight/blur.gdshader +++ b/core/daynight/blur.gdshader @@ -1,9 +1,17 @@ shader_type canvas_item; +// Cattura tutto quello che c'è sotto questo nodo uniform sampler2D screen_texture : hint_screen_texture, filter_linear_mipmap; uniform float blur_amount : hint_range(0.0, 5.0) = 2.5; +uniform float focus_size : hint_range(0.0, 1.0) = 0.4; +uniform float transition_softness : hint_range(0.01, 1.0) = 0.3; void fragment() { - COLOR = textureLod(screen_texture, SCREEN_UV, blur_amount); -} + float dist_from_center = abs(SCREEN_UV.y - 0.5); + float mask = smoothstep(focus_size / 2.0, (focus_size / 2.0) + transition_softness, dist_from_center); + + // Applica il blur + vec4 blurred_screen = textureLod(screen_texture, SCREEN_UV, blur_amount * mask); + COLOR = blurred_screen; +} \ No newline at end of file diff --git a/core/daynight/environment_management.tscn b/core/daynight/environment_management.tscn index aa9fee4..b644c93 100644 --- a/core/daynight/environment_management.tscn +++ b/core/daynight/environment_management.tscn @@ -40,9 +40,55 @@ shader_parameter/sun_color = Color(0.2841828, 0.2023238, 0.27953526, 1) [sub_resource type="Resource" id="Resource_r4tfj"] script = ExtResource("2_h6hjk") +morning_color = Color(0.93333334, 0.78039217, 0.6039216, 1) +afternoon_color = Color(0.9490196, 0.62352943, 0.38039216, 1) +night_color = Color(0.18431373, 0.18431373, 0.4862745, 1) +sun_rotation_morning = Vector3(-50, -90, 0) +sun_rotation_afternoon = Vector3(-120, -90, 0) +sun_rotation_night = Vector3(-130, -90, 0) +night_light_energy = 1.0 +exposure_morning = 0.8 +exposure_afternoon = 0.7 +exposure_night = 0.7 +sky_top_morning = Color(0.11764706, 0.35686275, 0.5411765, 1) +sky_top_afternoon = Color(0.7019608, 0.4509804, 0.2, 1) +sky_top_night = Color(0.050980393, 0.050980393, 0.14901961, 1) +sky_horizon_morning = Color(0.4627451, 0.6745098, 0.8627451, 1) +sky_horizon_afternoon = Color(0.93333334, 0.6, 0.8039216, 1) +sky_horizon_night = Color(0.14901961, 0.101960786, 0.2509804, 1) +grad_top_morning = Color(0.7921569, 0.8784314, 0.95686275, 1) +grad_top_afternoon = Color(0.8627451, 0.24313726, 0.5411765, 1) +grad_top_night = Color(0.16470589, 0.16470589, 0.26666668, 1) +grad_bot_morning = Color(0.05882353, 0.078431375, 0.21568628, 1) +grad_bot_afternoon = Color(0.2509804, 0.019607844, 0.043137256, 1) +grad_intensity_morning = 0.05 +grad_intensity_afternoon = 0.1 +grad_intensity_night = 0.5 +fog_color_morning = Color(0.7490196, 0.8509804, 0.9490196, 1) +fog_color_afternoon = Color(0.9647059, 0.5882353, 0.7607843, 1) +fog_color_night = Color(0.14901961, 0.101960786, 0.2509804, 1) +fog_density_morning = 0.01 +fog_density_afternoon = 0.02 +glow_morning = 0.4 +glow_night = 0.6 material_fog = SubResource("ShaderMaterial_b5atu") material_drops = SubResource("StandardMaterial3D_r4tfj") material_clouds = SubResource("ShaderMaterial_ruhh7") +lightning_color = Color(1, 0.9843137, 0.4627451, 1) +lightning_min = 2 +lightning_max = 4 +lightning_scale_min = 2.0 +lightning_scale_max = 5.0 +godray_max_rain = 60 +godray_spawn_radius = 100.0 +godray_spawn_offset = Vector3(20, 80, 20) +godray_rotation_degrees = Vector3(50, 30, 0) +godray_scale = Vector3(2, 25, 50) +snow_amount = 2000.0 +wind_amount = 50 +cloud_speed = 0.01 +fireflies_amount = 550 +fireflies_spawn_ray = 60.0 metadata/_custom_type_script = "uid://butda6k2tli3o" [sub_resource type="Gradient" id="Gradient_i3hjl"] @@ -85,7 +131,7 @@ gradient = SubResource("Gradient_djqkg") lifetime_randomness = 0.5 emission_shape_scale = Vector3(5, 5, 5) emission_shape = 3 -emission_box_extents = Vector3(25, 5, 25) +emission_box_extents = Vector3(1, 1, 1) direction = Vector3(0, 1, 0) initial_velocity_min = 6.0 initial_velocity_max = 6.0 @@ -99,10 +145,9 @@ point_count = 3 [sub_resource type="ShaderMaterial" id="ShaderMaterial_cer0u"] render_priority = 0 shader = ExtResource("5_djqkg") -shader_parameter/wave_frequency = 1.0 -shader_parameter/base_amplitude = 0.5 -shader_parameter/secondary_ratio = 0.6 -shader_parameter/time_scale_base = 3.0 +shader_parameter/time_scale = 3.065 +shader_parameter/wave_amplitude = 0.3 +shader_parameter/wave_frequency = 0.25 [sub_resource type="TubeTrailMesh" id="TubeTrailMesh_vo82p"] material = SubResource("ShaderMaterial_cer0u") @@ -174,7 +219,9 @@ size = Vector2(0.05, 0.8) [sub_resource type="ShaderMaterial" id="ShaderMaterial_kavln"] shader = ExtResource("9_amaf0") -shader_parameter/blur_amount = 0.6000000285 +shader_parameter/blur_amount = 0.50000002375 +shader_parameter/focus_size = 0.54400002584 +shader_parameter/transition_softness = 0.00999999977648 [sub_resource type="QuadMesh" id="QuadMesh_sxgg7"] size = Vector2(2, 2) @@ -184,12 +231,12 @@ noise = ExtResource("11_yn8v8") seamless = true [sub_resource type="ShaderMaterial" id="ShaderMaterial_oqt1s"] -render_priority = 0 +render_priority = -1 shader = ExtResource("10_tuauy") shader_parameter/noise_texture = SubResource("NoiseTexture2D_0fcg4") shader_parameter/cloud_scale = 0.0070000003325 shader_parameter/cloud_speed = 0.0030000001425 -shader_parameter/direction = Vector2(0.5, 0.2) +shader_parameter/direction = Vector2(0.1, 0.025) shader_parameter/sun_angle = Vector2(0.5, 0.5) shader_parameter/cloud_density = 0.400000019 shader_parameter/center_sharpness = 0.138000006555 @@ -222,9 +269,9 @@ process_material = SubResource("ParticleProcessMaterial_i3hjl") draw_pass_1 = SubResource("QuadMesh_b5atu") [node name="Particles_Wind" type="GPUParticles3D" parent="." unique_id=1238214694] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 50, 0) -emitting = false -amount = 100 +transform = Transform3D(1, 0, 0, 0, -4.371139e-08, -1, 0, 1, -4.371139e-08, 0, 50, 0) +cast_shadow = 0 +amount = 25 lifetime = 3.0 fixed_fps = 60 process_material = SubResource("ParticleProcessMaterial_ruhh7") diff --git a/core/daynight/wind.gdshader b/core/daynight/wind.gdshader index 912d737..7847f2e 100644 --- a/core/daynight/wind.gdshader +++ b/core/daynight/wind.gdshader @@ -1,31 +1,26 @@ shader_type spatial; render_mode unshaded; -global uniform float global_wind_speed = 1.0; //0.0 = calm, 1.0 = normal, 2.0+ = strong -global uniform vec2 global_wind_direction = vec2(1.0, 0.0); - -uniform float wave_frequency = 1.0; -uniform float base_amplitude = 0.5; -uniform float secondary_ratio = 0.6; -uniform float time_scale_base = 3.0; +// --- 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() { - float random_seed_offset = INSTANCE_CUSTOM.x * 100.0; - float scaled_time = (TIME + random_seed_offset) * (time_scale_base * global_wind_speed); - float amplitude = base_amplitude * global_wind_speed; - - vec2 wind_dir = normalize(global_wind_direction); - vec2 wind_perp = vec2(-wind_dir.y, wind_dir.x); //90° perpendicular - - float primary_sway = sin(VERTEX.y * wave_frequency + scaled_time) * amplitude; - float secondary_sway = sin(VERTEX.y * wave_frequency * 1.3 + scaled_time * 0.7 + 1.57) - * (amplitude * secondary_ratio); - - VERTEX.x += primary_sway * wind_dir.x + secondary_sway * wind_perp.x; - VERTEX.z += primary_sway * wind_dir.y + secondary_sway * wind_perp.y; + // 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; } \ No newline at end of file diff --git a/docs/museums/biome_generator/museum_map.tscn b/docs/museums/biome_generator/museum_map.tscn index 7abc7da..755a933 100644 --- a/docs/museums/biome_generator/museum_map.tscn +++ b/docs/museums/biome_generator/museum_map.tscn @@ -76,6 +76,7 @@ sky_material = SubResource("ShaderMaterial_pypsn") background_mode = 2 sky = SubResource("Sky_50i22") ambient_light_color = Color(1, 0.88767046, 0.775341, 1) +tonemap_mode = 2 tonemap_exposure = 0.9979451 ssao_enabled = true ssao_radius = 0.5 @@ -84,7 +85,7 @@ ssao_detail = 0.0 ssil_enabled = true glow_enabled = true glow_levels/4 = 1.0 -glow_intensity = 1.1835606 +glow_intensity = 0.4 glow_strength = 0.65 glow_bloom = 1.0 fog_enabled = true @@ -145,6 +146,7 @@ compositor = SubResource("Compositor_mb5yv") [node name="biome_generator" parent="." unique_id=1861369341 node_paths=PackedStringArray("rail_path") instance=ExtResource("5_yeh4a")] rail_path = NodePath("../rail") biome_list = Array[ExtResource("6_s3jnv")]([SubResource("Resource_3qrd0")]) +eye_line = 5 [node name="Terrain" type="MeshInstance3D" parent="." unique_id=219178561] visible = false @@ -161,16 +163,13 @@ rain_sounds = Array[AudioStream]([ExtResource("20_quqod"), ExtResource("21_appab [node name="DirectionalLight3D" type="DirectionalLight3D" parent="." unique_id=1125687520] transform = Transform3D(0.7246343, -0.20683524, 0.65736127, 0, 0.95389545, 0.30013812, -0.6891333, -0.21749045, 0.6912255, 0, 0, 0) -light_color = Color(1, 0.88767046, 0.775341, 1) light_indirect_energy = 0.0 -light_volumetric_fog_energy = 0.0 shadow_enabled = true -shadow_bias = 0.2 -shadow_normal_bias = 0.0 +shadow_normal_bias = 4.0 shadow_opacity = 0.97 -shadow_blur = 0.4 +shadow_blur = 0.5 directional_shadow_mode = 0 -directional_shadow_fade_start = 0.9 +directional_shadow_max_distance = 200.0 [node name="Control" type="Control" parent="." unique_id=630650980] layout_mode = 3 diff --git a/project.godot b/project.godot index 09296ab..4bafc3c 100644 --- a/project.godot +++ b/project.godot @@ -13,6 +13,7 @@ config_version=5 config/name="tgcc" run/main_scene="uid://cae0mnf353dy3" config/features=PackedStringArray("4.6", "Forward Plus") +run/max_fps=60 config/icon="uid://bfar1kk3pgq8f" [autoload]