Compare commits
4 Commits
1abdc912ab
...
matt_req_f
| Author | SHA1 | Date | |
|---|---|---|---|
| fdfe2336f8 | |||
| dcf5d28248 | |||
| 50ea1d8bbd | |||
| c08007c446 |
@@ -264,8 +264,8 @@ func _input(event: InputEvent) -> void:
|
||||
if event is InputEventKey and event.pressed and not event.echo:
|
||||
if event.keycode == KEY_T:
|
||||
_goto_next_stop()
|
||||
elif event.keycode == KEY_F:
|
||||
_test_manual_fireworks()
|
||||
#elif event.keycode == KEY_F:
|
||||
#_test_manual_fireworks()
|
||||
|
||||
func _test_manual_fireworks() -> void:
|
||||
if fireworks_scene == null or train_instance == null: return
|
||||
@@ -520,17 +520,15 @@ func _update_wagon_progress_offsets() -> void:
|
||||
|
||||
for wagon in wagon_instances:
|
||||
var wagon_length: float = _get_vehicle_length(wagon)
|
||||
accumulated_distance += _get_wagon_spacing(previous_length, wagon_length)
|
||||
if wagon_spacing_override > 0.0:
|
||||
accumulated_distance += wagon_spacing_override + wagon_gap
|
||||
else:
|
||||
var detected_spacing: float = previous_length * 0.5 + wagon_length * 0.5
|
||||
accumulated_distance += detected_spacing * wagon_spacing_scale + wagon_gap
|
||||
|
||||
wagon_progress_offsets.append(accumulated_distance)
|
||||
previous_length = wagon_length
|
||||
|
||||
func _get_wagon_spacing(previous_length: float, wagon_length: float) -> float:
|
||||
if wagon_spacing_override > 0.0:
|
||||
return wagon_spacing_override + wagon_gap
|
||||
|
||||
var detected_spacing: float = previous_length * 0.5 + wagon_length * 0.5
|
||||
return detected_spacing * wagon_spacing_scale + wagon_gap
|
||||
|
||||
func _snap_wagons_to_progress(total_length: float = 0.0) -> void:
|
||||
if curve == null or wagon_instances.is_empty():
|
||||
return
|
||||
@@ -554,18 +552,16 @@ func _snap_wagons_to_progress(total_length: float = 0.0) -> void:
|
||||
wagon_offset = wagon_progress_offsets[i]
|
||||
|
||||
var wagon_progress: float = train_progress - direction * wagon_offset
|
||||
_snap_vehicle_to_progress(wagon, wagon_progress, total_length)
|
||||
|
||||
func _snap_vehicle_to_progress(vehicle: Node3D, progress: float, total_length: float) -> void:
|
||||
var vehicle_progress: float = wrapf(progress, 0.0, total_length)
|
||||
var vehicle_progress: float = wrapf(wagon_progress, 0.0, total_length)
|
||||
var center_position: Vector3 = to_global(curve.sample_baked(vehicle_progress, true))
|
||||
var prog_forward: float = wrapf(vehicle_progress + 2.0, 0.0, total_length)
|
||||
var forward_position: Vector3 = to_global(curve.sample_baked(prog_forward, true))
|
||||
|
||||
vehicle.global_position = center_position
|
||||
wagon.global_position = center_position
|
||||
if center_position.distance_to(forward_position) > 0.01:
|
||||
vehicle.look_at(forward_position, Vector3.UP)
|
||||
vehicle.rotate_y(PI)
|
||||
wagon.look_at(forward_position, Vector3.UP)
|
||||
wagon.rotate_y(PI)
|
||||
|
||||
func _get_vehicle_length(vehicle: Node3D) -> float:
|
||||
var bounds: AABB = _get_node_local_bounds(vehicle, vehicle)
|
||||
|
||||
@@ -10,8 +10,9 @@
|
||||
[ext_resource type="PackedScene" uid="uid://fi6faw7ag1i0" path="res://tgcc/chunk/railway/scene/chunk_railway_curve_3.tscn" id="8_r0882"]
|
||||
[ext_resource type="PackedScene" uid="uid://dglpoh63x2lpy" path="res://tgcc/chunk/railway/scene/chunk_railway_curve_4.tscn" id="9_3auto"]
|
||||
[ext_resource type="Script" uid="uid://c374rv220mvh1" path="res://core/biome_generator/railway_pool.gd" id="9_8tdc7"]
|
||||
[ext_resource type="PackedScene" uid="uid://bup6gwlxos0w2" path="res://tgcc/chunk/railway/hero/chunk_railway_station_hero.tscn" id="10_3auto"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("9_8tdc7")
|
||||
name = "Railway Pool"
|
||||
available_railways = Array[PackedScene]([ExtResource("1_86h1y"), ExtResource("3_3auto"), ExtResource("4_i1umq"), ExtResource("5_x44at"), ExtResource("6_vrrkw"), ExtResource("7_l17bw"), ExtResource("8_qcl5o"), ExtResource("8_r0882"), ExtResource("9_3auto")])
|
||||
available_railways = Array[PackedScene]([ExtResource("1_86h1y"), ExtResource("3_3auto"), ExtResource("4_i1umq"), ExtResource("5_x44at"), ExtResource("6_vrrkw"), ExtResource("7_l17bw"), ExtResource("8_qcl5o"), ExtResource("8_r0882"), ExtResource("9_3auto"), ExtResource("10_3auto")])
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[gd_resource type="Resource" script_class="WagonPool" format=3 uid="uid://bjnytgwt8tmf4"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://dvk3bytqn3m5s" path="res://tgcc/train/main_train.tscn" id="1_t6q5r"]
|
||||
[ext_resource type="Script" uid="uid://b6xk0gtn2pwa" path="res://core/biome_generator/wagon_pool.gd" id="2_x6bmc"]
|
||||
[ext_resource type="PackedScene" uid="uid://bny4kv08j8j40" path="res://tgcc/train/wagon.tscn" id="1_t6q5r"]
|
||||
[ext_resource type="Script" uid="uid://c3bgupfogjvv2" path="res://core/biome_generator/wagon_pool.gd" id="2_x6bmc"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("2_x6bmc")
|
||||
|
||||
@@ -123,7 +123,7 @@ func _process(delta: float) -> void:
|
||||
|
||||
var is_night = day_time >= 2.5
|
||||
if particles_fireflies:
|
||||
particles_fireflies.emitting = thereare_fireflies and is_night
|
||||
particles_fireflies.emitting = thereare_fireflies and is_night and not is_raining and not is_snowing and not is_storm
|
||||
|
||||
var base_tint: Color
|
||||
var base_sky_top: Color
|
||||
@@ -190,11 +190,22 @@ func _process(delta: float) -> void:
|
||||
var final_fog_color = base_fog_color.lerp(base_fog_color * weather_color, clamp(rain_intensity, 0.0, 1.0))
|
||||
var final_fog_density = lerp(base_fog_density, base_fog_density * 4.0, clamp(rain_intensity, 0.0, 1.0))
|
||||
var final_water_color = base_water_color.darkened(clamp(environment_config.water_darkening_rain, 0.0, 1.0) * clamp(rain_intensity, 0.0, 1.0))
|
||||
var rain_weather_amount: float = 0.0
|
||||
if is_raining:
|
||||
rain_weather_amount = clamp(rain_intensity, 0.0, 1.0)
|
||||
var storm_weather_amount: float = 0.0
|
||||
if is_raining and is_storm:
|
||||
if environment_config.storm_rain_intensity_multiplier > 1.0:
|
||||
storm_weather_amount = clamp((rain_intensity - 1.0) / (environment_config.storm_rain_intensity_multiplier - 1.0), 0.0, 1.0)
|
||||
else:
|
||||
storm_weather_amount = rain_weather_amount
|
||||
|
||||
final_tint = final_tint.lerp(final_tint * environment_config.snow_mode_color, snow_weather_amount)
|
||||
final_sky_top = final_sky_top.lerp(final_sky_top * environment_config.snow_mode_color, snow_weather_amount)
|
||||
final_sky_horizon = final_sky_horizon.lerp(final_sky_horizon * environment_config.snow_mode_color, snow_weather_amount)
|
||||
final_fog_color = final_fog_color.lerp(final_fog_color * environment_config.snow_mode_color, snow_weather_amount)
|
||||
final_tint = final_tint.lerp(final_tint * _get_rain_day_color(), rain_weather_amount)
|
||||
final_tint = final_tint.lerp(final_tint * _get_storm_day_color(), storm_weather_amount)
|
||||
|
||||
#Shader parameters for global trunk_shader
|
||||
var final_grad_top = base_grad_top.lerp(base_grad_top * weather_color, clamp(rain_intensity, 0.0, 1.0))
|
||||
@@ -214,6 +225,8 @@ func _process(delta: float) -> void:
|
||||
|
||||
# We calculate the final exposure by applying snow damping directly to the camera exposure
|
||||
var final_exposure = base_exposure * snow_light_attenuation
|
||||
final_exposure = lerp(final_exposure, _get_rain_day_exposure(), rain_weather_amount)
|
||||
final_exposure = lerp(final_exposure, _get_storm_day_exposure(), storm_weather_amount)
|
||||
|
||||
var reflected_color = Color(0.4, 0.5, 0.6, 1.0)
|
||||
var drops_color = final_sky_horizon.lerp(reflected_color, 0.15)
|
||||
@@ -293,6 +306,30 @@ func create_sound_players():
|
||||
thunder_audio_player.volume_db = environment_config.thunder_audio_volume_db
|
||||
add_child(thunder_audio_player)
|
||||
|
||||
func _get_rain_day_color() -> Color:
|
||||
if day_time <= 2.0:
|
||||
return environment_config.rain_morning_color.lerp(environment_config.rain_afternoon_color, day_time - 1.0)
|
||||
|
||||
return environment_config.rain_afternoon_color.lerp(environment_config.rain_night_color, day_time - 2.0)
|
||||
|
||||
func _get_storm_day_color() -> Color:
|
||||
if day_time <= 2.0:
|
||||
return environment_config.storm_morning_color.lerp(environment_config.storm_afternoon_color, day_time - 1.0)
|
||||
|
||||
return environment_config.storm_afternoon_color.lerp(environment_config.storm_night_color, day_time - 2.0)
|
||||
|
||||
func _get_rain_day_exposure() -> float:
|
||||
if day_time <= 2.0:
|
||||
return lerp(environment_config.rain_exposure_morning, environment_config.rain_exposure_afternoon, day_time - 1.0)
|
||||
|
||||
return lerp(environment_config.rain_exposure_afternoon, environment_config.rain_exposure_night, day_time - 2.0)
|
||||
|
||||
func _get_storm_day_exposure() -> float:
|
||||
if day_time <= 2.0:
|
||||
return lerp(environment_config.storm_exposure_morning, environment_config.storm_exposure_afternoon, day_time - 1.0)
|
||||
|
||||
return lerp(environment_config.storm_exposure_afternoon, environment_config.storm_exposure_night, day_time - 2.0)
|
||||
|
||||
#region camera
|
||||
func _set_camera(curr_camera: Camera3D):
|
||||
camera = curr_camera
|
||||
@@ -347,7 +384,7 @@ func toggle_fireflies(value: bool):
|
||||
thereare_fireflies = value
|
||||
var is_night = day_time >= 2.5
|
||||
if particles_fireflies:
|
||||
particles_fireflies.emitting = thereare_fireflies and is_night
|
||||
particles_fireflies.emitting = thereare_fireflies and is_night and not is_raining
|
||||
|
||||
#disable fireflies and set default values and materials
|
||||
func init_fireflies():
|
||||
|
||||
@@ -33,6 +33,24 @@ extends Resource
|
||||
@export var exposure_afternoon: float = 0.95
|
||||
@export var exposure_night: float = 0.4
|
||||
|
||||
#Camera tonemap exposure and light tint used only while rain is active
|
||||
@export_group("Rain Exposition and Colors")
|
||||
@export var rain_exposure_morning: float = 0.8
|
||||
@export var rain_exposure_afternoon: float = 0.7
|
||||
@export var rain_exposure_night: float = 0.35
|
||||
@export var rain_morning_color: Color = Color(0.85, 0.89, 0.93, 1.0)
|
||||
@export var rain_afternoon_color: Color = Color(0.78, 0.83, 0.89, 1.0)
|
||||
@export var rain_night_color: Color = Color(0.55, 0.6, 0.75, 1.0)
|
||||
|
||||
#Camera tonemap exposure and light tint used only while storm is active
|
||||
@export_group("Storm Exposition and Colors")
|
||||
@export var storm_exposure_morning: float = 0.65
|
||||
@export var storm_exposure_afternoon: float = 0.55
|
||||
@export var storm_exposure_night: float = 0.25
|
||||
@export var storm_morning_color: Color = Color(0.78, 0.83, 0.89, 1.0)
|
||||
@export var storm_afternoon_color: Color = Color(0.65, 0.7, 0.78, 1.0)
|
||||
@export var storm_night_color: Color = Color(0.45, 0.5, 0.65, 1.0)
|
||||
|
||||
#Sky top color for each time of day
|
||||
@export_group("Sky Colors - Top")
|
||||
@export var sky_top_morning: Color = Color(0.35, 0.65, 0.9, 1.0)
|
||||
|
||||
@@ -8,8 +8,6 @@ extends Button
|
||||
if is_inside_tree() and has_node("%Texture"):
|
||||
$%Texture.texture = image
|
||||
|
||||
|
||||
|
||||
func _ready():
|
||||
if image != null and has_node("%Texture"):
|
||||
$%Texture.texture = image
|
||||
@@ -20,8 +18,6 @@ func _ready():
|
||||
$%TextureRect.hide()
|
||||
TweenFX.breathe(self, 1)
|
||||
|
||||
|
||||
|
||||
func _on_pressed() -> void:
|
||||
if TweenFX.is_playing(self, TweenFX.Animations.PRESS_ROTATE):
|
||||
return
|
||||
|
||||
@@ -58,19 +58,19 @@ script = ExtResource("2_0bmh1")
|
||||
north = true
|
||||
south = true
|
||||
|
||||
[node name="Argini_003" parent="." index="0" unique_id=1178813592]
|
||||
[node name="Argini_003" parent="." index="0" unique_id=509439881]
|
||||
surface_material_override/0 = ExtResource("3_c4jie")
|
||||
|
||||
[node name="Grass_005" parent="." index="1" unique_id=1427965126 groups=["weather_vegetables_node", "wind_node"]]
|
||||
[node name="Grass_005" parent="." index="1" unique_id=188609017 groups=["weather_vegetables_node", "wind_node"]]
|
||||
surface_material_override/0 = ExtResource("3_c4jie")
|
||||
|
||||
[node name="MSH_Staccioanta_1_002" parent="." index="2" unique_id=562234307]
|
||||
[node name="MSH_Staccioanta_1_002" parent="." index="2" unique_id=746941179]
|
||||
surface_material_override/0 = ExtResource("4_lr7xw")
|
||||
|
||||
[node name="Strada_004" parent="." index="3" unique_id=387203009 groups=["weather_node"]]
|
||||
[node name="Strada_004" parent="." index="3" unique_id=604168900 groups=["weather_node"]]
|
||||
surface_material_override/0 = ExtResource("5_5jc2f")
|
||||
|
||||
[node name="Water_004" parent="." index="4" unique_id=1258756459]
|
||||
[node name="Water_004" parent="." index="4" unique_id=244513747]
|
||||
surface_material_override/0 = ExtResource("6_0bmh1")
|
||||
|
||||
[node name="grass" type="Node3D" parent="." index="5" unique_id=1540226859 groups=["weather_vegetables_node", "wind_node"]]
|
||||
@@ -104,7 +104,7 @@ material_override = ExtResource("10_tbcfd")
|
||||
cast_shadow = 0
|
||||
multimesh = SubResource("MultiMesh_e417f")
|
||||
|
||||
[node name="rice" type="Node3D" parent="." index="6" unique_id=1524870522 groups=["weather_vegetables_node", "wind_node"]]
|
||||
[node name="rice" type="Node3D" parent="." index="6" unique_id=1524870522 groups=["weather_vegetables_node"]]
|
||||
visible = false
|
||||
|
||||
[node name="rice_plane" type="MeshInstance3D" parent="rice" index="0" unique_id=629743434]
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
[ext_resource type="Material" uid="uid://jygb1hcokks5" path="res://tgcc/chunk/prop/grass/grass_bank.tres" id="6_cxqsi"]
|
||||
[ext_resource type="Material" uid="uid://fnjxocmx16b7" path="res://tgcc/chunk/prop/grass/grass_chunk.tres" id="7_vkypx"]
|
||||
[ext_resource type="Material" uid="uid://0x17mj2v807r" path="res://tgcc/chunk/prop/grass/grass_chunk_weeds2.tres" id="8_k7yf4"]
|
||||
[ext_resource type="ArrayMesh" uid="uid://doophefr873pt" path="res://tgcc/chunk/prop/tree/bambù/Bambu.res" id="11_fy14c"]
|
||||
[ext_resource type="ArrayMesh" uid="uid://bg5rfu7tyl3p8" path="res://tgcc/chunk/prop/tree/bambù/Bambu.res" id="11_fy14c"]
|
||||
[ext_resource type="PackedScene" uid="uid://d12t04rs47jq3" path="res://tgcc/chunk/prop/tree/tree_01/tree_01.tscn" id="12_fqf4n"]
|
||||
[ext_resource type="Script" uid="uid://cp1pb5dnuojg3" path="res://tgcc/chunk/prop/tree/bambù/bambu.gd" id="12_s2jc4"]
|
||||
|
||||
@@ -60,20 +60,20 @@ script = ExtResource("2_vkypx")
|
||||
river_north = true
|
||||
river_south = true
|
||||
|
||||
[node name="Argini_011" parent="." index="0" unique_id=895986402]
|
||||
[node name="Argini_011" parent="." index="0" unique_id=1103166467]
|
||||
surface_material_override/0 = ExtResource("2_mic04")
|
||||
surface_material_override/1 = ExtResource("2_mic04")
|
||||
|
||||
[node name="Grass_019" parent="." index="1" unique_id=1784106582]
|
||||
[node name="Grass_019" parent="." index="1" unique_id=163702648]
|
||||
surface_material_override/0 = ExtResource("2_mic04")
|
||||
|
||||
[node name="Water_012" parent="." index="2" unique_id=1865739867]
|
||||
[node name="Water_012" parent="." index="2" unique_id=183333409]
|
||||
surface_material_override/0 = ExtResource("3_5p1m2")
|
||||
|
||||
[node name="Water_F_015" parent="." index="3" unique_id=147107428]
|
||||
[node name="Water_F_015" parent="." index="3" unique_id=1691016237]
|
||||
surface_material_override/0 = ExtResource("4_532mt")
|
||||
|
||||
[node name="rice" type="Node3D" parent="." index="4" unique_id=1336289627 groups=["weather_vegetables_node", "wind_node"]]
|
||||
[node name="rice" type="Node3D" parent="." index="4" unique_id=1336289627 groups=["weather_vegetables_node"]]
|
||||
transform = Transform3D(-1, 0, 8.742278e-08, 0, 1, 0, -8.742278e-08, 0, -1, 21.006079, 0, 0)
|
||||
|
||||
[node name="rice_plane" type="MeshInstance3D" parent="rice" index="0" unique_id=1744988640]
|
||||
|
||||
@@ -7,17 +7,30 @@
|
||||
[ext_resource type="PackedScene" uid="uid://ujv2f1l4d2ps" path="res://core/biome_generator/biome_generator.tscn" id="5_islkt"]
|
||||
[ext_resource type="Script" uid="uid://wv6kcqkibium" path="res://core/biome_generator/biome.gd" id="6_jfe74"]
|
||||
[ext_resource type="PackedScene" uid="uid://b8blm6bwintf7" path="res://tgcc/chunk/countryside/scene/rice/chunk_country_empty_01.tscn" id="7_5lqbd"]
|
||||
[ext_resource type="PackedScene" uid="uid://dgobym7krbqdr" path="res://tgcc/chunk/countryside/scene/fields/chunk_country_fields_corner_01.tscn" id="7_lrm81"]
|
||||
[ext_resource type="PackedScene" uid="uid://cgbjvjvtlulyu" path="res://tgcc/chunk/countryside/scene/fields/chunk_country_tea_cross_3_02.tscn" id="8_1iysf"]
|
||||
[ext_resource type="PackedScene" uid="uid://cjv1e8pc6gde1" path="res://tgcc/chunk/countryside/scene/rice/chunk_country_corner_01.tscn" id="8_aiwf5"]
|
||||
[ext_resource type="PackedScene" uid="uid://dqoai3665vb0a" path="res://tgcc/chunk/countryside/scene/rice/chunk_country_corner_02.tscn" id="9_0gakq"]
|
||||
[ext_resource type="PackedScene" uid="uid://chs64ggbvy28i" path="res://tgcc/chunk/countryside/scene/fields/chunk_country_tea_end_01.tscn" id="9_qulo6"]
|
||||
[ext_resource type="PackedScene" uid="uid://crlk31ecl480n" path="res://tgcc/chunk/countryside/scene/rice/chunk_country_corner_03.tscn" id="10_8taq1"]
|
||||
[ext_resource type="PackedScene" uid="uid://buiqa2mofucer" path="res://tgcc/chunk/countryside/scene/fields/chunk_country_tea_straight_02.tscn" id="10_s8w8r"]
|
||||
[ext_resource type="PackedScene" uid="uid://brpp7fe5noq8v" path="res://tgcc/chunk/countryside/scene/rice/chunk_country_cross_3_01.tscn" id="11_bx28o"]
|
||||
[ext_resource type="PackedScene" uid="uid://btwjdnho1cyav" path="res://tgcc/chunk/countryside/scene/fields/chunk_country_tea_straight_03.tscn" id="11_qgu6k"]
|
||||
[ext_resource type="PackedScene" uid="uid://qmt8bkiksgj3" path="res://tgcc/chunk/countryside/scene/rice/chunk_country_cross_3_02.tscn" id="12_e3o1y"]
|
||||
[ext_resource type="PackedScene" uid="uid://cmxsc74ebqnju" path="res://tgcc/chunk/countryside/scene/fields/chunk_country_tea_straight_04.tscn" id="12_ouhay"]
|
||||
[ext_resource type="PackedScene" uid="uid://by3c73s5g5n53" path="res://tgcc/chunk/countryside/scene/fields/river/chunk_river_tea_curve_3.tscn" id="13_no2mr"]
|
||||
[ext_resource type="PackedScene" uid="uid://d1tfkhuktwthn" path="res://tgcc/chunk/countryside/scene/rice/chunk_country_cross_3_03.tscn" id="13_pesa5"]
|
||||
[ext_resource type="PackedScene" uid="uid://djbish323kvt" path="res://tgcc/chunk/countryside/scene/fields/river/chunk_river_tea_end_1.tscn" id="14_civl4"]
|
||||
[ext_resource type="PackedScene" uid="uid://b002wu5ltuqi4" path="res://tgcc/chunk/countryside/scene/rice/chunk_country_end_01.tscn" id="14_d5byn"]
|
||||
[ext_resource type="PackedScene" uid="uid://b4r0j5os1tka4" path="res://tgcc/chunk/countryside/scene/fields/river/chunk_river_tea_mix1_1.tscn" id="15_q1p61"]
|
||||
[ext_resource type="PackedScene" uid="uid://dtfmvcbninrcu" path="res://tgcc/chunk/countryside/scene/rice/chunk_country_end_02.tscn" id="15_vk128"]
|
||||
[ext_resource type="PackedScene" uid="uid://h6xj43vo84uf" path="res://tgcc/chunk/countryside/scene/rice/chunk_country_straight_01.tscn" id="16_0l4fn"]
|
||||
[ext_resource type="PackedScene" uid="uid://cpfsxacr75b5u" path="res://tgcc/chunk/countryside/scene/fields/river/chunk_river_tea_mix3_1.tscn" id="16_n6l0c"]
|
||||
[ext_resource type="PackedScene" uid="uid://cu2chsjh8wuvp" path="res://tgcc/chunk/countryside/scene/rice/chunk_country_straight_02.tscn" id="17_0l3s0"]
|
||||
[ext_resource type="PackedScene" uid="uid://bwrp04hg0h0wo" path="res://tgcc/chunk/countryside/scene/fields/river/chunk_river_tea_mix4_1.tscn" id="17_j3l3o"]
|
||||
[ext_resource type="PackedScene" uid="uid://pxmcy0lhne5d" path="res://tgcc/chunk/countryside/scene/rice/chunk_country_straight_03.tscn" id="18_0mfe6"]
|
||||
[ext_resource type="PackedScene" uid="uid://mlmtsppo4esq" path="res://tgcc/chunk/countryside/scene/fields/river/chunk_river_tea_mix6_1.tscn" id="18_6r6jj"]
|
||||
[ext_resource type="PackedScene" uid="uid://ck0y8s6aj7t0n" path="res://tgcc/chunk/countryside/scene/fields/river/chunk_river_tea_straight_1.tscn" id="19_1bb1l"]
|
||||
[ext_resource type="PackedScene" uid="uid://bs3dkwcc8w2uk" path="res://tgcc/chunk/countryside/scene/rice/river/scene/chunk_river_curve_1.tscn" id="19_8ws46"]
|
||||
[ext_resource type="PackedScene" uid="uid://btipd6wev016d" path="res://tgcc/chunk/countryside/scene/rice/river/scene/chunk_river_straight_1.tscn" id="20_fv7f0"]
|
||||
[ext_resource type="PackedScene" uid="uid://deaxxlxdipqvx" path="res://tgcc/chunk/countryside/scene/rice/river/scene/chunk_river_end_1.tscn" id="21_psqnm"]
|
||||
@@ -25,6 +38,7 @@
|
||||
[ext_resource type="PackedScene" uid="uid://bhvmmw8d8vns5" path="res://tgcc/chunk/countryside/scene/rice/river/scene/chunk_river_mix2_1.tscn" id="23_53r6v"]
|
||||
[ext_resource type="PackedScene" uid="uid://cqe4t842io22i" path="res://tgcc/chunk/countryside/scene/rice/river/scene/chunk_river_cross_1.tscn" id="24_esnpb"]
|
||||
[ext_resource type="PackedScene" uid="uid://rjvefmcd4bpo" path="res://tgcc/chunk/countryside/scene/rice/river/scene/chunk_river_mix3_1.tscn" id="25_6ik1i"]
|
||||
[ext_resource type="PackedScene" uid="uid://c73yk6858dmwn" path="res://tgcc/chunk/countryside/scene/rice/chunk_country_cross_4_01.tscn" id="26_cuni5"]
|
||||
[ext_resource type="PackedScene" uid="uid://c6vpwol3k384y" path="res://tgcc/chunk/countryside/scene/rice/river/scene/chunk_river_mix4_1.tscn" id="26_x7bpo"]
|
||||
[ext_resource type="PackedScene" uid="uid://cd3iyj71hkgcr" path="res://tgcc/chunk/countryside/scene/rice/river/scene/chunk_river_mix5_1.tscn" id="27_e6m8d"]
|
||||
[ext_resource type="PackedScene" uid="uid://bh8kbw07bsu6n" path="res://tgcc/chunk/countryside/scene/rice/river/scene/chunk_river_mix6_1.tscn" id="28_jdvk1"]
|
||||
@@ -33,6 +47,7 @@
|
||||
[ext_resource type="PackedScene" uid="uid://ccgd3uy68r88h" path="res://tgcc/chunk/countryside/scene/rice/river/scene/chunk_river_curve_3.tscn" id="31_36ld5"]
|
||||
[ext_resource type="PackedScene" uid="uid://mpgyaho52lii" path="res://tgcc/chunk/countryside/scene/rice/river/scene/chunk_river_straight_5.tscn" id="32_4i5nu"]
|
||||
[ext_resource type="PackedScene" uid="uid://q26mkh3cupic" path="res://tgcc/chunk/countryside/scene/rice/river/scene/chunk_river_cross_2.tscn" id="33_3gjue"]
|
||||
[ext_resource type="PackedScene" uid="uid://c5rcq82mn1vv7" path="res://tgcc/chunk/countryside/scene/rice/chunk_country_straight_04.tscn" id="33_hv7ul"]
|
||||
[ext_resource type="Resource" uid="uid://cmd6s6thq4f7r" path="res://core/biome_generator/entities_pool.tres" id="34_a2cst"]
|
||||
[ext_resource type="PackedScene" uid="uid://cv5xmnow451kl" path="res://core/camera.tscn" id="35_f2l8p"]
|
||||
[ext_resource type="PackedScene" uid="uid://cmuvmmp7xam4o" path="res://core/daynight/environment_management.tscn" id="36_qwsp8"]
|
||||
@@ -44,13 +59,33 @@
|
||||
[ext_resource type="AudioStream" uid="uid://elrjw0smm0cj" path="res://core/daynight/sounds/rain_3.mp3" id="42_mh642"]
|
||||
[ext_resource type="PackedScene" uid="uid://1c1ion0qnho4" path="res://tgcc/map/map_1/map_1.tscn" id="43_ysd85"]
|
||||
[ext_resource type="Script" uid="uid://dboerd4a6dwj7" path="res://core/biome_generator/rails.gd" id="44_rcqo0"]
|
||||
[ext_resource type="PackedScene" uid="uid://dvk3bytqn3m5s" path="res://tgcc/train/test/Train_test.tscn" id="45_c0jxs"]
|
||||
[ext_resource type="PackedScene" uid="uid://otptvwer4par" path="res://tgcc/train/train.tscn" id="46_8w5ju"]
|
||||
[ext_resource type="Resource" uid="uid://bjnytgwt8tmf4" path="res://core/biome_generator/wagon_pool.tres" id="46_exdk1"]
|
||||
[ext_resource type="PackedScene" uid="uid://0kgjaqijaqku" path="res://docs/museums/biome_generator/rails.tscn" id="46_lbmv2"]
|
||||
[ext_resource type="PackedScene" uid="uid://c2mnl5l0c3o8t" path="res://tgcc/chunk/countryside/scene/rice/river/scene/chunk_river_straight_2.tscn" id="47_i22ig"]
|
||||
[ext_resource type="PackedScene" uid="uid://dn1btv0e0ses7" path="res://core/fireworks.tscn" id="47_q7p65"]
|
||||
[ext_resource type="PackedScene" uid="uid://ccg8aaxoghjpq" path="res://tgcc/chunk/countryside/scene/rice/river/scene/chunk_river_straight_3.tscn" id="48_ihpv1"]
|
||||
[ext_resource type="Script" uid="uid://cx2tlvxhvatj5" path="res://docs/museums/daynight/control.gd" id="48_r5xyi"]
|
||||
[ext_resource type="PackedScene" uid="uid://bei7fscn77p1p" path="res://core/main_scene_ui/main_scene_ui.tscn" id="49_exdk1"]
|
||||
[ext_resource type="PackedScene" uid="uid://vni5kjalum6d" path="res://core/photo_mode/runtime/photo_mode_controller.tscn" id="50_57hhv"]
|
||||
[ext_resource type="PackedScene" uid="uid://bujym3ai10i7q" path="res://tgcc/chunk/countryside/scene/tea/chunk_country_tea_corner_01.tscn" id="51_lxncq"]
|
||||
[ext_resource type="PackedScene" uid="uid://bdfosig4g14vt" path="res://tgcc/chunk/countryside/scene/tea/chunk_country_tea_corner_02.tscn" id="52_317hq"]
|
||||
[ext_resource type="PackedScene" uid="uid://ffblnqib7fry" path="res://tgcc/chunk/countryside/scene/tea/chunk_country_tea_cross_3_01.tscn" id="53_0ur37"]
|
||||
[ext_resource type="PackedScene" uid="uid://b785qpoxbrovj" path="res://tgcc/chunk/countryside/scene/tea/chunk_country_tea_cross_3_02.tscn" id="54_vbb0s"]
|
||||
[ext_resource type="PackedScene" uid="uid://c0bgxecgl4qav" path="res://tgcc/chunk/countryside/scene/tea/chunk_country_tea_end_01.tscn" id="55_qmm8e"]
|
||||
[ext_resource type="PackedScene" uid="uid://cn1fr8wkb4k2w" path="res://tgcc/chunk/countryside/scene/tea/chunk_country_tea_end_02.tscn" id="56_gklva"]
|
||||
[ext_resource type="PackedScene" uid="uid://bfbd7kvcd6uf6" path="res://tgcc/chunk/countryside/scene/tea/chunk_country_tea_end_03.tscn" id="57_tbumt"]
|
||||
[ext_resource type="PackedScene" uid="uid://che0eemntxhwf" path="res://tgcc/chunk/countryside/scene/tea/chunk_country_tea_straight_02.tscn" id="58_qn3jn"]
|
||||
[ext_resource type="PackedScene" uid="uid://dvl8dae0u2abx" path="res://tgcc/chunk/countryside/scene/tea/chunk_country_tea_straight_03.tscn" id="59_auq23"]
|
||||
[ext_resource type="PackedScene" uid="uid://c7f64uvjdoq65" path="res://tgcc/chunk/countryside/scene/tea/chunk_country_tea_straight_04.tscn" id="60_kwioe"]
|
||||
[ext_resource type="PackedScene" uid="uid://bw8dg3705vl07" path="res://tgcc/chunk/countryside/scene/tea/river/chunk_river_tea_curve_3.tscn" id="61_5hspt"]
|
||||
[ext_resource type="PackedScene" uid="uid://blco6nv1806fh" path="res://tgcc/chunk/countryside/scene/tea/river/chunk_river_tea_end_1.tscn" id="62_jn0vv"]
|
||||
[ext_resource type="PackedScene" uid="uid://51pjkj11tyg0" path="res://tgcc/chunk/countryside/scene/tea/river/chunk_river_tea_mix1_1.tscn" id="63_m2lii"]
|
||||
[ext_resource type="PackedScene" uid="uid://dvqsjv10xymt0" path="res://tgcc/chunk/countryside/scene/tea/river/chunk_river_tea_mix3_1.tscn" id="64_uix1h"]
|
||||
[ext_resource type="PackedScene" uid="uid://c1x1ymwqgv6kn" path="res://tgcc/chunk/countryside/scene/tea/river/chunk_river_tea_mix4_1.tscn" id="65_1oect"]
|
||||
[ext_resource type="PackedScene" uid="uid://bngs7h05fppfy" path="res://tgcc/chunk/countryside/scene/tea/river/chunk_river_tea_mix6_1.tscn" id="66_he4of"]
|
||||
[ext_resource type="PackedScene" uid="uid://dn4jmmit4td1d" path="res://tgcc/chunk/countryside/scene/tea/river/chunk_river_tea_straight_1.tscn" id="67_v37u7"]
|
||||
[ext_resource type="PackedScene" uid="uid://cykkwpsq7d3ex" path="res://tgcc/chunk/countryside/scene/tea/river/chunk_river_tea_straight_5.tscn" id="68_f365j"]
|
||||
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_wjpfq"]
|
||||
fractal_lacunarity = 1.915
|
||||
@@ -130,7 +165,7 @@ compositor_effects = Array[CompositorEffect]([SubResource("CompositorEffect_q52t
|
||||
[sub_resource type="Resource" id="Resource_3qrd0"]
|
||||
script = ExtResource("6_jfe74")
|
||||
name = "countryside"
|
||||
available_chunks = Array[PackedScene]([ExtResource("7_5lqbd"), ExtResource("8_aiwf5"), ExtResource("9_0gakq"), ExtResource("10_8taq1"), ExtResource("11_bx28o"), ExtResource("12_e3o1y"), ExtResource("13_pesa5"), ExtResource("8_aiwf5"), ExtResource("14_d5byn"), ExtResource("15_vk128"), ExtResource("16_0l4fn"), ExtResource("17_0l3s0"), ExtResource("18_0mfe6"), ExtResource("19_8ws46"), ExtResource("20_fv7f0"), ExtResource("21_psqnm"), ExtResource("22_j4kwo"), ExtResource("23_53r6v"), ExtResource("24_esnpb"), ExtResource("25_6ik1i"), ExtResource("26_x7bpo"), ExtResource("27_e6m8d"), ExtResource("28_jdvk1"), ExtResource("29_otsi4"), ExtResource("30_pvks6"), ExtResource("31_36ld5"), ExtResource("32_4i5nu"), ExtResource("33_3gjue")])
|
||||
available_chunks = Array[PackedScene]([ExtResource("7_lrm81"), ExtResource("8_1iysf"), ExtResource("9_qulo6"), ExtResource("10_s8w8r"), ExtResource("11_qgu6k"), ExtResource("12_ouhay"), ExtResource("13_no2mr"), ExtResource("14_civl4"), ExtResource("15_q1p61"), ExtResource("16_n6l0c"), ExtResource("17_j3l3o"), ExtResource("18_6r6jj"), ExtResource("19_1bb1l"), ExtResource("8_aiwf5"), ExtResource("9_0gakq"), ExtResource("10_8taq1"), ExtResource("11_bx28o"), ExtResource("12_e3o1y"), ExtResource("13_pesa5"), ExtResource("26_cuni5"), ExtResource("7_5lqbd"), ExtResource("14_d5byn"), ExtResource("15_vk128"), ExtResource("16_0l4fn"), ExtResource("17_0l3s0"), ExtResource("18_0mfe6"), ExtResource("33_hv7ul"), ExtResource("24_esnpb"), ExtResource("33_3gjue"), ExtResource("19_8ws46"), ExtResource("29_otsi4"), ExtResource("31_36ld5"), ExtResource("21_psqnm"), ExtResource("22_j4kwo"), ExtResource("23_53r6v"), ExtResource("25_6ik1i"), ExtResource("26_x7bpo"), ExtResource("27_e6m8d"), ExtResource("28_jdvk1"), ExtResource("20_fv7f0"), ExtResource("47_i22ig"), ExtResource("48_ihpv1"), ExtResource("30_pvks6"), ExtResource("32_4i5nu"), ExtResource("51_lxncq"), ExtResource("52_317hq"), ExtResource("53_0ur37"), ExtResource("54_vbb0s"), ExtResource("55_qmm8e"), ExtResource("56_gklva"), ExtResource("57_tbumt"), ExtResource("58_qn3jn"), ExtResource("59_auq23"), ExtResource("60_kwioe"), ExtResource("61_5hspt"), ExtResource("62_jn0vv"), ExtResource("63_m2lii"), ExtResource("64_uix1h"), ExtResource("65_1oect"), ExtResource("66_he4of"), ExtResource("67_v37u7"), ExtResource("68_f365j")])
|
||||
metadata/_custom_type_script = "uid://wv6kcqkibium"
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_pypsn"]
|
||||
@@ -202,11 +237,11 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 280, 0, 0)
|
||||
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 270, 2, -0.101)
|
||||
curve = SubResource("Curve3D_ndco5")
|
||||
script = ExtResource("44_rcqo0")
|
||||
train_model = ExtResource("45_c0jxs")
|
||||
train_model = ExtResource("46_8w5ju")
|
||||
wagon_pool = ExtResource("46_exdk1")
|
||||
wagon_count = 4
|
||||
wagon_gap = 0.5
|
||||
wagon_spacing_scale = 0.7999999999999999
|
||||
wagon_count = 5
|
||||
wagon_gap = 0.8
|
||||
wagon_spacing_scale = 0.9
|
||||
cameras = NodePath("../cameras")
|
||||
sleepers_model = ExtResource("46_lbmv2")
|
||||
fireworks_scene = ExtResource("47_q7p65")
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
[ext_resource type="Material" uid="uid://o31kp0jm07q3" path="res://tgcc/chunk/material/rocks.tres" id="5_pj7tp"]
|
||||
[ext_resource type="Material" uid="uid://d4vsl672lwv7" path="res://tgcc/chunk/material/rocks2.tres" id="6_5hjh1"]
|
||||
[ext_resource type="Shader" uid="uid://d0ch5ofrgf7y6" path="res://core/daynight/trunk_shader.gdshader" id="8_d3e7a"]
|
||||
[ext_resource type="Script" uid="uid://5frq4qrokiy2" path="res://tgcc/train/train_glass_emission.gd" id="9_4qk3b"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_fuy7x"]
|
||||
render_priority = 0
|
||||
@@ -31,17 +32,18 @@ shader_parameter/emission_color = Color(0.3875077, 0.16205889, 0.035861596, 1)
|
||||
shader_parameter/emission_energy = 12.00000057
|
||||
|
||||
[node name="Treno" unique_id=1182090923 instance=ExtResource("1_33mei")]
|
||||
script = ExtResource("9_4qk3b")
|
||||
|
||||
[node name="Finestrini" parent="." index="0" unique_id=1797001001]
|
||||
[node name="Finestrini" parent="." index="0" unique_id=271431519]
|
||||
surface_material_override/0 = ExtResource("2_bks4l")
|
||||
surface_material_override/1 = ExtResource("3_sgpgi")
|
||||
surface_material_override/2 = ExtResource("4_gua5y")
|
||||
|
||||
[node name="Ruote" parent="." index="1" unique_id=226016697]
|
||||
[node name="Ruote" parent="." index="1" unique_id=1570760095]
|
||||
surface_material_override/0 = ExtResource("5_pj7tp")
|
||||
surface_material_override/1 = ExtResource("4_gua5y")
|
||||
|
||||
[node name="Train" parent="." index="2" unique_id=1876679965]
|
||||
[node name="Train" parent="." index="2" unique_id=301191703]
|
||||
surface_material_override/0 = ExtResource("6_5hjh1")
|
||||
surface_material_override/1 = ExtResource("2_5yo4e")
|
||||
surface_material_override/2 = ExtResource("2_bks4l")
|
||||
|
||||
100
tgcc/train/train_glass_emission.gd
Normal file
100
tgcc/train/train_glass_emission.gd
Normal file
@@ -0,0 +1,100 @@
|
||||
## Updates the train window emission during the day/night cycle.
|
||||
extends Node3D
|
||||
|
||||
@export_group("Windows")
|
||||
@export var glass_surface_index: int = 1
|
||||
@export var morning_emissive_intensity: float = 0.0
|
||||
@export var night_emissive_intensity: float = 8.0
|
||||
|
||||
var _glass_material: ShaderMaterial
|
||||
var _sunrise_time: float = 0.0
|
||||
var _night_time: float = 0.0
|
||||
|
||||
@onready var _finestrini: MeshInstance3D = $Finestrini
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
var environment_manager: EnvironmentManagerRoot = _get_environment_manager()
|
||||
if environment_manager == null or environment_manager.environment_config == null:
|
||||
return
|
||||
|
||||
_sunrise_time = environment_manager.environment_config.sunrise
|
||||
_night_time = environment_manager.environment_config.night
|
||||
|
||||
if _finestrini != null:
|
||||
_glass_material = _finestrini.get_surface_override_material(glass_surface_index) as ShaderMaterial
|
||||
|
||||
_apply_emissive_intensity(_get_current_normalized_time())
|
||||
|
||||
if not UIEvents.day_time_changed.is_connected(_on_day_time_changed):
|
||||
UIEvents.day_time_changed.connect(_on_day_time_changed)
|
||||
|
||||
|
||||
func _exit_tree() -> void:
|
||||
if UIEvents.day_time_changed.is_connected(_on_day_time_changed):
|
||||
UIEvents.day_time_changed.disconnect(_on_day_time_changed)
|
||||
|
||||
|
||||
func _get_current_normalized_time() -> float:
|
||||
var environment_manager: EnvironmentManagerRoot = _get_environment_manager()
|
||||
if environment_manager == null:
|
||||
return _sunrise_time
|
||||
|
||||
if environment_manager.day_night_controller != null:
|
||||
return environment_manager.day_night_controller.current_time
|
||||
|
||||
if environment_manager.environment_config != null:
|
||||
return environment_manager.environment_config.start_time
|
||||
|
||||
return _sunrise_time
|
||||
|
||||
|
||||
func _get_environment_manager() -> EnvironmentManagerRoot:
|
||||
var current_scene: Node = get_tree().current_scene
|
||||
if current_scene == null:
|
||||
return null
|
||||
|
||||
for child in current_scene.get_children():
|
||||
var environment_manager := child as EnvironmentManagerRoot
|
||||
if environment_manager != null:
|
||||
return environment_manager
|
||||
|
||||
return null
|
||||
|
||||
|
||||
func _apply_emissive_intensity(normalized_time: float) -> void:
|
||||
if _glass_material == null:
|
||||
return
|
||||
|
||||
_glass_material.set_shader_parameter(
|
||||
"intensita_emissiva",
|
||||
_calculate_emissive_intensity(normalized_time)
|
||||
)
|
||||
|
||||
|
||||
func _calculate_emissive_intensity(normalized_time: float) -> float:
|
||||
var wrapped_time: float = wrapf(normalized_time, 0.0, 1.0)
|
||||
var sunrise_time: float = clampf(_sunrise_time, 0.0, 1.0)
|
||||
var night_time: float = clampf(_night_time, sunrise_time, 1.0)
|
||||
|
||||
if sunrise_time > 0.0 and wrapped_time < sunrise_time:
|
||||
var night_to_morning_t: float = wrapped_time / sunrise_time
|
||||
return lerpf(
|
||||
night_emissive_intensity,
|
||||
morning_emissive_intensity,
|
||||
night_to_morning_t
|
||||
)
|
||||
|
||||
if is_equal_approx(night_time, sunrise_time):
|
||||
return morning_emissive_intensity
|
||||
|
||||
var morning_to_night_t: float = inverse_lerp(sunrise_time, night_time, wrapped_time)
|
||||
return lerpf(
|
||||
morning_emissive_intensity,
|
||||
night_emissive_intensity,
|
||||
clampf(morning_to_night_t, 0.0, 1.0)
|
||||
)
|
||||
|
||||
|
||||
func _on_day_time_changed(value: float, _time_string: String) -> void:
|
||||
_apply_emissive_intensity(value)
|
||||
1
tgcc/train/train_glass_emission.gd.uid
Normal file
1
tgcc/train/train_glass_emission.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://5frq4qrokiy2
|
||||
Reference in New Issue
Block a user