Compare commits
5 Commits
9bc7f38d07
...
fix_snow_r
| Author | SHA1 | Date | |
|---|---|---|---|
| 2aa7d1f7d4 | |||
| 040ded5f0b | |||
| ddec91d515 | |||
| d8efa735dd | |||
| 70d3dfe15c |
13
.idea/.gitignore
generated
vendored
Normal file
13
.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# Rider ignored files
|
||||||
|
/contentModel.xml
|
||||||
|
/modules.xml
|
||||||
|
/projectSettingsUpdater.xml
|
||||||
|
/.idea.tgcc.iml
|
||||||
|
# Editor-based HTTP Client requests
|
||||||
|
/httpRequests/
|
||||||
|
# Datasource local storage ignored files
|
||||||
|
/dataSources/
|
||||||
|
/dataSources.local.xml
|
||||||
4
.idea/encodings.xml
generated
Normal file
4
.idea/encodings.xml
generated
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
|
||||||
|
</project>
|
||||||
8
.idea/indexLayout.xml
generated
Normal file
8
.idea/indexLayout.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="UserContentModel">
|
||||||
|
<attachedFolders />
|
||||||
|
<explicitIncludes />
|
||||||
|
<explicitExcludes />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
51
core/ai/agents/base/ai_base.gd
Normal file
51
core/ai/agents/base/ai_base.gd
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
extends CharacterBody3D
|
||||||
|
|
||||||
|
class_name AIBase
|
||||||
|
|
||||||
|
@export var speed: float = 4.0
|
||||||
|
var _enable_state_machine: bool = true
|
||||||
|
@export var enable_state_machine: bool:
|
||||||
|
set(value):
|
||||||
|
_enable_state_machine = value
|
||||||
|
toggle_enable_state_machine()
|
||||||
|
get:
|
||||||
|
return _enable_state_machine
|
||||||
|
|
||||||
|
|
||||||
|
@onready var patrol_radius_shape: CollisionShape3D = $%PatrolRadiusShape
|
||||||
|
@onready var nav_agent: NavigationAgent3D = $%NavigationAgent3D
|
||||||
|
@onready var state_machine: StateMachine = $%StateMachine
|
||||||
|
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
randomize()
|
||||||
|
toggle_enable_state_machine()
|
||||||
|
|
||||||
|
func toggle_enable_state_machine() -> void:
|
||||||
|
state_machine.enable = _enable_state_machine
|
||||||
|
|
||||||
|
func _physics_process(delta: float) -> void:
|
||||||
|
if !_enable_state_machine:
|
||||||
|
return
|
||||||
|
|
||||||
|
state_machine.physics_process(delta)
|
||||||
|
|
||||||
|
if nav_agent.is_navigation_finished():
|
||||||
|
velocity = Vector3.ZERO
|
||||||
|
move_and_slide()
|
||||||
|
return
|
||||||
|
|
||||||
|
var next_point = nav_agent.get_next_path_position()
|
||||||
|
var direction = global_position.direction_to(next_point)
|
||||||
|
|
||||||
|
velocity.x = direction.x * speed
|
||||||
|
velocity.z = direction.z * speed
|
||||||
|
|
||||||
|
move_and_slide()
|
||||||
|
|
||||||
|
func navigate_to_random_point() -> void:
|
||||||
|
var nav_map_rid = get_world_3d().get_navigation_map()
|
||||||
|
var patrol_radius = patrol_radius_shape.shape.radius
|
||||||
|
var target_point_in_space = global_position + Vector3(randf_range(-1, 1), 0, randf_range(-1, 1)).normalized() * randf_range(0, patrol_radius)
|
||||||
|
var closest_valid_point = NavigationServer3D.map_get_closest_point(nav_map_rid, target_point_in_space)
|
||||||
|
nav_agent.target_position = closest_valid_point
|
||||||
1
core/ai/agents/base/ai_base.gd.uid
Normal file
1
core/ai/agents/base/ai_base.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://b30p1yqojbbbk
|
||||||
44
core/ai/agents/base/ai_base.tscn
Normal file
44
core/ai/agents/base/ai_base.tscn
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
[gd_scene format=3 uid="uid://clx701xdwelgx"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://b30p1yqojbbbk" path="res://core/ai/agents/base/ai_base.gd" id="1_4d1nn"]
|
||||||
|
[ext_resource type="Script" uid="uid://ps3vlu2qvmop" path="res://core/ai/framework/state_machine.gd" id="2_q1hg3"]
|
||||||
|
[ext_resource type="Script" uid="uid://nga8qx56iwgu" path="res://core/ai/agents/base/idle_state.gd" id="3_26faq"]
|
||||||
|
[ext_resource type="Script" uid="uid://bngfthvt04ivv" path="res://core/ai/agents/base/patrol_state.gd" id="4_lim44"]
|
||||||
|
|
||||||
|
[sub_resource type="CapsuleMesh" id="CapsuleMesh_mh3lg"]
|
||||||
|
|
||||||
|
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_mh3lg"]
|
||||||
|
|
||||||
|
[sub_resource type="SphereShape3D" id="SphereShape3D_lim44"]
|
||||||
|
radius = 20.0
|
||||||
|
|
||||||
|
[node name="AiBase" type="CharacterBody3D" unique_id=1228675528]
|
||||||
|
script = ExtResource("1_4d1nn")
|
||||||
|
|
||||||
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="." unique_id=214482161]
|
||||||
|
mesh = SubResource("CapsuleMesh_mh3lg")
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=92811823]
|
||||||
|
shape = SubResource("CapsuleShape3D_mh3lg")
|
||||||
|
|
||||||
|
[node name="NavigationAgent3D" type="NavigationAgent3D" parent="." unique_id=1370024449]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
|
||||||
|
[node name="StateMachine" type="Node" parent="." unique_id=1286404264 node_paths=PackedStringArray("initial_state")]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
script = ExtResource("2_q1hg3")
|
||||||
|
initial_state = NodePath("IdleState")
|
||||||
|
|
||||||
|
[node name="IdleState" type="Node" parent="StateMachine" unique_id=763668255]
|
||||||
|
script = ExtResource("3_26faq")
|
||||||
|
state_id = &"idle"
|
||||||
|
|
||||||
|
[node name="PatrolState" type="Node" parent="StateMachine" unique_id=2054606629]
|
||||||
|
script = ExtResource("4_lim44")
|
||||||
|
state_id = &"patrol"
|
||||||
|
|
||||||
|
[node name="PatrolRadiusShape" type="CollisionShape3D" parent="." unique_id=1379515938]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
shape = SubResource("SphereShape3D_lim44")
|
||||||
|
disabled = true
|
||||||
|
debug_color = Color(1, 1, 0, 1)
|
||||||
26
core/ai/agents/base/idle_state.gd
Normal file
26
core/ai/agents/base/idle_state.gd
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
extends State
|
||||||
|
|
||||||
|
const PATROL_STATE_ID: StringName = &"patrol"
|
||||||
|
|
||||||
|
@export var wait_time: float = 3.0
|
||||||
|
|
||||||
|
var runtime_timer: Timer
|
||||||
|
|
||||||
|
func enter() -> void:
|
||||||
|
runtime_timer = Timer.new()
|
||||||
|
runtime_timer.name = "IdleTimer"
|
||||||
|
add_child(runtime_timer)
|
||||||
|
runtime_timer.one_shot = true
|
||||||
|
runtime_timer.timeout.connect(_on_timer_timeout)
|
||||||
|
runtime_timer.start(wait_time)
|
||||||
|
|
||||||
|
func exit() -> void:
|
||||||
|
if runtime_timer:
|
||||||
|
if runtime_timer.is_connected("timeout", _on_timer_timeout):
|
||||||
|
runtime_timer.timeout.disconnect(_on_timer_timeout)
|
||||||
|
|
||||||
|
runtime_timer.queue_free()
|
||||||
|
runtime_timer = null
|
||||||
|
|
||||||
|
func _on_timer_timeout() -> void:
|
||||||
|
transitioned.emit(self, PATROL_STATE_ID)
|
||||||
1
core/ai/agents/base/idle_state.gd.uid
Normal file
1
core/ai/agents/base/idle_state.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://nga8qx56iwgu
|
||||||
12
core/ai/agents/base/patrol_state.gd
Normal file
12
core/ai/agents/base/patrol_state.gd
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
extends State
|
||||||
|
|
||||||
|
const IDLE_STATE_ID: StringName = &"idle"
|
||||||
|
|
||||||
|
@onready var agent: AIBase = owner
|
||||||
|
|
||||||
|
func enter() -> void:
|
||||||
|
agent.navigate_to_random_point()
|
||||||
|
|
||||||
|
func physics_update(_delta) -> void:
|
||||||
|
if agent.nav_agent.is_navigation_finished():
|
||||||
|
transitioned.emit(self, IDLE_STATE_ID)
|
||||||
1
core/ai/agents/base/patrol_state.gd.uid
Normal file
1
core/ai/agents/base/patrol_state.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://bngfthvt04ivv
|
||||||
20
core/ai/framework/state.gd
Normal file
20
core/ai/framework/state.gd
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
extends Node
|
||||||
|
|
||||||
|
class_name State
|
||||||
|
|
||||||
|
@export var state_id: StringName = &""
|
||||||
|
|
||||||
|
@warning_ignore("unused_signal")
|
||||||
|
signal transitioned(state: State, new_state_id: StringName)
|
||||||
|
|
||||||
|
func enter() -> void:
|
||||||
|
pass
|
||||||
|
|
||||||
|
func exit() -> void:
|
||||||
|
pass
|
||||||
|
|
||||||
|
func update(_delta) -> void:
|
||||||
|
pass
|
||||||
|
|
||||||
|
func physics_update(_delta) -> void:
|
||||||
|
pass
|
||||||
1
core/ai/framework/state.gd.uid
Normal file
1
core/ai/framework/state.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://dpso7abi5ftyw
|
||||||
61
core/ai/framework/state_machine.gd
Normal file
61
core/ai/framework/state_machine.gd
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
extends Node
|
||||||
|
|
||||||
|
class_name StateMachine
|
||||||
|
|
||||||
|
@export var initial_state: State
|
||||||
|
|
||||||
|
var current_state: State
|
||||||
|
var states: Dictionary[StringName, State] = {}
|
||||||
|
var is_initialized: bool = false
|
||||||
|
var _enabled: bool = true
|
||||||
|
var enable: bool:
|
||||||
|
set(value):
|
||||||
|
_enabled = value
|
||||||
|
_set_enabled(value)
|
||||||
|
get:
|
||||||
|
return _enabled
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
_initialize_states()
|
||||||
|
_set_enabled(enable)
|
||||||
|
|
||||||
|
func _initialize_states() -> void:
|
||||||
|
if is_initialized:
|
||||||
|
return
|
||||||
|
|
||||||
|
for state in get_children():
|
||||||
|
if state is State:
|
||||||
|
states[state.state_id] = state
|
||||||
|
state.transitioned.connect(_on_state_transition)
|
||||||
|
|
||||||
|
is_initialized = true
|
||||||
|
|
||||||
|
func _set_enabled(value: bool) -> void:
|
||||||
|
_enabled = value
|
||||||
|
|
||||||
|
if not _enabled:
|
||||||
|
return
|
||||||
|
|
||||||
|
_initialize_states()
|
||||||
|
|
||||||
|
if initial_state and current_state == null:
|
||||||
|
current_state = initial_state
|
||||||
|
current_state.enter()
|
||||||
|
|
||||||
|
func physics_process(delta) -> void:
|
||||||
|
if current_state and _enabled:
|
||||||
|
current_state.physics_update(delta)
|
||||||
|
|
||||||
|
func _on_state_transition(state: State, new_state_id: StringName) -> void:
|
||||||
|
if state != current_state:
|
||||||
|
return
|
||||||
|
|
||||||
|
var new_state = states.get(new_state_id)
|
||||||
|
if not new_state:
|
||||||
|
return
|
||||||
|
|
||||||
|
if current_state:
|
||||||
|
current_state.exit()
|
||||||
|
|
||||||
|
current_state = new_state
|
||||||
|
current_state.enter()
|
||||||
1
core/ai/framework/state_machine.gd.uid
Normal file
1
core/ai/framework/state_machine.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://ps3vlu2qvmop
|
||||||
31
core/audio/audio_manager.gd
Normal file
31
core/audio/audio_manager.gd
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
extends Node
|
||||||
|
|
||||||
|
const MIN_VOLUME: float = 0.0
|
||||||
|
const MAX_VOLUME: float = 1.0
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
load_save_data()
|
||||||
|
|
||||||
|
func load_save_data() -> void:
|
||||||
|
for bus_name in GameState.save_data.audio_bus_volumes:
|
||||||
|
_apply_audio_bus_volume(bus_name, GameState.save_data.audio_bus_volumes[bus_name])
|
||||||
|
|
||||||
|
func set_audio_bus_volume(bus_name: StringName, linear_value: float) -> void:
|
||||||
|
var normalized_bus_name := str(bus_name)
|
||||||
|
var clamped_value := clampf(linear_value, MIN_VOLUME, MAX_VOLUME)
|
||||||
|
|
||||||
|
GameState.save_data.audio_bus_volumes[normalized_bus_name] = clamped_value
|
||||||
|
_apply_audio_bus_volume(normalized_bus_name, clamped_value)
|
||||||
|
GameState.save_game()
|
||||||
|
|
||||||
|
func get_audio_bus_volume(bus_name: StringName, default_value: float = 1.0) -> float:
|
||||||
|
return float(GameState.save_data.audio_bus_volumes.get(str(bus_name), default_value))
|
||||||
|
|
||||||
|
func _apply_audio_bus_volume(bus_name: String, linear_value: float) -> void:
|
||||||
|
var bus_index := AudioServer.get_bus_index(bus_name)
|
||||||
|
if bus_index == -1:
|
||||||
|
return
|
||||||
|
|
||||||
|
var clamped_value := clampf(linear_value, MIN_VOLUME, MAX_VOLUME)
|
||||||
|
AudioServer.set_bus_volume_db(bus_index, linear_to_db(clamped_value))
|
||||||
|
AudioServer.set_bus_mute(bus_index, is_zero_approx(clamped_value))
|
||||||
1
core/audio/audio_manager.gd.uid
Normal file
1
core/audio/audio_manager.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://dcttbbavtwtsg
|
||||||
56
core/audio/settings/audio_option.gd
Normal file
56
core/audio/settings/audio_option.gd
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
extends VBoxContainer
|
||||||
|
|
||||||
|
class_name AudioOption
|
||||||
|
|
||||||
|
const MIN_VOLUME: float = 0.0
|
||||||
|
const MAX_VOLUME: float = 1.0
|
||||||
|
|
||||||
|
@export var bus_name: StringName = &"Master"
|
||||||
|
@export var label_text: String = "Master Volume"
|
||||||
|
@export_range(0.0, 1.0, 0.01) var default_volume: float = 1.0
|
||||||
|
|
||||||
|
@onready var label: Label = $Label
|
||||||
|
@onready var slider: HSlider = $HSlider
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
slider.min_value = MIN_VOLUME
|
||||||
|
slider.max_value = MAX_VOLUME
|
||||||
|
slider.step = 0.01
|
||||||
|
slider.value_changed.connect(_on_slider_value_changed)
|
||||||
|
refresh()
|
||||||
|
|
||||||
|
func refresh() -> void:
|
||||||
|
label.text = label_text
|
||||||
|
|
||||||
|
if not has_bus():
|
||||||
|
slider.set_value_no_signal(default_volume)
|
||||||
|
slider.editable = false
|
||||||
|
label.text = "%s (bus missing)" % label_text
|
||||||
|
return
|
||||||
|
|
||||||
|
slider.editable = true
|
||||||
|
var saved_volume := AudioManager.get_audio_bus_volume(bus_name, default_volume)
|
||||||
|
slider.set_value_no_signal(saved_volume)
|
||||||
|
apply_current_value()
|
||||||
|
|
||||||
|
func reset_to_default() -> void:
|
||||||
|
slider.value = default_volume
|
||||||
|
|
||||||
|
func apply_current_value() -> void:
|
||||||
|
_set_bus_volume(slider.value)
|
||||||
|
|
||||||
|
func has_bus() -> bool:
|
||||||
|
return get_bus_index() != -1
|
||||||
|
|
||||||
|
func get_bus_index() -> int:
|
||||||
|
return AudioServer.get_bus_index(bus_name)
|
||||||
|
|
||||||
|
func _set_bus_volume(linear_value: float) -> void:
|
||||||
|
if not has_bus():
|
||||||
|
return
|
||||||
|
|
||||||
|
var clamped_value := clampf(linear_value, MIN_VOLUME, MAX_VOLUME)
|
||||||
|
AudioManager.set_audio_bus_volume(bus_name, clamped_value)
|
||||||
|
|
||||||
|
func _on_slider_value_changed(value: float) -> void:
|
||||||
|
_set_bus_volume(value)
|
||||||
1
core/audio/settings/audio_option.gd.uid
Normal file
1
core/audio/settings/audio_option.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://bnh1y560h55vc
|
||||||
14
core/audio/settings/audio_option.tscn
Normal file
14
core/audio/settings/audio_option.tscn
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
[gd_scene format=3 uid="uid://cescrovsjlwke"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://bnh1y560h55vc" path="res://core/audio/settings/audio_option.gd" id="1_orafl"]
|
||||||
|
|
||||||
|
[node name="AudioOption" type="VBoxContainer" unique_id=1509773712]
|
||||||
|
custom_minimum_size = Vector2(300, 0)
|
||||||
|
script = ExtResource("1_orafl")
|
||||||
|
|
||||||
|
[node name="Label" type="Label" parent="." unique_id=781845786]
|
||||||
|
layout_mode = 2
|
||||||
|
text = "Master Volume"
|
||||||
|
|
||||||
|
[node name="HSlider" type="HSlider" parent="." unique_id=1286896253]
|
||||||
|
layout_mode = 2
|
||||||
36
core/audio/settings/settings_menu.gd
Normal file
36
core/audio/settings/settings_menu.gd
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
extends Control
|
||||||
|
|
||||||
|
class_name SettingsMenu
|
||||||
|
|
||||||
|
@onready var audio_options_container: VBoxContainer = $%AudioOptionsContainer
|
||||||
|
@onready var reset_button: Button = $%ResetToDefault_Button
|
||||||
|
@onready var close_button: Button = $%Close_Button
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
reset_button.pressed.connect(_on_reset_to_default_button_pressed)
|
||||||
|
close_button.pressed.connect(_on_close_button_pressed)
|
||||||
|
_refresh_audio_options()
|
||||||
|
|
||||||
|
func _get_audio_options() -> Array[AudioOption]:
|
||||||
|
var audio_options: Array[AudioOption] = []
|
||||||
|
|
||||||
|
for child in audio_options_container.get_children():
|
||||||
|
if child is AudioOption:
|
||||||
|
audio_options.append(child)
|
||||||
|
|
||||||
|
return audio_options
|
||||||
|
|
||||||
|
func _refresh_audio_options() -> void:
|
||||||
|
for audio_option in _get_audio_options():
|
||||||
|
audio_option.refresh()
|
||||||
|
|
||||||
|
func _apply_current_audio_values() -> void:
|
||||||
|
for audio_option in _get_audio_options():
|
||||||
|
audio_option.apply_current_value()
|
||||||
|
|
||||||
|
func _on_reset_to_default_button_pressed() -> void:
|
||||||
|
for audio_option in _get_audio_options():
|
||||||
|
audio_option.reset_to_default()
|
||||||
|
|
||||||
|
func _on_close_button_pressed() -> void:
|
||||||
|
visible = false
|
||||||
1
core/audio/settings/settings_menu.gd.uid
Normal file
1
core/audio/settings/settings_menu.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://cvr25q1blyxg
|
||||||
74
core/audio/settings/settings_menu.tscn
Normal file
74
core/audio/settings/settings_menu.tscn
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
[gd_scene format=3 uid="uid://caqf471x0kttc"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://cvr25q1blyxg" path="res://core/audio/settings/settings_menu.gd" id="1_4lekq"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://cescrovsjlwke" path="res://core/audio/settings/audio_option.tscn" id="1_hwcco"]
|
||||||
|
|
||||||
|
[node name="SettingsMenu" type="Control" unique_id=1639777294]
|
||||||
|
layout_mode = 3
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
script = ExtResource("1_4lekq")
|
||||||
|
|
||||||
|
[node name="PanelContainer" type="PanelContainer" parent="." unique_id=315821242]
|
||||||
|
layout_mode = 1
|
||||||
|
anchors_preset = 8
|
||||||
|
anchor_left = 0.5
|
||||||
|
anchor_top = 0.5
|
||||||
|
anchor_right = 0.5
|
||||||
|
anchor_bottom = 0.5
|
||||||
|
offset_left = -79.5
|
||||||
|
offset_top = -110.0
|
||||||
|
offset_right = 79.5
|
||||||
|
offset_bottom = 110.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
|
||||||
|
[node name="MarginContainer" type="MarginContainer" parent="PanelContainer" unique_id=648635784]
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_vertical = 0
|
||||||
|
theme_override_constants/margin_left = 12
|
||||||
|
theme_override_constants/margin_top = 12
|
||||||
|
theme_override_constants/margin_right = 12
|
||||||
|
theme_override_constants/margin_bottom = 12
|
||||||
|
|
||||||
|
[node name="AudioOptionsContainer" type="VBoxContainer" parent="PanelContainer/MarginContainer" unique_id=824023653]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
layout_mode = 2
|
||||||
|
theme_override_constants/separation = 12
|
||||||
|
|
||||||
|
[node name="MasterVolume_AudioOption" parent="PanelContainer/MarginContainer/AudioOptionsContainer" unique_id=1509773712 instance=ExtResource("1_hwcco")]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="HSeparator" type="HSeparator" parent="PanelContainer/MarginContainer/AudioOptionsContainer" unique_id=1053430754]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="MusicVolume_AudioOption" parent="PanelContainer/MarginContainer/AudioOptionsContainer" unique_id=690924616 instance=ExtResource("1_hwcco")]
|
||||||
|
layout_mode = 2
|
||||||
|
bus_name = &"Music"
|
||||||
|
label_text = "Music Volume"
|
||||||
|
|
||||||
|
[node name="HSeparator2" type="HSeparator" parent="PanelContainer/MarginContainer/AudioOptionsContainer" unique_id=453716295]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="SFXVolume_AudioOption" parent="PanelContainer/MarginContainer/AudioOptionsContainer" unique_id=2096291127 instance=ExtResource("1_hwcco")]
|
||||||
|
layout_mode = 2
|
||||||
|
bus_name = &"SFX"
|
||||||
|
label_text = "SFX Volume"
|
||||||
|
|
||||||
|
[node name="HSeparator3" type="HSeparator" parent="PanelContainer/MarginContainer/AudioOptionsContainer" unique_id=498553283]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="ResetToDefault_Button" type="Button" parent="PanelContainer/MarginContainer/AudioOptionsContainer" unique_id=720420423]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_horizontal = 0
|
||||||
|
text = "Reset To Default"
|
||||||
|
|
||||||
|
[node name="Close_Button" type="Button" parent="PanelContainer/MarginContainer/AudioOptionsContainer" unique_id=1137906684]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_horizontal = 0
|
||||||
|
text = "Close"
|
||||||
@@ -3,7 +3,6 @@ extends Node3D
|
|||||||
|
|
||||||
const NOISE_TEXTURE: Texture2D = preload("res://core/daynight/noise.tres")
|
const NOISE_TEXTURE: Texture2D = preload("res://core/daynight/noise.tres")
|
||||||
const WEATHER_SHADER: Material = preload("res://core/daynight/weather_overlay.tres")
|
const WEATHER_SHADER: Material = preload("res://core/daynight/weather_overlay.tres")
|
||||||
const WEATHER_PLAIN_SHADER: Material = preload("res://core/daynight/weather_plain_shader.tres")
|
|
||||||
const DYNAMIC_ENVIRONMENT_UPDATES_PER_FRAME: int = 2 #how many update of the environment (apply materials) will be done per frame
|
const DYNAMIC_ENVIRONMENT_UPDATES_PER_FRAME: int = 2 #how many update of the environment (apply materials) will be done per frame
|
||||||
|
|
||||||
@export var environment_config: EnvironmentConfig
|
@export var environment_config: EnvironmentConfig
|
||||||
@@ -134,7 +133,7 @@ func _apply_dynamic_environment_materials(node: Node) -> void:
|
|||||||
_apply_weather_overlay_to_node(node, WEATHER_SHADER)
|
_apply_weather_overlay_to_node(node, WEATHER_SHADER)
|
||||||
|
|
||||||
if node.is_in_group("weather_vegetables_node"):
|
if node.is_in_group("weather_vegetables_node"):
|
||||||
_apply_weather_overlay_to_node(node, WEATHER_PLAIN_SHADER)
|
_clear_weather_overlay_from_node(node)
|
||||||
|
|
||||||
func ApplyWindNoiseToMaterials():
|
func ApplyWindNoiseToMaterials():
|
||||||
for node in get_tree().get_nodes_in_group("wind_node"):
|
for node in get_tree().get_nodes_in_group("wind_node"):
|
||||||
@@ -160,15 +159,54 @@ func ApplyWeatherShaderToMaterials():
|
|||||||
_apply_weather_overlay_to_node(node, WEATHER_SHADER)
|
_apply_weather_overlay_to_node(node, WEATHER_SHADER)
|
||||||
|
|
||||||
for node in get_tree().get_nodes_in_group("weather_vegetables_node"):
|
for node in get_tree().get_nodes_in_group("weather_vegetables_node"):
|
||||||
_apply_weather_overlay_to_node(node, WEATHER_PLAIN_SHADER)
|
_clear_weather_overlay_from_node(node)
|
||||||
|
|
||||||
func _apply_weather_overlay_to_node(node: Node, material: Material) -> void:
|
func _apply_weather_overlay_to_node(node: Node, material: Material) -> void:
|
||||||
|
if node.is_in_group("weather_vegetables_node"):
|
||||||
|
_clear_weather_overlay_from_node(node)
|
||||||
|
return
|
||||||
|
|
||||||
if node is GeometryInstance3D:
|
if node is GeometryInstance3D:
|
||||||
node.material_overlay = material
|
if _geometry_uses_alpha_texture(node):
|
||||||
|
node.material_overlay = null
|
||||||
|
else:
|
||||||
|
node.material_overlay = material
|
||||||
|
|
||||||
for child in node.get_children():
|
for child in node.get_children():
|
||||||
_apply_weather_overlay_to_node(child, material)
|
_apply_weather_overlay_to_node(child, material)
|
||||||
|
|
||||||
|
func _clear_weather_overlay_from_node(node: Node) -> void:
|
||||||
|
if node is GeometryInstance3D:
|
||||||
|
node.material_overlay = null
|
||||||
|
|
||||||
|
for child in node.get_children():
|
||||||
|
_clear_weather_overlay_from_node(child)
|
||||||
|
|
||||||
|
func _geometry_uses_alpha_texture(node: GeometryInstance3D) -> bool:
|
||||||
|
var material_override := node.material_override as ShaderMaterial
|
||||||
|
if _shader_material_uses_alpha_texture(material_override):
|
||||||
|
return true
|
||||||
|
|
||||||
|
if node is MeshInstance3D:
|
||||||
|
for surface_index in node.get_surface_override_material_count():
|
||||||
|
var surface_material := node.get_surface_override_material(surface_index) as ShaderMaterial
|
||||||
|
if _shader_material_uses_alpha_texture(surface_material):
|
||||||
|
return true
|
||||||
|
|
||||||
|
if node.mesh:
|
||||||
|
for surface_index in node.mesh.get_surface_count():
|
||||||
|
var mesh_material := node.mesh.surface_get_material(surface_index) as ShaderMaterial
|
||||||
|
if _shader_material_uses_alpha_texture(mesh_material):
|
||||||
|
return true
|
||||||
|
|
||||||
|
return false
|
||||||
|
|
||||||
|
func _shader_material_uses_alpha_texture(material: ShaderMaterial) -> bool:
|
||||||
|
if material == null or material.shader == null:
|
||||||
|
return false
|
||||||
|
|
||||||
|
return material.shader.code.find("alpha_texture") != -1
|
||||||
|
|
||||||
func select_day_time(normalized_time: float) -> void:
|
func select_day_time(normalized_time: float) -> void:
|
||||||
#set show_day_time_debug = true to show debug on screen
|
#set show_day_time_debug = true to show debug on screen
|
||||||
#normalized_time is a value between 0 and 1; the time of the day is calculate as "normalized_time" * 1440; day_time is the step to pass from sunrise, to day, to sunset, to night
|
#normalized_time is a value between 0 and 1; the time of the day is calculate as "normalized_time" * 1440; day_time is the step to pass from sunrise, to day, to sunset, to night
|
||||||
|
|||||||
@@ -67,7 +67,6 @@ void fragment() {
|
|||||||
float is_center = step(center_sharpness, internal_n);
|
float is_center = step(center_sharpness, internal_n);
|
||||||
|
|
||||||
ALBEDO = shadow_color;
|
ALBEDO = shadow_color;
|
||||||
|
|
||||||
ALPHA = mix(opacity_edge, opacity_center, is_center) * final_fade;
|
ALPHA = mix(opacity_edge, opacity_center, is_center) * final_fade;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,10 +8,12 @@ global uniform float global_wind_speed;
|
|||||||
global uniform float global_wind_strength;
|
global uniform float global_wind_strength;
|
||||||
global uniform vec2 global_wind_direction;
|
global uniform vec2 global_wind_direction;
|
||||||
//global uniform sampler2D global_wind_noise : filter_linear_mipmap;
|
//global uniform sampler2D global_wind_noise : filter_linear_mipmap;
|
||||||
global uniform float global_snow_start_time;
|
global uniform float global_snow_start_time = -1.0;
|
||||||
global uniform float global_snow_accumulation_speed;
|
global uniform float global_snow_accumulation_speed = 0.005;
|
||||||
global uniform float global_snow_melt_time;
|
global uniform float global_snow_melt_time = -1.0;
|
||||||
global uniform float global_snow_melt_speed;
|
global uniform float global_snow_melt_speed = 0.1;
|
||||||
|
global uniform float global_snow_amount = 0.0;
|
||||||
|
global uniform float global_rain_intensity;
|
||||||
|
|
||||||
// --- PARAMETRI ESTETICI ---
|
// --- PARAMETRI ESTETICI ---
|
||||||
uniform bool billboard_enabled = true;
|
uniform bool billboard_enabled = true;
|
||||||
@@ -31,6 +33,7 @@ uniform vec4 variance_color : source_color = vec4(0.3, 0.5, 0.2, 1.0); // Colore
|
|||||||
uniform float variance_intensity : hint_range(0.0, 1.0) = 0.4; // Quanto si vedono le chiazze
|
uniform float variance_intensity : hint_range(0.0, 1.0) = 0.4; // Quanto si vedono le chiazze
|
||||||
|
|
||||||
uniform vec4 snow_color : source_color = vec4(0.85, 0.9, 0.95, 1.0);
|
uniform vec4 snow_color : source_color = vec4(0.85, 0.9, 0.95, 1.0);
|
||||||
|
uniform float snow_visibility : hint_range(0.0, 1.0) = 1.0;
|
||||||
|
|
||||||
// --- CONTROLLO GRADIENTE E RANDOM ---
|
// --- CONTROLLO GRADIENTE E RANDOM ---
|
||||||
uniform float height_min = 0.0;
|
uniform float height_min = 0.0;
|
||||||
@@ -41,6 +44,7 @@ uniform float light_steps : hint_range(1.0, 10.0) = 4.0;
|
|||||||
uniform float random_mix : hint_range(0.0, 1.0) = 0.3;
|
uniform float random_mix : hint_range(0.0, 1.0) = 0.3;
|
||||||
|
|
||||||
uniform float cast_shadow_strength : hint_range(0.0, 1.0) = 0.6;
|
uniform float cast_shadow_strength : hint_range(0.0, 1.0) = 0.6;
|
||||||
|
uniform float wetness_darkening : hint_range(0.0, 0.5) = 0.25;
|
||||||
|
|
||||||
varying vec3 v_final_color;
|
varying vec3 v_final_color;
|
||||||
varying float v_shade_factor;
|
varying float v_shade_factor;
|
||||||
@@ -52,6 +56,21 @@ float hash(vec3 p) {
|
|||||||
return fract((p.x + p.y) * p.z);
|
return fract((p.x + p.y) * p.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float get_snow_progress() {
|
||||||
|
float snow_progress = clamp(global_snow_amount, 0.0, 1.0);
|
||||||
|
|
||||||
|
if (global_snow_start_time >= 0.0) {
|
||||||
|
float timed_progress = clamp((TIME - global_snow_start_time) * global_snow_accumulation_speed, 0.0, 1.0);
|
||||||
|
snow_progress = max(snow_progress, timed_progress);
|
||||||
|
}
|
||||||
|
if (global_snow_melt_time >= 0.0) {
|
||||||
|
float melt = clamp((TIME - global_snow_melt_time) * global_snow_melt_speed, 0.0, 1.0);
|
||||||
|
snow_progress = min(snow_progress, 1.0 - melt);
|
||||||
|
}
|
||||||
|
|
||||||
|
return snow_progress;
|
||||||
|
}
|
||||||
|
|
||||||
void vertex() {
|
void vertex() {
|
||||||
vec3 instance_pos = MODEL_MATRIX[3].xyz;
|
vec3 instance_pos = MODEL_MATRIX[3].xyz;
|
||||||
v_world_pos = instance_pos; // Salviamo la posizione dell'istanza
|
v_world_pos = instance_pos; // Salviamo la posizione dell'istanza
|
||||||
@@ -113,17 +132,10 @@ void fragment() {
|
|||||||
// Applichiamo la variazione al colore finale dell'erba
|
// Applichiamo la variazione al colore finale dell'erba
|
||||||
vec3 varied_grass_color = mix(v_final_color, variance_color.rgb, noise_sample * variance_intensity);
|
vec3 varied_grass_color = mix(v_final_color, variance_color.rgb, noise_sample * variance_intensity);
|
||||||
|
|
||||||
float snow_amount = 0.0;
|
float snow_amount = smoothstep(0.0, 1.0, get_snow_progress());
|
||||||
if (global_snow_start_time >= 0.0) {
|
|
||||||
snow_amount = clamp((TIME - global_snow_start_time) * global_snow_accumulation_speed, 0.0, 1.0);
|
|
||||||
}
|
|
||||||
if (global_snow_melt_time >= 0.0) {
|
|
||||||
float melt = clamp((TIME - global_snow_melt_time) * global_snow_melt_speed, 0.0, 1.0);
|
|
||||||
snow_amount *= (1.0 - melt);
|
|
||||||
}
|
|
||||||
|
|
||||||
float top_mask = 1.0 - shifted_uv.y;
|
float top_mask = 1.0 - shifted_uv.y;
|
||||||
float snow_mask = smoothstep(1.0 - snow_amount, 1.2 - snow_amount, top_mask);
|
float snow_mask = smoothstep(0.65, 1.0, top_mask) * snow_amount * snow_visibility;
|
||||||
snow_mask *= step(0.01, snow_amount);
|
snow_mask *= step(0.01, snow_amount);
|
||||||
|
|
||||||
vec3 dark_snow = snow_color.rgb * (1.0 - shadow_intensity);
|
vec3 dark_snow = snow_color.rgb * (1.0 - shadow_intensity);
|
||||||
@@ -131,12 +143,15 @@ void fragment() {
|
|||||||
|
|
||||||
// Mescoliamo il colore variato con la neve
|
// Mescoliamo il colore variato con la neve
|
||||||
vec3 final_albedo = mix(varied_grass_color, shaded_snow, snow_mask);
|
vec3 final_albedo = mix(varied_grass_color, shaded_snow, snow_mask);
|
||||||
|
float rain_int = clamp(global_rain_intensity, 0.0, 1.0);
|
||||||
|
final_albedo *= mix(1.0, 1.0 - wetness_darkening, rain_int);
|
||||||
|
float final_roughness = mix(0.02, 0.005, rain_int);
|
||||||
|
|
||||||
ALBEDO = final_albedo;
|
ALBEDO = final_albedo;
|
||||||
ALPHA = tex.r * opacity;
|
ALPHA = tex.r * opacity;
|
||||||
ALPHA_SCISSOR_THRESHOLD = 0.5;
|
ALPHA_SCISSOR_THRESHOLD = 0.5;
|
||||||
|
|
||||||
ROUGHNESS = 0.02;
|
ROUGHNESS = final_roughness;
|
||||||
}
|
}
|
||||||
|
|
||||||
void light() {
|
void light() {
|
||||||
|
|||||||
@@ -2,9 +2,10 @@ shader_type spatial;
|
|||||||
render_mode blend_mix, cull_back, depth_draw_opaque;
|
render_mode blend_mix, cull_back, depth_draw_opaque;
|
||||||
|
|
||||||
global uniform float global_snow_start_time = -1.0;
|
global uniform float global_snow_start_time = -1.0;
|
||||||
global uniform float global_snow_accumulation_speed = 0.1;
|
global uniform float global_snow_accumulation_speed = 0.005;
|
||||||
global uniform float global_snow_melt_time = -1.0;
|
global uniform float global_snow_melt_time = -1.0;
|
||||||
global uniform float global_snow_melt_speed = 0.1;
|
global uniform float global_snow_melt_speed = 0.1;
|
||||||
|
global uniform float global_snow_amount = 0.0;
|
||||||
global uniform vec4 global_snow_color = vec4(0.92, 0.96, 1.0, 1.0);
|
global uniform vec4 global_snow_color = vec4(0.92, 0.96, 1.0, 1.0);
|
||||||
|
|
||||||
uniform float max_height : hint_range(0.02, 1.0) = 0.2;
|
uniform float max_height : hint_range(0.02, 1.0) = 0.2;
|
||||||
@@ -51,17 +52,18 @@ float fbm(vec2 p) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
float get_snow_amount() {
|
float get_snow_amount() {
|
||||||
float snow_amount = 0.0;
|
float snow_amount = clamp(global_snow_amount, 0.0, 1.0);
|
||||||
if (global_snow_start_time >= 0.0) {
|
if (global_snow_start_time >= 0.0) {
|
||||||
snow_amount = clamp(
|
float timed_amount = clamp(
|
||||||
(TIME - global_snow_start_time) * global_snow_accumulation_speed,
|
(TIME - global_snow_start_time) * global_snow_accumulation_speed,
|
||||||
0.0,
|
0.0,
|
||||||
1.0
|
1.0
|
||||||
);
|
);
|
||||||
|
snow_amount = max(snow_amount, timed_amount);
|
||||||
}
|
}
|
||||||
if (global_snow_melt_time >= 0.0) {
|
if (global_snow_melt_time >= 0.0) {
|
||||||
float melt = clamp((TIME - global_snow_melt_time) * global_snow_melt_speed, 0.0, 1.0);
|
float melt = clamp((TIME - global_snow_melt_time) * global_snow_melt_speed, 0.0, 1.0);
|
||||||
snow_amount *= (1.0 - melt);
|
snow_amount = min(snow_amount, 1.0 - melt);
|
||||||
}
|
}
|
||||||
return snow_amount;
|
return snow_amount;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,12 +6,12 @@ global uniform vec2 global_wind_direction;
|
|||||||
global uniform float global_wind_scale;
|
global uniform float global_wind_scale;
|
||||||
global uniform float global_wind_strength;
|
global uniform float global_wind_strength;
|
||||||
global uniform float global_wind_fade;
|
global uniform float global_wind_fade;
|
||||||
/*
|
global uniform float global_snow_start_time = -1.0;
|
||||||
global uniform float global_snow_start_time;
|
global uniform float global_snow_accumulation_speed = 0.005;
|
||||||
global uniform float global_snow_accumulation_speed;
|
global uniform float global_snow_melt_time = -1.0;
|
||||||
global uniform float global_snow_melt_time;
|
global uniform float global_snow_melt_speed = 0.1;
|
||||||
global uniform float global_snow_melt_speed;
|
global uniform float global_snow_amount = 0.0;
|
||||||
global uniform vec4 global_snow_color;*/
|
global uniform vec4 global_snow_color;
|
||||||
global uniform float global_rain_intensity;
|
global uniform float global_rain_intensity;
|
||||||
|
|
||||||
uniform sampler2D wind_noise : filter_linear_mipmap;
|
uniform sampler2D wind_noise : filter_linear_mipmap;
|
||||||
@@ -31,6 +31,7 @@ uniform float light_steps : hint_range(1.0, 10.0) = 4.0;
|
|||||||
uniform float random_mix : hint_range(0.0, 1.0) = 0.3;
|
uniform float random_mix : hint_range(0.0, 1.0) = 0.3;
|
||||||
uniform float cast_shadow_strength : hint_range(0.0, 1.0) = 0.6;
|
uniform float cast_shadow_strength : hint_range(0.0, 1.0) = 0.6;
|
||||||
uniform float wetness_darkening : hint_range(0.0, 0.5) = 0.25;
|
uniform float wetness_darkening : hint_range(0.0, 0.5) = 0.25;
|
||||||
|
uniform float snow_visibility : hint_range(0.0, 1.0) = 1.0;
|
||||||
|
|
||||||
varying vec3 v_final_color;
|
varying vec3 v_final_color;
|
||||||
varying float v_shade_factor;
|
varying float v_shade_factor;
|
||||||
@@ -41,6 +42,21 @@ float hash(vec3 p) {
|
|||||||
return fract((p.x + p.y) * p.z);
|
return fract((p.x + p.y) * p.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float get_snow_progress() {
|
||||||
|
float snow_progress = clamp(global_snow_amount, 0.0, 1.0);
|
||||||
|
|
||||||
|
if (global_snow_start_time >= 0.0) {
|
||||||
|
float timed_progress = clamp((TIME - global_snow_start_time) * global_snow_accumulation_speed, 0.0, 1.0);
|
||||||
|
snow_progress = max(snow_progress, timed_progress);
|
||||||
|
}
|
||||||
|
if (global_snow_melt_time >= 0.0) {
|
||||||
|
float melt = clamp((TIME - global_snow_melt_time) * global_snow_melt_speed, 0.0, 1.0);
|
||||||
|
snow_progress = min(snow_progress, 1.0 - melt);
|
||||||
|
}
|
||||||
|
|
||||||
|
return snow_progress;
|
||||||
|
}
|
||||||
|
|
||||||
void vertex() {
|
void vertex() {
|
||||||
vec3 instance_pos = MODEL_MATRIX[3].xyz;
|
vec3 instance_pos = MODEL_MATRIX[3].xyz;
|
||||||
|
|
||||||
@@ -88,24 +104,16 @@ void fragment() {
|
|||||||
vec2 shifted_uv = UV + texture_offset;
|
vec2 shifted_uv = UV + texture_offset;
|
||||||
vec4 tex = texture(alpha_texture, shifted_uv);
|
vec4 tex = texture(alpha_texture, shifted_uv);
|
||||||
|
|
||||||
//// Snow accumulation
|
// Snow accumulation
|
||||||
//float snow_amount = 0.0;
|
float snow_amount = pow(get_snow_progress(), 0.55);
|
||||||
//if (global_snow_start_time >= 0.0) {
|
|
||||||
//snow_amount = clamp((TIME - global_snow_start_time) * global_snow_accumulation_speed, 0.0, 1.0);
|
|
||||||
//}
|
|
||||||
//if (global_snow_melt_time >= 0.0) {
|
|
||||||
//float melt = clamp((TIME - global_snow_melt_time) * global_snow_melt_speed, 0.0, 1.0);
|
|
||||||
//snow_amount *= (1.0 - melt);
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//float top_mask = 1.0 - shifted_uv.y;
|
|
||||||
//float snow_mask = smoothstep(1.0 - snow_amount, 1.2 - snow_amount, top_mask);
|
|
||||||
//snow_mask *= step(0.01, snow_amount);
|
|
||||||
|
|
||||||
//vec3 dark_snow = global_snow_color.rgb * (1.0 - shadow_intensity);
|
float top_mask = 1.0 - shifted_uv.y;
|
||||||
//vec3 shaded_snow = mix(dark_snow, global_snow_color.rgb, v_shade_factor);
|
float snow_mask = smoothstep(1.0 - snow_amount * 1.35, 1.08 - snow_amount * 1.35, top_mask) * snow_visibility;
|
||||||
//vec3 final_albedo = mix(v_final_color, shaded_snow, snow_mask);
|
snow_mask *= step(0.01, snow_amount);
|
||||||
vec3 final_albedo = v_final_color;
|
|
||||||
|
vec3 dark_snow = global_snow_color.rgb * (1.0 - shadow_intensity);
|
||||||
|
vec3 shaded_snow = mix(dark_snow, global_snow_color.rgb, v_shade_factor);
|
||||||
|
vec3 final_albedo = mix(v_final_color, shaded_snow, snow_mask);
|
||||||
|
|
||||||
// Rain wetness: darken and make shinier
|
// Rain wetness: darken and make shinier
|
||||||
float rain_int = clamp(global_rain_intensity, 0.0, 1.0);
|
float rain_int = clamp(global_rain_intensity, 0.0, 1.0);
|
||||||
|
|||||||
@@ -3,6 +3,12 @@ render_mode blend_mix, depth_draw_always;
|
|||||||
|
|
||||||
global uniform float global_rain_intensity;
|
global uniform float global_rain_intensity;
|
||||||
global uniform vec4 global_water_color = vec4(0.285, 0.534, 0.487, 1.0);
|
global uniform vec4 global_water_color = vec4(0.285, 0.534, 0.487, 1.0);
|
||||||
|
global uniform float global_snow_start_time = -1.0;
|
||||||
|
global uniform float global_snow_accumulation_speed = 0.005;
|
||||||
|
global uniform float global_snow_melt_time = -1.0;
|
||||||
|
global uniform float global_snow_melt_speed = 0.1;
|
||||||
|
global uniform float global_snow_amount = 0.0;
|
||||||
|
global uniform vec4 global_snow_color = vec4(0.92, 0.96, 1.0, 1.0);
|
||||||
|
|
||||||
//Water color
|
//Water color
|
||||||
uniform vec4 deep_water_color : source_color = vec4(0.0, 0.1, 0.2, 1.0);
|
uniform vec4 deep_water_color : source_color = vec4(0.0, 0.1, 0.2, 1.0);
|
||||||
@@ -29,6 +35,21 @@ uniform sampler2D depth_texture : hint_depth_texture, filter_linear_mipmap;
|
|||||||
varying vec2 world_pos_xz;
|
varying vec2 world_pos_xz;
|
||||||
varying vec2 local_uv;
|
varying vec2 local_uv;
|
||||||
|
|
||||||
|
float get_snow_progress() {
|
||||||
|
float snow_progress = clamp(global_snow_amount, 0.0, 1.0);
|
||||||
|
|
||||||
|
if (global_snow_start_time >= 0.0) {
|
||||||
|
float timed_progress = clamp((TIME - global_snow_start_time) * global_snow_accumulation_speed, 0.0, 1.0);
|
||||||
|
snow_progress = max(snow_progress, timed_progress);
|
||||||
|
}
|
||||||
|
if (global_snow_melt_time >= 0.0) {
|
||||||
|
float melt = clamp((TIME - global_snow_melt_time) * global_snow_melt_speed, 0.0, 1.0);
|
||||||
|
snow_progress = min(snow_progress, 1.0 - melt);
|
||||||
|
}
|
||||||
|
|
||||||
|
return snow_progress;
|
||||||
|
}
|
||||||
|
|
||||||
void vertex() {
|
void vertex() {
|
||||||
world_pos_xz = (MODEL_MATRIX * vec4(VERTEX, 1.0)).xz;
|
world_pos_xz = (MODEL_MATRIX * vec4(VERTEX, 1.0)).xz;
|
||||||
local_uv = UV;
|
local_uv = UV;
|
||||||
@@ -82,8 +103,15 @@ void fragment() {
|
|||||||
float is_sky = step(ref_depth_raw, 0.00001); // Protezione anti-cielo
|
float is_sky = step(ref_depth_raw, 0.00001); // Protezione anti-cielo
|
||||||
reflection_mask *= (1.0 - is_sky);
|
reflection_mask *= (1.0 - is_sky);
|
||||||
|
|
||||||
vec3 final_rgb = mix(base_water.rgb, screen_ref, reflection_strength * reflection_mask);
|
float snow_progress = get_snow_progress();
|
||||||
|
float active_snowfall = step(0.0, global_snow_start_time) * (1.0 - step(0.0, global_snow_melt_time));
|
||||||
|
float reflection_snow_damping = max(smoothstep(0.0, 0.08, snow_progress), active_snowfall * 0.75);
|
||||||
|
float effective_reflection_strength = reflection_strength * (1.0 - reflection_snow_damping * 0.85);
|
||||||
|
|
||||||
|
vec3 final_rgb = mix(base_water.rgb, screen_ref, effective_reflection_strength * reflection_mask);
|
||||||
final_rgb = mix(final_rgb, ripple_color.rgb, ring * ripple_color.a);
|
final_rgb = mix(final_rgb, ripple_color.rgb, ring * ripple_color.a);
|
||||||
|
float water_snow_amount = smoothstep(0.15, 1.0, snow_progress) * 0.18;
|
||||||
|
final_rgb = mix(final_rgb, global_snow_color.rgb, water_snow_amount);
|
||||||
|
|
||||||
ALBEDO = final_rgb;
|
ALBEDO = final_rgb;
|
||||||
|
|
||||||
|
|||||||
@@ -6,9 +6,9 @@
|
|||||||
|
|
||||||
shader_type spatial;
|
shader_type spatial;
|
||||||
#if USE_UNSHADED
|
#if USE_UNSHADED
|
||||||
render_mode unshaded, depth_draw_never;
|
render_mode unshaded, depth_draw_never;
|
||||||
#else
|
#else
|
||||||
render_mode depth_draw_never;
|
render_mode depth_draw_never;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uniform sampler2D DEPTH_TEXTURE: hint_depth_texture;
|
uniform sampler2D DEPTH_TEXTURE: hint_depth_texture;
|
||||||
@@ -24,16 +24,16 @@ uniform float surface_roughness : hint_range(0.0, 1.0, 0.01) = 0.05;
|
|||||||
uniform float foam_roughness : hint_range(0.0, 1.0, 0.01) = 0.05;
|
uniform float foam_roughness : hint_range(0.0, 1.0, 0.01) = 0.05;
|
||||||
|
|
||||||
#if USE_CAUSTICS
|
#if USE_CAUSTICS
|
||||||
group_uniforms Caustics;
|
group_uniforms Caustics;
|
||||||
uniform sampler2D caustics_texture;
|
uniform sampler2D caustics_texture;
|
||||||
uniform float caustics_strength = 2.0;
|
uniform float caustics_strength = 2.0;
|
||||||
uniform vec2 caustics_scale = vec2(0.5);
|
uniform vec2 caustics_scale = vec2(0.5);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
group_uniforms Wave;
|
group_uniforms Wave;
|
||||||
uniform sampler2D wave_texture;
|
uniform sampler2D wave_texture;
|
||||||
#if !USE_UNSHADED
|
#if !USE_UNSHADED
|
||||||
uniform sampler2D wave_normal_texture;
|
uniform sampler2D wave_normal_texture;
|
||||||
#endif
|
#endif
|
||||||
uniform float wave_softness : hint_range(0.0, 10.0, 0.1) = 3.0;
|
uniform float wave_softness : hint_range(0.0, 10.0, 0.1) = 3.0;
|
||||||
uniform vec2 wave_scale = vec2(0.2);
|
uniform vec2 wave_scale = vec2(0.2);
|
||||||
@@ -52,36 +52,36 @@ uniform float foam_end : hint_range(0.0, 1.0, 0.05) = 0.3;
|
|||||||
uniform float foam_exponent = 2.0;
|
uniform float foam_exponent = 2.0;
|
||||||
|
|
||||||
#if USE_REFRACTION
|
#if USE_REFRACTION
|
||||||
group_uniforms Refraction;
|
group_uniforms Refraction;
|
||||||
uniform float refraction_amount = 0.5;
|
uniform float refraction_amount = 0.5;
|
||||||
uniform float refraction_exponent = 0.5;
|
uniform float refraction_exponent = 0.5;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if USE_DISPLACEMENT
|
#if USE_DISPLACEMENT
|
||||||
group_uniforms Displacement;
|
group_uniforms Displacement;
|
||||||
uniform float displacement_amount = 0.3;
|
uniform float displacement_amount = 0.3;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if USE_STYLIZED_LIGHTING && !USE_UNSHADED
|
#if USE_STYLIZED_LIGHTING && !USE_UNSHADED
|
||||||
group_uniforms Lighting;
|
group_uniforms Lighting;
|
||||||
uniform float diffuse_steps = 12.0;
|
uniform float diffuse_steps = 12.0;
|
||||||
uniform float diffuse_smoothness : hint_range(0.0, 1.0, 0.01) = 0.2;
|
uniform float diffuse_smoothness : hint_range(0.0, 1.0, 0.01) = 0.2;
|
||||||
uniform float specular_steps = 12.0;
|
uniform float specular_steps = 12.0;
|
||||||
uniform float specular_smoothness : hint_range(0.0, 1.0, 0.01) = 0.2;
|
uniform float specular_smoothness : hint_range(0.0, 1.0, 0.01) = 0.2;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uniform sampler2D screen_texture : hint_screen_texture;
|
uniform sampler2D screen_texture : hint_screen_texture;
|
||||||
varying vec3 world_pos;
|
varying vec3 world_pos;
|
||||||
|
|
||||||
#if USE_CAUSTICS
|
#if USE_CAUSTICS
|
||||||
vec3 sample_caustics(vec2 uv){
|
vec3 sample_caustics(vec2 uv){
|
||||||
vec2 caustics_uv = uv * caustics_scale;
|
vec2 caustics_uv = uv * caustics_scale;
|
||||||
return vec3(
|
return vec3(
|
||||||
texture(caustics_texture, caustics_uv).r,
|
texture(caustics_texture, caustics_uv).r,
|
||||||
texture(caustics_texture, caustics_uv+vec2(0.02,0.02)).r,
|
texture(caustics_texture, caustics_uv+vec2(0.02,0.02)).r,
|
||||||
texture(caustics_texture, caustics_uv+vec2(0.03,0.01)).r
|
texture(caustics_texture, caustics_uv+vec2(0.03,0.01)).r
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
vec4 sample_world_dpos(vec2 screen_uv, mat4 inv_proj_mat, mat4 inv_view_mat){
|
vec4 sample_world_dpos(vec2 screen_uv, mat4 inv_proj_mat, mat4 inv_view_mat){
|
||||||
@@ -107,8 +107,8 @@ void vertex(){
|
|||||||
world_pos = (MODEL_MATRIX * vec4(VERTEX, 1.0)).xyz;
|
world_pos = (MODEL_MATRIX * vec4(VERTEX, 1.0)).xyz;
|
||||||
|
|
||||||
#if USE_DISPLACEMENT
|
#if USE_DISPLACEMENT
|
||||||
float wave = sample_wave(wave_texture, world_pos.xz, wave_velocity, wave_softness).r;
|
float wave = sample_wave(wave_texture, world_pos.xz, wave_velocity, wave_softness).r;
|
||||||
VERTEX.y += wave*displacement_amount;
|
VERTEX.y += wave*displacement_amount;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,17 +120,17 @@ void fragment() {
|
|||||||
|
|
||||||
// Refraction
|
// Refraction
|
||||||
#if USE_REFRACTION
|
#if USE_REFRACTION
|
||||||
screen_uv += ((pow(wave, refraction_exponent)*2.0 - 0.5) * 0.01 * refraction_amount);
|
screen_uv += ((pow(wave, refraction_exponent)*2.0 - 0.5) * 0.01 * refraction_amount);
|
||||||
|
|
||||||
vec4 world_dpos = sample_world_dpos(screen_uv, INV_PROJECTION_MATRIX, INV_VIEW_MATRIX);
|
vec4 world_dpos = sample_world_dpos(screen_uv, INV_PROJECTION_MATRIX, INV_VIEW_MATRIX);
|
||||||
|
|
||||||
float pre_depth = pow(clamp((world_dpos.y - world_pos.y + depth_size)/depth_size, 0.0, 1.0), 4.0);
|
float pre_depth = pow(clamp((world_dpos.y - world_pos.y + depth_size)/depth_size, 0.0, 1.0), 4.0);
|
||||||
screen_uv = mix(screen_uv, SCREEN_UV, pre_depth);
|
screen_uv = mix(screen_uv, SCREEN_UV, pre_depth);
|
||||||
if(world_dpos.y - world_pos.y > 0.0){
|
if(world_dpos.y - world_pos.y > 0.0){
|
||||||
screen_uv = SCREEN_UV;
|
screen_uv = SCREEN_UV;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
vec4 world_dpos = sample_world_dpos(screen_uv, INV_PROJECTION_MATRIX, INV_VIEW_MATRIX);
|
vec4 world_dpos = sample_world_dpos(screen_uv, INV_PROJECTION_MATRIX, INV_VIEW_MATRIX);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
world_dpos = sample_world_dpos(screen_uv, INV_PROJECTION_MATRIX, INV_VIEW_MATRIX);
|
world_dpos = sample_world_dpos(screen_uv, INV_PROJECTION_MATRIX, INV_VIEW_MATRIX);
|
||||||
@@ -141,9 +141,9 @@ void fragment() {
|
|||||||
|
|
||||||
// Caustics
|
// Caustics
|
||||||
#if USE_CAUSTICS
|
#if USE_CAUSTICS
|
||||||
vec3 caustics1 = sample_caustics(surface_uv + (TIME * -wave_velocity));
|
vec3 caustics1 = sample_caustics(surface_uv + (TIME * -wave_velocity));
|
||||||
vec3 caustics2 = sample_caustics((surface_uv + (caustics1.r*0.05)) + (TIME * (wave_velocity*0.5)));
|
vec3 caustics2 = sample_caustics((surface_uv + (caustics1.r*0.05)) + (TIME * (wave_velocity*0.5)));
|
||||||
vec3 caustics = caustics2 * (1.0 - depth);
|
vec3 caustics = caustics2 * (1.0 - depth);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Edge Foam
|
// Edge Foam
|
||||||
@@ -163,15 +163,15 @@ void fragment() {
|
|||||||
vec4 screen = texture(screen_texture, screen_uv);
|
vec4 screen = texture(screen_texture, screen_uv);
|
||||||
vec3 color = screen.rgb;
|
vec3 color = screen.rgb;
|
||||||
#if USE_CAUSTICS
|
#if USE_CAUSTICS
|
||||||
color += vec3(pow(caustics * caustics_strength, vec3(2.0)));
|
color += vec3(pow(caustics * caustics_strength, vec3(2.0)));
|
||||||
#endif
|
#endif
|
||||||
color = mix(flat_color, color, 0.4 * depth);
|
color = mix(flat_color, color, 0.4 * depth);
|
||||||
color = mix(color, surface_color.rgb, wave * wave_highlight);
|
color = mix(color, surface_color.rgb, wave * wave_highlight);
|
||||||
color = mix(color, foam_color.rgb, foam);
|
color = mix(color, foam_color.rgb, foam);
|
||||||
|
|
||||||
#if !USE_UNSHADED
|
#if !USE_UNSHADED
|
||||||
vec3 wave_normal_map = sample_wave(wave_normal_texture, world_pos.xz, wave_velocity, wave_softness).rgb;
|
vec3 wave_normal_map = sample_wave(wave_normal_texture, world_pos.xz, wave_velocity, wave_softness).rgb;
|
||||||
NORMAL_MAP = wave_normal_map;
|
NORMAL_MAP = wave_normal_map;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ROUGHNESS = mix(surface_roughness, foam_roughness, foam);
|
ROUGHNESS = mix(surface_roughness, foam_roughness, foam);
|
||||||
@@ -180,33 +180,33 @@ void fragment() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if USE_STYLIZED_LIGHTING && !USE_UNSHADED
|
#if USE_STYLIZED_LIGHTING && !USE_UNSHADED
|
||||||
void light(){
|
void light(){
|
||||||
float ndotl = dot(NORMAL, LIGHT) * ATTENUATION;
|
float ndotl = dot(NORMAL, LIGHT) * ATTENUATION;
|
||||||
//ndotl = smoothstep(0.0,1.0-ROUGHNESS,ndotl);
|
//ndotl = smoothstep(0.0,1.0-ROUGHNESS,ndotl);
|
||||||
float light = ndotl;
|
float light = ndotl;
|
||||||
|
|
||||||
float light_mult = light * diffuse_steps;
|
float light_mult = light * diffuse_steps;
|
||||||
float light_step_base = floor(light_mult);
|
float light_step_base = floor(light_mult);
|
||||||
float light_factor = light_mult - light_step_base;
|
float light_factor = light_mult - light_step_base;
|
||||||
|
|
||||||
light_factor = smoothstep(0.5 - diffuse_smoothness * 0.5, 0.5 + diffuse_smoothness * 0.5, light_factor);
|
light_factor = smoothstep(0.5 - diffuse_smoothness * 0.5, 0.5 + diffuse_smoothness * 0.5, light_factor);
|
||||||
light = (light_step_base + light_factor) / diffuse_steps;
|
light = (light_step_base + light_factor) / diffuse_steps;
|
||||||
|
|
||||||
DIFFUSE_LIGHT += (LIGHT_COLOR+ALBEDO) * light / PI;
|
DIFFUSE_LIGHT += (LIGHT_COLOR+ALBEDO) * light / PI;
|
||||||
|
|
||||||
float roughness = mix(0.01, 0.99, ROUGHNESS);
|
float roughness = mix(0.01, 0.99, ROUGHNESS);
|
||||||
vec3 h = normalize(VIEW + LIGHT);
|
vec3 h = normalize(VIEW + LIGHT);
|
||||||
float ndoth = clamp(dot(NORMAL, h), 0.0, 1.0) * ATTENUATION;
|
float ndoth = clamp(dot(NORMAL, h), 0.0, 1.0) * ATTENUATION;
|
||||||
float specular = clamp(pow(ndoth, 16.0/(roughness)), 0.1, 0.99);
|
float specular = clamp(pow(ndoth, 16.0/(roughness)), 0.1, 0.99);
|
||||||
specular = mix(pow(specular, 2.0-roughness),0.00,pow(roughness, 0.1));
|
specular = mix(pow(specular, 2.0-roughness),0.00,pow(roughness, 0.1));
|
||||||
|
|
||||||
float specular_mult = specular * specular_steps;
|
float specular_mult = specular * specular_steps;
|
||||||
float specular_step_base = floor(specular_mult);
|
float specular_step_base = floor(specular_mult);
|
||||||
float specular_factor = specular_mult - specular_step_base;
|
float specular_factor = specular_mult - specular_step_base;
|
||||||
|
|
||||||
specular_factor = smoothstep(0.5 - specular_smoothness * 0.5, 0.5 + specular_smoothness * 0.5, specular_factor);
|
specular_factor = smoothstep(0.5 - specular_smoothness * 0.5, 0.5 + specular_smoothness * 0.5, specular_factor);
|
||||||
specular = (specular_step_base + specular_factor) / specular_steps;
|
specular = (specular_step_base + specular_factor) / specular_steps;
|
||||||
|
|
||||||
SPECULAR_LIGHT += (LIGHT_COLOR + ALBEDO) * specular;
|
SPECULAR_LIGHT += (LIGHT_COLOR + ALBEDO) * specular;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -34,12 +34,15 @@ var rain_tween: Tween
|
|||||||
var rain_audio_tween: Tween
|
var rain_audio_tween: Tween
|
||||||
var puddle_tween: Tween
|
var puddle_tween: Tween
|
||||||
var puddle_amount: float = 0.0
|
var puddle_amount: float = 0.0
|
||||||
|
var clouds_tween: Tween
|
||||||
|
|
||||||
var snow_tween: Tween
|
var snow_tween: Tween
|
||||||
|
var snow_weather_tween: Tween
|
||||||
var snow_particles_tween: Tween
|
var snow_particles_tween: Tween
|
||||||
var is_snowing: bool = false
|
var is_snowing: bool = false
|
||||||
var is_snow_accumulated: bool = false
|
var is_snow_accumulated: bool = false
|
||||||
var actual_snow_amount: float = 0.0
|
var actual_snow_amount: float = 0.0
|
||||||
|
var snow_weather_amount: float = 0.0
|
||||||
|
|
||||||
var is_storm: bool = false
|
var is_storm: bool = false
|
||||||
var cold_tween: Tween
|
var cold_tween: Tween
|
||||||
@@ -188,10 +191,10 @@ func _process(delta: float) -> void:
|
|||||||
var final_fog_density = lerp(base_fog_density, base_fog_density * 4.0, 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 final_water_color = base_water_color.darkened(clamp(environment_config.water_darkening_rain, 0.0, 1.0) * clamp(rain_intensity, 0.0, 1.0))
|
||||||
|
|
||||||
final_tint = final_tint.lerp(final_tint * environment_config.snow_mode_color, actual_snow_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, actual_snow_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, actual_snow_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, actual_snow_amount)
|
final_fog_color = final_fog_color.lerp(final_fog_color * environment_config.snow_mode_color, snow_weather_amount)
|
||||||
|
|
||||||
#Shader parameters for global trunk_shader
|
#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))
|
var final_grad_top = base_grad_top.lerp(base_grad_top * weather_color, clamp(rain_intensity, 0.0, 1.0))
|
||||||
@@ -205,8 +208,8 @@ func _process(delta: float) -> void:
|
|||||||
var night_val = clamp(day_time - 2.0, 0.0, 1.0)
|
var night_val = clamp(day_time - 2.0, 0.0, 1.0)
|
||||||
|
|
||||||
#Snow exposure compensation
|
#Snow exposure compensation
|
||||||
var snow_light_attenuation = lerp(1.0, 0.55, actual_snow_amount * (1.0 - night_val))
|
var snow_light_attenuation = lerp(1.0, 0.55, snow_weather_amount * (1.0 - night_val))
|
||||||
var snow_glow_attenuation = lerp(1.0, 0.5, actual_snow_amount)
|
var snow_glow_attenuation = lerp(1.0, 0.5, snow_weather_amount)
|
||||||
var final_bloom = lerp(base_bloom, base_bloom * 0.5, rain_intensity) * snow_glow_attenuation
|
var final_bloom = lerp(base_bloom, base_bloom * 0.5, rain_intensity) * snow_glow_attenuation
|
||||||
|
|
||||||
# We calculate the final exposure by applying snow damping directly to the camera exposure
|
# We calculate the final exposure by applying snow damping directly to the camera exposure
|
||||||
@@ -247,12 +250,18 @@ func _process(delta: float) -> void:
|
|||||||
sky_mat.set_shader_parameter("sun_color", final_tint)
|
sky_mat.set_shader_parameter("sun_color", final_tint)
|
||||||
sky_mat.set_shader_parameter("night_intensity", night_val)
|
sky_mat.set_shader_parameter("night_intensity", night_val)
|
||||||
|
|
||||||
|
var cloud_density_amount: float = maxf(clamp(rain_intensity, 0.0, 1.0), clamp(snow_weather_amount, 0.0, 1.0))
|
||||||
|
var current_cloud_density: float = lerp(environment_config.base_cloud_density, environment_config.rain_cloud_density, cloud_density_amount)
|
||||||
|
|
||||||
if environment_config.material_clouds:
|
if environment_config.material_clouds:
|
||||||
var current_density = lerp(0.4, 1.0, rain_intensity)
|
environment_config.material_clouds.set_shader_parameter("cloud_density", current_cloud_density)
|
||||||
environment_config.material_clouds.set_shader_parameter("cloud_density", current_density)
|
var current_sharpness = lerp(0.14, 0.0, cloud_density_amount)
|
||||||
var current_sharpness = lerp(0.14, 0.0, rain_intensity)
|
|
||||||
environment_config.material_clouds.set_shader_parameter("center_sharpness", current_sharpness)
|
environment_config.material_clouds.set_shader_parameter("center_sharpness", current_sharpness)
|
||||||
|
|
||||||
|
var env_shadow_mat = environment_shadows.get_surface_override_material(0) if environment_shadows else null
|
||||||
|
if env_shadow_mat:
|
||||||
|
env_shadow_mat.set_shader_parameter("cloud_density", current_cloud_density)
|
||||||
|
|
||||||
if environment_config.material_fog:
|
if environment_config.material_fog:
|
||||||
environment_config.material_fog.set_shader_parameter("night_intensity", night_val)
|
environment_config.material_fog.set_shader_parameter("night_intensity", night_val)
|
||||||
environment_config.material_fog.set_shader_parameter("sun_color", final_tint)
|
environment_config.material_fog.set_shader_parameter("sun_color", final_tint)
|
||||||
@@ -786,8 +795,23 @@ func toggle_snow(value: bool):
|
|||||||
var target_snow_amount: float = 1.0 if is_snowing else 0.0
|
var target_snow_amount: float = 1.0 if is_snowing else 0.0
|
||||||
if snow_tween and snow_tween.is_valid():
|
if snow_tween and snow_tween.is_valid():
|
||||||
snow_tween.kill()
|
snow_tween.kill()
|
||||||
|
if snow_weather_tween and snow_weather_tween.is_valid():
|
||||||
|
snow_weather_tween.kill()
|
||||||
|
var snow_amount_transition_duration: float = _get_snow_amount_transition_duration(is_snowing)
|
||||||
snow_tween = create_tween()
|
snow_tween = create_tween()
|
||||||
snow_tween.tween_method(init_snow_amount, actual_snow_amount, target_snow_amount, environment_config.snow_transaction_time)
|
snow_tween.tween_method(
|
||||||
|
init_snow_amount,
|
||||||
|
actual_snow_amount,
|
||||||
|
target_snow_amount,
|
||||||
|
snow_amount_transition_duration
|
||||||
|
)
|
||||||
|
snow_weather_tween = create_tween()
|
||||||
|
snow_weather_tween.tween_method(
|
||||||
|
init_snow_weather_amount,
|
||||||
|
snow_weather_amount,
|
||||||
|
target_snow_amount,
|
||||||
|
environment_config.snow_fade_time
|
||||||
|
)
|
||||||
_emit_weather_event_label()
|
_emit_weather_event_label()
|
||||||
|
|
||||||
func _emit_weather_event_label() -> void:
|
func _emit_weather_event_label() -> void:
|
||||||
@@ -811,6 +835,7 @@ func _emit_weather_event_label() -> void:
|
|||||||
#disable snow and set default values and shader
|
#disable snow and set default values and shader
|
||||||
func init_snow(value: float = 0.0):
|
func init_snow(value: float = 0.0):
|
||||||
actual_snow_amount = value
|
actual_snow_amount = value
|
||||||
|
snow_weather_amount = value
|
||||||
RenderingServer.global_shader_parameter_set("global_snow_amount", value)
|
RenderingServer.global_shader_parameter_set("global_snow_amount", value)
|
||||||
|
|
||||||
if particles_snow:
|
if particles_snow:
|
||||||
@@ -835,6 +860,9 @@ func init_snow_amount(value: float):
|
|||||||
actual_snow_amount = value
|
actual_snow_amount = value
|
||||||
RenderingServer.global_shader_parameter_set("global_snow_amount", value)
|
RenderingServer.global_shader_parameter_set("global_snow_amount", value)
|
||||||
|
|
||||||
|
func init_snow_weather_amount(value: float):
|
||||||
|
snow_weather_amount = value
|
||||||
|
|
||||||
func start_snow_accumulation() -> void:
|
func start_snow_accumulation() -> void:
|
||||||
RenderingServer.global_shader_parameter_set("global_snow_melt_time", -1.0)
|
RenderingServer.global_shader_parameter_set("global_snow_melt_time", -1.0)
|
||||||
RenderingServer.global_shader_parameter_set("global_snow_start_time", Time.get_ticks_msec() / 1000.0)
|
RenderingServer.global_shader_parameter_set("global_snow_start_time", Time.get_ticks_msec() / 1000.0)
|
||||||
@@ -843,6 +871,18 @@ func start_snow_melt() -> void:
|
|||||||
RenderingServer.global_shader_parameter_set("global_snow_melt_time", Time.get_ticks_msec() / 1000.0)
|
RenderingServer.global_shader_parameter_set("global_snow_melt_time", Time.get_ticks_msec() / 1000.0)
|
||||||
RenderingServer.global_shader_parameter_set("global_snow_melt_speed", environment_config.snow_melt_speed)
|
RenderingServer.global_shader_parameter_set("global_snow_melt_speed", environment_config.snow_melt_speed)
|
||||||
|
|
||||||
|
func _get_snow_amount_transition_duration(is_accumulating: bool) -> float:
|
||||||
|
if environment_config == null:
|
||||||
|
return 0.0
|
||||||
|
|
||||||
|
var speed: float = environment_config.snow_melt_speed
|
||||||
|
if is_accumulating:
|
||||||
|
speed = environment_config.snow_accumulation_speed
|
||||||
|
if speed <= 0.0:
|
||||||
|
return environment_config.snow_transaction_time
|
||||||
|
|
||||||
|
return 1.0 / speed
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Post-Process
|
#region Post-Process
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ render_mode blend_mix, depth_draw_never;
|
|||||||
|
|
||||||
//Snow globals
|
//Snow globals
|
||||||
global uniform float global_snow_start_time = -1.0;
|
global uniform float global_snow_start_time = -1.0;
|
||||||
global uniform float global_snow_accumulation_speed = 0.1;
|
global uniform float global_snow_accumulation_speed = 0.005;
|
||||||
global uniform float global_snow_melt_time = -1.0;
|
global uniform float global_snow_melt_time = -1.0;
|
||||||
global uniform float global_snow_melt_speed = 0.1;
|
global uniform float global_snow_melt_speed = 0.1;
|
||||||
global uniform float global_snow_amount = 0.0;
|
global uniform float global_snow_amount = 0.0;
|
||||||
@@ -72,18 +72,15 @@ float fbm(vec2 p) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
float get_snow_progress() {
|
float get_snow_progress() {
|
||||||
bool has_snow_timeline = global_snow_start_time >= 0.0 || global_snow_melt_time >= 0.0;
|
|
||||||
float snow_progress = clamp(global_snow_amount, 0.0, 1.0);
|
float snow_progress = clamp(global_snow_amount, 0.0, 1.0);
|
||||||
|
|
||||||
if (has_snow_timeline) {
|
if (global_snow_start_time >= 0.0) {
|
||||||
snow_progress = 0.0;
|
float timed_progress = clamp((TIME - global_snow_start_time) * global_snow_accumulation_speed, 0.0, 1.0);
|
||||||
if (global_snow_start_time >= 0.0) {
|
snow_progress = max(snow_progress, timed_progress);
|
||||||
snow_progress = clamp((TIME - global_snow_start_time) * global_snow_accumulation_speed, 0.0, 1.0);
|
}
|
||||||
}
|
if (global_snow_melt_time >= 0.0) {
|
||||||
if (global_snow_melt_time >= 0.0) {
|
float melt = clamp((TIME - global_snow_melt_time) * global_snow_melt_speed, 0.0, 1.0);
|
||||||
float melt = clamp((TIME - global_snow_melt_time) * global_snow_melt_speed, 0.0, 1.0);
|
snow_progress = min(snow_progress, 1.0 - melt);
|
||||||
snow_progress *= (1.0 - melt);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return snow_progress;
|
return snow_progress;
|
||||||
@@ -130,12 +127,13 @@ void fragment() {
|
|||||||
float snow_edge = smoothstep(
|
float snow_edge = smoothstep(
|
||||||
global_snow_threshold - snow_edge_softness,
|
global_snow_threshold - snow_edge_softness,
|
||||||
global_snow_threshold + snow_edge_softness,
|
global_snow_threshold + snow_edge_softness,
|
||||||
facing_up + (noise_val - 0.5) * 0.4
|
facing_up
|
||||||
);
|
);
|
||||||
float flat_accumulation = smoothstep(0.0, 0.35, v_snow_cap_mask) * snow_accumulation;
|
float flat_accumulation = smoothstep(0.0, 0.35, v_snow_cap_mask) * snow_accumulation;
|
||||||
float snow_coverage = smoothstep(0.0, 0.6, noise_val + snow_progress - 0.4 + flat_accumulation * 0.25);
|
float snow_variation = mix(0.75, 1.15, noise_val);
|
||||||
float snow_factor = max(snow_edge * snow_coverage * snow_progress, flat_accumulation);
|
float snow_coverage = clamp(snow_progress * snow_variation + flat_accumulation * 0.25, 0.0, 1.0);
|
||||||
float snow_opacity = smoothstep(0.04, 0.28, snow_factor);
|
float snow_factor = max(snow_edge * snow_coverage, flat_accumulation);
|
||||||
|
float snow_opacity = clamp(snow_factor, 0.0, 1.0);
|
||||||
snow_opacity = max(snow_opacity, flat_accumulation * 0.9);
|
snow_opacity = max(snow_opacity, flat_accumulation * 0.9);
|
||||||
|
|
||||||
float shade = mix(-snow_color_variation, snow_color_variation, noise_val);
|
float shade = mix(-snow_color_variation, snow_color_variation, noise_val);
|
||||||
|
|||||||
@@ -2,10 +2,11 @@ shader_type spatial;
|
|||||||
render_mode blend_mix, depth_draw_never, cull_disabled;
|
render_mode blend_mix, depth_draw_never, cull_disabled;
|
||||||
|
|
||||||
// Snow globals
|
// Snow globals
|
||||||
global uniform float global_snow_start_time;
|
global uniform float global_snow_start_time = -1.0;
|
||||||
global uniform float global_snow_accumulation_speed;
|
global uniform float global_snow_accumulation_speed = 0.005;
|
||||||
global uniform float global_snow_melt_time;
|
global uniform float global_snow_melt_time = -1.0;
|
||||||
global uniform float global_snow_melt_speed;
|
global uniform float global_snow_melt_speed = 0.1;
|
||||||
|
global uniform float global_snow_amount = 0.0;
|
||||||
global uniform vec4 global_snow_color;
|
global uniform vec4 global_snow_color;
|
||||||
uniform float snow_edge_softness : hint_range(0.01, 0.5) = 0.15;
|
uniform float snow_edge_softness : hint_range(0.01, 0.5) = 0.15;
|
||||||
uniform float snow_color_variation : hint_range(0.0, 0.15) = 0.05;
|
uniform float snow_color_variation : hint_range(0.0, 0.15) = 0.05;
|
||||||
@@ -34,6 +35,21 @@ float ripple_ring(vec2 uv, float time_offset) {
|
|||||||
return ring * fade;
|
return ring * fade;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float get_snow_progress() {
|
||||||
|
float snow_progress = clamp(global_snow_amount, 0.0, 1.0);
|
||||||
|
|
||||||
|
if (global_snow_start_time >= 0.0) {
|
||||||
|
float timed_progress = clamp((TIME - global_snow_start_time) * global_snow_accumulation_speed, 0.0, 1.0);
|
||||||
|
snow_progress = max(snow_progress, timed_progress);
|
||||||
|
}
|
||||||
|
if (global_snow_melt_time >= 0.0) {
|
||||||
|
float melt = clamp((TIME - global_snow_melt_time) * global_snow_melt_speed, 0.0, 1.0);
|
||||||
|
snow_progress = min(snow_progress, 1.0 - melt);
|
||||||
|
}
|
||||||
|
|
||||||
|
return snow_progress;
|
||||||
|
}
|
||||||
|
|
||||||
void fragment() {
|
void fragment() {
|
||||||
vec3 world_pos = (INV_VIEW_MATRIX * vec4(VERTEX, 1.0)).xyz;
|
vec3 world_pos = (INV_VIEW_MATRIX * vec4(VERTEX, 1.0)).xyz;
|
||||||
|
|
||||||
@@ -41,18 +57,10 @@ void fragment() {
|
|||||||
float facing_up = 1.0;
|
float facing_up = 1.0;
|
||||||
|
|
||||||
// Snow accumulation
|
// Snow accumulation
|
||||||
float snow_amount = 0.0;
|
float snow_amount = get_snow_progress();
|
||||||
if (global_snow_start_time >= 0.0) {
|
|
||||||
snow_amount = clamp((TIME - global_snow_start_time) * global_snow_accumulation_speed, 0.0, 1.0);
|
|
||||||
}
|
|
||||||
if (global_snow_melt_time >= 0.0) {
|
|
||||||
float melt = clamp((TIME - global_snow_melt_time) * global_snow_melt_speed, 0.0, 1.0);
|
|
||||||
snow_amount *= (1.0 - melt);
|
|
||||||
}
|
|
||||||
|
|
||||||
// UV-based snow mask: accumulates from the top of the quad
|
// Plain surfaces fade in uniformly to avoid patchy strip-like accumulation.
|
||||||
float top_mask = 1.0 - UV.y;
|
float snow_mask = smoothstep(0.0, 1.0, snow_amount);
|
||||||
float snow_mask = smoothstep(1.0 - snow_amount, 1.0 - snow_amount + snow_edge_softness, top_mask);
|
|
||||||
snow_mask *= step(0.01, snow_amount);
|
snow_mask *= step(0.01, snow_amount);
|
||||||
|
|
||||||
// Snow color with slight variation
|
// Snow color with slight variation
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ extends Resource
|
|||||||
@export var material_fog: ShaderMaterial #Fog overlay shader material
|
@export var material_fog: ShaderMaterial #Fog overlay shader material
|
||||||
@export var material_drops: StandardMaterial3D #Rain drops material (albedo tinted by sky)
|
@export var material_drops: StandardMaterial3D #Rain drops material (albedo tinted by sky)
|
||||||
@export var material_clouds: ShaderMaterial #Cloud layer shader material
|
@export var material_clouds: ShaderMaterial #Cloud layer shader material
|
||||||
|
@export var base_cloud_density: float = 0.4 #default cloud density
|
||||||
|
|
||||||
#Rain weather settings
|
#Rain weather settings
|
||||||
@export_group("Rain")
|
@export_group("Rain")
|
||||||
@@ -106,6 +107,7 @@ extends Resource
|
|||||||
@export var rain_audio_volume_db: float = -10.0 #Target rain loop volume in decibels
|
@export var rain_audio_volume_db: float = -10.0 #Target rain loop volume in decibels
|
||||||
@export var puddle_form_time: float = 15.0 #Seconds for puddles to fully form
|
@export var puddle_form_time: float = 15.0 #Seconds for puddles to fully form
|
||||||
@export var puddle_dry_time: float = 20.0 #Seconds for puddles to fully dry after rain stops
|
@export var puddle_dry_time: float = 20.0 #Seconds for puddles to fully dry after rain stops
|
||||||
|
@export var rain_cloud_density: float = 1.0 #the cloud density when is rainy
|
||||||
|
|
||||||
#Storm settings (applied on top of rain when storm is active)
|
#Storm settings (applied on top of rain when storm is active)
|
||||||
@export_group("Storm")
|
@export_group("Storm")
|
||||||
@@ -136,7 +138,7 @@ extends Resource
|
|||||||
|
|
||||||
#Train start settings
|
#Train start settings
|
||||||
@export_group("Train Start")
|
@export_group("Train Start")
|
||||||
@export var train_start_from_random_position: bool = false #When enabled the train starts from a random offset on the rail curve instead of a stop
|
@export var train_start_from_random_position: bool = true #When enabled the train starts from a random offset on the rail curve instead of a stop
|
||||||
@export_range(0, 64, 1, "or_greater") var train_start_stop_index: int = 1 #Stop index used for the train start when random start is disabled
|
@export_range(0, 64, 1, "or_greater") var train_start_stop_index: int = 1 #Stop index used for the train start when random start is disabled
|
||||||
|
|
||||||
#Snow settings
|
#Snow settings
|
||||||
@@ -145,7 +147,7 @@ extends Resource
|
|||||||
@export var snow_transaction_time: float = 10.0 #Seconds for snow shader to fully transition in/out
|
@export var snow_transaction_time: float = 10.0 #Seconds for snow shader to fully transition in/out
|
||||||
@export var snow_fade_time: float = 5.0 #Seconds for snow particles to fade in/out
|
@export var snow_fade_time: float = 5.0 #Seconds for snow particles to fade in/out
|
||||||
@export var snow_threshold: float = 0.4 #Normal Y threshold for snow accumulation on surfaces
|
@export var snow_threshold: float = 0.4 #Normal Y threshold for snow accumulation on surfaces
|
||||||
@export var snow_accumulation_speed: float = 0.014 #Accumulation speed: 0.1 -> 10s, 0.05 -> 20s, 0.02 -> 50s, 0.012 -> ~83s
|
@export var snow_accumulation_speed: float = 0.005 #Accumulation speed: 0.005 -> ~200s, 0.01 -> 100s, 0.02 -> 50s
|
||||||
@export var snow_melt_speed: float = 0.05 #Speed at which accumulated snow melts away
|
@export var snow_melt_speed: float = 0.05 #Speed at which accumulated snow melts away
|
||||||
@export var show_snow_accumulation_volume: bool = true #Enables vertex snow buildup; when false snow only changes surface color
|
@export var show_snow_accumulation_volume: bool = true #Enables vertex snow buildup; when false snow only changes surface color
|
||||||
@export var snow_max_accumulation: float = 0.25 #Maximum accumulated snow factor applied to coverage and thickness
|
@export var snow_max_accumulation: float = 0.25 #Maximum accumulated snow factor applied to coverage and thickness
|
||||||
|
|||||||
32
core/game_state/game_state.gd
Normal file
32
core/game_state/game_state.gd
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
extends Node
|
||||||
|
|
||||||
|
const SAVE_PATH: String = "user://savegame.json"
|
||||||
|
|
||||||
|
var save_data: SaveGameData = SaveGameData.new()
|
||||||
|
var is_loaded: bool = false
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
load_game()
|
||||||
|
|
||||||
|
func save_game() -> void:
|
||||||
|
var save_file = FileAccess.open(SAVE_PATH, FileAccess.WRITE)
|
||||||
|
var json_string = JSON.stringify(save_data.to_dictionary())
|
||||||
|
save_file.store_line(json_string)
|
||||||
|
|
||||||
|
func load_game() -> void:
|
||||||
|
if not FileAccess.file_exists(SAVE_PATH):
|
||||||
|
save_data = SaveGameData.new()
|
||||||
|
is_loaded = true
|
||||||
|
return
|
||||||
|
|
||||||
|
var file = FileAccess.open(SAVE_PATH, FileAccess.READ)
|
||||||
|
var json_string = file.get_as_text()
|
||||||
|
|
||||||
|
var json = JSON.new()
|
||||||
|
var parse_result = json.parse(json_string)
|
||||||
|
|
||||||
|
save_data = SaveGameData.new()
|
||||||
|
if parse_result == OK and json.data is Dictionary:
|
||||||
|
save_data = SaveGameData.from_dictionary(json.data)
|
||||||
|
|
||||||
|
is_loaded = true
|
||||||
1
core/game_state/game_state.gd.uid
Normal file
1
core/game_state/game_state.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://b17g2w2g101o6
|
||||||
34
core/game_state/save_game_data.gd
Normal file
34
core/game_state/save_game_data.gd
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
class_name SaveGameData
|
||||||
|
extends Resource
|
||||||
|
|
||||||
|
var unlocked_collectibles_ids: Array[StringName] = []
|
||||||
|
var saved_photos: Array[String] = []
|
||||||
|
var audio_bus_volumes: Dictionary[String, float] = {}
|
||||||
|
|
||||||
|
func to_dictionary() -> Dictionary:
|
||||||
|
var serialized_collectible_ids: Array[String] = []
|
||||||
|
for collectible_id in unlocked_collectibles_ids:
|
||||||
|
serialized_collectible_ids.append(str(collectible_id))
|
||||||
|
|
||||||
|
return {
|
||||||
|
"unlocked_collectibles_ids": serialized_collectible_ids,
|
||||||
|
"saved_photos": saved_photos,
|
||||||
|
"audio_bus_volumes": audio_bus_volumes,
|
||||||
|
}
|
||||||
|
|
||||||
|
static func from_dictionary(data: Dictionary) -> SaveGameData:
|
||||||
|
var save_game_data := SaveGameData.new()
|
||||||
|
|
||||||
|
if data.has("unlocked_collectibles_ids"):
|
||||||
|
for collectible_id in data["unlocked_collectibles_ids"]:
|
||||||
|
save_game_data.unlocked_collectibles_ids.append(StringName(str(collectible_id)))
|
||||||
|
|
||||||
|
if data.has("saved_photos"):
|
||||||
|
for photo_path in data["saved_photos"]:
|
||||||
|
save_game_data.saved_photos.append(str(photo_path))
|
||||||
|
|
||||||
|
if data.has("audio_bus_volumes") and data["audio_bus_volumes"] is Dictionary:
|
||||||
|
for bus_name in data["audio_bus_volumes"]:
|
||||||
|
save_game_data.audio_bus_volumes[str(bus_name)] = float(data["audio_bus_volumes"][bus_name])
|
||||||
|
|
||||||
|
return save_game_data
|
||||||
1
core/game_state/save_game_data.gd.uid
Normal file
1
core/game_state/save_game_data.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://bxmvs842r82vl
|
||||||
4
core/photo_mode/data/collectible_library.gd
Normal file
4
core/photo_mode/data/collectible_library.gd
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
class_name CollectibleLibrary
|
||||||
|
extends Resource
|
||||||
|
|
||||||
|
@export var collectibles: Array[CollectibleResource]
|
||||||
1
core/photo_mode/data/collectible_library.gd.uid
Normal file
1
core/photo_mode/data/collectible_library.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://hhuufh87skq5
|
||||||
31
core/photo_mode/data/collectible_library.tres
Normal file
31
core/photo_mode/data/collectible_library.tres
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
[gd_resource type="Resource" script_class="CollectibleLibrary" format=3 uid="uid://c6pkpvsvimafb"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://bj34o0org55ei" path="res://core/photo_mode/data/collectible_resource.gd" id="1_3cgvf"]
|
||||||
|
[ext_resource type="Script" uid="uid://hhuufh87skq5" path="res://core/photo_mode/data/collectible_library.gd" id="2_ggu10"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://cx8d233y32kmu" path="res://icon.svg" id="2_pxmdy"]
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_3cgvf"]
|
||||||
|
script = ExtResource("1_3cgvf")
|
||||||
|
id = &"cane"
|
||||||
|
title = "Cane"
|
||||||
|
image = ExtResource("2_pxmdy")
|
||||||
|
metadata/_custom_type_script = "uid://bj34o0org55ei"
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_ggu10"]
|
||||||
|
script = ExtResource("1_3cgvf")
|
||||||
|
id = &"gatto"
|
||||||
|
title = "Gatto"
|
||||||
|
image = ExtResource("2_pxmdy")
|
||||||
|
metadata/_custom_type_script = "uid://bj34o0org55ei"
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_pxmdy"]
|
||||||
|
script = ExtResource("1_3cgvf")
|
||||||
|
id = &"farfalla"
|
||||||
|
title = "Farfalla"
|
||||||
|
image = ExtResource("2_pxmdy")
|
||||||
|
metadata/_custom_type_script = "uid://bj34o0org55ei"
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("2_ggu10")
|
||||||
|
collectibles = Array[ExtResource("1_3cgvf")]([SubResource("Resource_3cgvf"), SubResource("Resource_ggu10"), SubResource("Resource_pxmdy")])
|
||||||
|
metadata/_custom_type_script = "uid://hhuufh87skq5"
|
||||||
6
core/photo_mode/data/collectible_resource.gd
Normal file
6
core/photo_mode/data/collectible_resource.gd
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
class_name CollectibleResource
|
||||||
|
extends Resource
|
||||||
|
|
||||||
|
@export var id: StringName
|
||||||
|
@export var title: String
|
||||||
|
@export var image: Texture2D
|
||||||
1
core/photo_mode/data/collectible_resource.gd.uid
Normal file
1
core/photo_mode/data/collectible_resource.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://bj34o0org55ei
|
||||||
60
core/photo_mode/managers/collection_manager.gd
Normal file
60
core/photo_mode/managers/collection_manager.gd
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
extends Node
|
||||||
|
|
||||||
|
signal on_collectible_unlocked(collectible_id: StringName)
|
||||||
|
signal on_photo_saved(filePath: String)
|
||||||
|
|
||||||
|
var collectibles_library: CollectibleLibrary = preload("res://core/photo_mode/data/collectible_library.tres")
|
||||||
|
|
||||||
|
var unlocked_collectibles_ids: Array[StringName] = []
|
||||||
|
var saved_photos: Array[String] = []
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
load_save_data()
|
||||||
|
|
||||||
|
func unlock_collectible(collectible_id: StringName) -> void:
|
||||||
|
if not collectible_id in unlocked_collectibles_ids:
|
||||||
|
var new_collectible = get_collectible_by_id(collectible_id)
|
||||||
|
if new_collectible:
|
||||||
|
unlocked_collectibles_ids.append(collectible_id)
|
||||||
|
sync_save_data()
|
||||||
|
on_collectible_unlocked.emit(collectible_id)
|
||||||
|
|
||||||
|
func get_collectible_by_id(id: StringName) -> CollectibleResource:
|
||||||
|
for collectible in collectibles_library.collectibles:
|
||||||
|
if collectible.id == id:
|
||||||
|
return collectible
|
||||||
|
return null
|
||||||
|
|
||||||
|
func get_all_collectibles() -> Array[CollectibleResource]:
|
||||||
|
return collectibles_library.collectibles
|
||||||
|
|
||||||
|
func get_unlocked_collectible_ids() -> Array[StringName]:
|
||||||
|
return unlocked_collectibles_ids
|
||||||
|
|
||||||
|
func save_photo_to_disk_async() -> void:
|
||||||
|
await RenderingServer.frame_post_draw
|
||||||
|
var image = get_viewport().get_texture().get_image()
|
||||||
|
|
||||||
|
if not DirAccess.dir_exists_absolute("user://photos"):
|
||||||
|
DirAccess.make_dir_absolute("user://photos")
|
||||||
|
|
||||||
|
var timestamp = str(Time.get_unix_time_from_system())
|
||||||
|
var file_path = "user://photos/photo_" + timestamp + ".png"
|
||||||
|
image.save_png(file_path)
|
||||||
|
|
||||||
|
saved_photos.append(file_path)
|
||||||
|
sync_save_data()
|
||||||
|
on_photo_saved.emit(file_path)
|
||||||
|
|
||||||
|
func sync_save_data() -> void:
|
||||||
|
GameState.save_data.unlocked_collectibles_ids = unlocked_collectibles_ids.duplicate()
|
||||||
|
GameState.save_data.saved_photos = saved_photos.duplicate()
|
||||||
|
|
||||||
|
func load_save_data() -> void:
|
||||||
|
unlocked_collectibles_ids = GameState.save_data.unlocked_collectibles_ids.duplicate()
|
||||||
|
saved_photos = GameState.save_data.saved_photos.duplicate()
|
||||||
|
|
||||||
|
if unlocked_collectibles_ids.is_empty() and saved_photos.is_empty():
|
||||||
|
unlocked_collectibles_ids.append(&"cane")
|
||||||
|
|
||||||
|
sync_save_data()
|
||||||
1
core/photo_mode/managers/collection_manager.gd.uid
Normal file
1
core/photo_mode/managers/collection_manager.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://c3kq1qddpm8tf
|
||||||
6
core/photo_mode/runtime/collectible.gd
Normal file
6
core/photo_mode/runtime/collectible.gd
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
extends Area3D
|
||||||
|
|
||||||
|
@export var collectible_data: CollectibleResource
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
add_to_group("collectible")
|
||||||
1
core/photo_mode/runtime/collectible.gd.uid
Normal file
1
core/photo_mode/runtime/collectible.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://62d14boivr3g
|
||||||
11
core/photo_mode/runtime/collectible.tscn
Normal file
11
core/photo_mode/runtime/collectible.tscn
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
[gd_scene format=3 uid="uid://bmkxt6btcx8qr"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://62d14boivr3g" path="res://core/photo_mode/runtime/collectible.gd" id="1_xse8c"]
|
||||||
|
|
||||||
|
[sub_resource type="BoxShape3D" id="BoxShape3D_xse8c"]
|
||||||
|
|
||||||
|
[node name="Collectible" type="Area3D" unique_id=1229019813]
|
||||||
|
script = ExtResource("1_xse8c")
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=1479480920]
|
||||||
|
shape = SubResource("BoxShape3D_xse8c")
|
||||||
94
core/photo_mode/runtime/photo_mode_controller.gd
Normal file
94
core/photo_mode/runtime/photo_mode_controller.gd
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
extends Node3D
|
||||||
|
|
||||||
|
@export_group("Speed")
|
||||||
|
@export var pan_speed: float = 5.0
|
||||||
|
@export var rotation_speed: float = 0.003
|
||||||
|
|
||||||
|
@export_group("Bounds")
|
||||||
|
@export var movement_bounds: AABB
|
||||||
|
|
||||||
|
@export_group("Ref")
|
||||||
|
@export var rotation_target: Node3D
|
||||||
|
|
||||||
|
@onready var camera: Camera3D = $%Camera3D
|
||||||
|
|
||||||
|
var total_yaw: float = 0.0
|
||||||
|
var total_pitch: float = 0.0
|
||||||
|
var orbit_distance: float = 0.0
|
||||||
|
var current_pan: Vector2 = Vector2.ZERO
|
||||||
|
var is_active: bool = false
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
total_yaw = global_rotation.y
|
||||||
|
total_pitch = global_rotation.x
|
||||||
|
|
||||||
|
if rotation_target:
|
||||||
|
orbit_distance = global_position.distance_to(rotation_target.global_position)
|
||||||
|
|
||||||
|
func _unhandled_input(event: InputEvent) -> void:
|
||||||
|
if event.is_action_pressed("toggle_photo_mode"):
|
||||||
|
is_active = !is_active
|
||||||
|
|
||||||
|
get_tree().paused = is_active
|
||||||
|
|
||||||
|
if !is_active:
|
||||||
|
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
||||||
|
else:
|
||||||
|
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
||||||
|
|
||||||
|
if event is InputEventMouseMotion and is_active:
|
||||||
|
total_yaw -= event.relative.x * rotation_speed
|
||||||
|
|
||||||
|
if event.is_action_pressed("take_photo"):
|
||||||
|
take_photo_async()
|
||||||
|
|
||||||
|
func _process(delta: float) -> void:
|
||||||
|
if not rotation_target:
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
|
var pan_input = Input.get_vector("photo_pan_left", "photo_pan_right", "photo_pan_up", "photo_pan_down")
|
||||||
|
var rot_basis = Basis.from_euler(Vector3(total_pitch, total_yaw, 0))
|
||||||
|
|
||||||
|
if pan_input != Vector2.ZERO and is_active:
|
||||||
|
current_pan.x += pan_input.x * pan_speed * delta
|
||||||
|
current_pan.y += -pan_input.y * pan_speed * delta
|
||||||
|
|
||||||
|
if movement_bounds.size != Vector3.ZERO:
|
||||||
|
current_pan.x = clampf(current_pan.x, movement_bounds.position.x, movement_bounds.position.x + movement_bounds.size.x)
|
||||||
|
current_pan.y = clampf(current_pan.y, movement_bounds.position.y, movement_bounds.position.y + movement_bounds.size.y)
|
||||||
|
|
||||||
|
var right_dir = rot_basis.x.normalized()
|
||||||
|
var up_dir = rot_basis.y.normalized()
|
||||||
|
|
||||||
|
var final_pan_offset = (right_dir * current_pan.x) + (up_dir * current_pan.y)
|
||||||
|
|
||||||
|
var orbit_pos = rotation_target.global_position + (rot_basis * Vector3(0, 0, orbit_distance))
|
||||||
|
|
||||||
|
global_position = orbit_pos + final_pan_offset
|
||||||
|
global_basis = rot_basis
|
||||||
|
|
||||||
|
func take_photo_async() -> void:
|
||||||
|
if !is_active:
|
||||||
|
return
|
||||||
|
|
||||||
|
var targets = get_tree().get_nodes_in_group("collectible")
|
||||||
|
var space_state = get_world_3d().direct_space_state
|
||||||
|
|
||||||
|
await CollectionManager.save_photo_to_disk_async()
|
||||||
|
|
||||||
|
for target in targets:
|
||||||
|
if not target.collectible_data:
|
||||||
|
continue
|
||||||
|
|
||||||
|
if camera.is_position_in_frustum(target.global_position):
|
||||||
|
var query = PhysicsRayQueryParameters3D.create(camera.global_position, target.global_position)
|
||||||
|
query.collide_with_areas = true
|
||||||
|
query.collide_with_bodies = true
|
||||||
|
|
||||||
|
var result = space_state.intersect_ray(query)
|
||||||
|
|
||||||
|
if result and result.collider == target:
|
||||||
|
CollectionManager.unlock_collectible(target.collectible_data.id)
|
||||||
|
|
||||||
|
GameState.save_game()
|
||||||
1
core/photo_mode/runtime/photo_mode_controller.gd.uid
Normal file
1
core/photo_mode/runtime/photo_mode_controller.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://d7ln6iru6mq6
|
||||||
10
core/photo_mode/runtime/photo_mode_controller.tscn
Normal file
10
core/photo_mode/runtime/photo_mode_controller.tscn
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
[gd_scene format=3 uid="uid://vni5kjalum6d"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://d7ln6iru6mq6" path="res://core/photo_mode/runtime/photo_mode_controller.gd" id="1_uhpya"]
|
||||||
|
|
||||||
|
[node name="PhotoModeController" type="Node3D" unique_id=695158870]
|
||||||
|
process_mode = 3
|
||||||
|
script = ExtResource("1_uhpya")
|
||||||
|
|
||||||
|
[node name="Camera3D" type="Camera3D" parent="." unique_id=1369039645]
|
||||||
|
unique_name_in_owner = true
|
||||||
34
core/photo_mode/ui/collectible_gallery.gd
Normal file
34
core/photo_mode/ui/collectible_gallery.gd
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
extends Control
|
||||||
|
|
||||||
|
@export var collectible_ui_scene: PackedScene
|
||||||
|
|
||||||
|
@onready var grid_container: GridContainer = $%CollectibleGrid
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
CollectionManager.on_collectible_unlocked.connect(_unlock_collectible)
|
||||||
|
setup()
|
||||||
|
|
||||||
|
func setup() -> void:
|
||||||
|
var unlocked_collectible_ids = CollectionManager.get_unlocked_collectible_ids()
|
||||||
|
var collectibles = CollectionManager.get_all_collectibles()
|
||||||
|
|
||||||
|
for child in grid_container.get_children():
|
||||||
|
child.queue_free()
|
||||||
|
|
||||||
|
for collectible in collectibles:
|
||||||
|
_add_collectible(collectible)
|
||||||
|
if unlocked_collectible_ids.has(collectible.id):
|
||||||
|
_unlock_collectible(collectible.id)
|
||||||
|
|
||||||
|
func on_collectible_unlocked(collectible_id: StringName) -> void:
|
||||||
|
_unlock_collectible(collectible_id)
|
||||||
|
|
||||||
|
func _add_collectible(collectible: CollectibleResource) -> void:
|
||||||
|
var collectible_ui: CollectibleUI = collectible_ui_scene.instantiate()
|
||||||
|
collectible_ui.setup(collectible)
|
||||||
|
grid_container.add_child(collectible_ui)
|
||||||
|
|
||||||
|
func _unlock_collectible(collectible_id: StringName) -> void:
|
||||||
|
for collectible_ui in grid_container.get_children():
|
||||||
|
if collectible_ui.collectible_resource.id == collectible_id:
|
||||||
|
collectible_ui.unlock()
|
||||||
1
core/photo_mode/ui/collectible_gallery.gd.uid
Normal file
1
core/photo_mode/ui/collectible_gallery.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://dq3qtcrdnikl7
|
||||||
50
core/photo_mode/ui/collectible_gallery.tscn
Normal file
50
core/photo_mode/ui/collectible_gallery.tscn
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
[gd_scene format=3 uid="uid://bvw086glfpcba"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://dq3qtcrdnikl7" path="res://core/photo_mode/ui/collectible_gallery.gd" id="1_67tug"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://dp7dvfauh5rpx" path="res://core/photo_mode/ui/collectible_ui.tscn" id="2_or234"]
|
||||||
|
|
||||||
|
[node name="CollectibleGallery" type="Control" unique_id=354419843]
|
||||||
|
layout_mode = 3
|
||||||
|
anchors_preset = 8
|
||||||
|
anchor_left = 0.5
|
||||||
|
anchor_top = 0.5
|
||||||
|
anchor_right = 0.5
|
||||||
|
anchor_bottom = 0.5
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
script = ExtResource("1_67tug")
|
||||||
|
collectible_ui_scene = ExtResource("2_or234")
|
||||||
|
|
||||||
|
[node name="PanelContainer" type="PanelContainer" parent="." unique_id=640179265]
|
||||||
|
layout_mode = 1
|
||||||
|
anchors_preset = 8
|
||||||
|
anchor_left = 0.5
|
||||||
|
anchor_top = 0.5
|
||||||
|
anchor_right = 0.5
|
||||||
|
anchor_bottom = 0.5
|
||||||
|
offset_left = -350.0
|
||||||
|
offset_top = -350.0
|
||||||
|
offset_right = 350.0
|
||||||
|
offset_bottom = 350.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
|
||||||
|
[node name="MarginContainer" type="MarginContainer" parent="PanelContainer" unique_id=125147979]
|
||||||
|
layout_mode = 2
|
||||||
|
theme_override_constants/margin_left = 12
|
||||||
|
theme_override_constants/margin_top = 12
|
||||||
|
theme_override_constants/margin_right = 12
|
||||||
|
theme_override_constants/margin_bottom = 12
|
||||||
|
|
||||||
|
[node name="ScrollContainer" type="ScrollContainer" parent="PanelContainer/MarginContainer" unique_id=348576028]
|
||||||
|
layout_mode = 2
|
||||||
|
draw_focus_border = true
|
||||||
|
|
||||||
|
[node name="CollectibleGrid" type="GridContainer" parent="PanelContainer/MarginContainer/ScrollContainer" unique_id=1187865988]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_horizontal = 6
|
||||||
|
size_flags_vertical = 2
|
||||||
|
theme_override_constants/h_separation = 12
|
||||||
|
theme_override_constants/v_separation = 12
|
||||||
|
columns = 3
|
||||||
22
core/photo_mode/ui/collectible_ui.gd
Normal file
22
core/photo_mode/ui/collectible_ui.gd
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
extends Control
|
||||||
|
|
||||||
|
class_name CollectibleUI
|
||||||
|
|
||||||
|
@onready var label: Label = $%CollectibleName
|
||||||
|
@onready var texture_rect: TextureRect = $%CollectibleTexture
|
||||||
|
var collectible_resource: CollectibleResource
|
||||||
|
|
||||||
|
func setup(collectible: CollectibleResource) -> void:
|
||||||
|
collectible_resource = collectible
|
||||||
|
if !label:
|
||||||
|
label = $%CollectibleName
|
||||||
|
label.text = collectible_resource.title
|
||||||
|
if collectible.image:
|
||||||
|
if !texture_rect:
|
||||||
|
texture_rect = $%CollectibleTexture
|
||||||
|
texture_rect.texture = collectible_resource.image
|
||||||
|
|
||||||
|
func unlock() -> void:
|
||||||
|
if !texture_rect:
|
||||||
|
texture_rect = $%CollectibleTexture
|
||||||
|
texture_rect.set_modulate(Color(1,1,1,1))
|
||||||
1
core/photo_mode/ui/collectible_ui.gd.uid
Normal file
1
core/photo_mode/ui/collectible_ui.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://dxh8e1n16qjpp
|
||||||
49
core/photo_mode/ui/collectible_ui.tscn
Normal file
49
core/photo_mode/ui/collectible_ui.tscn
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
[gd_scene format=3 uid="uid://dp7dvfauh5rpx"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://dxh8e1n16qjpp" path="res://core/photo_mode/ui/collectible_ui.gd" id="1_tu5nx"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://cx8d233y32kmu" path="res://icon.svg" id="1_x3wje"]
|
||||||
|
|
||||||
|
[node name="CollectibleUI" type="Control" unique_id=201865221]
|
||||||
|
custom_minimum_size = Vector2(200, 200)
|
||||||
|
layout_mode = 3
|
||||||
|
anchors_preset = 0
|
||||||
|
offset_right = 200.0
|
||||||
|
offset_bottom = 200.0
|
||||||
|
script = ExtResource("1_tu5nx")
|
||||||
|
|
||||||
|
[node name="Panel" type="PanelContainer" parent="." unique_id=1372516531]
|
||||||
|
layout_mode = 1
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
|
||||||
|
[node name="MarginContainer" type="MarginContainer" parent="Panel" unique_id=1141643525]
|
||||||
|
layout_mode = 2
|
||||||
|
theme_override_constants/margin_left = 12
|
||||||
|
theme_override_constants/margin_top = 12
|
||||||
|
theme_override_constants/margin_right = 12
|
||||||
|
theme_override_constants/margin_bottom = 12
|
||||||
|
|
||||||
|
[node name="VBoxContainer" type="VBoxContainer" parent="Panel/MarginContainer" unique_id=1841409877]
|
||||||
|
layout_mode = 2
|
||||||
|
alignment = 1
|
||||||
|
|
||||||
|
[node name="CollectibleName" type="Label" parent="Panel/MarginContainer/VBoxContainer" unique_id=117774359]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_vertical = 0
|
||||||
|
text = "Collectible"
|
||||||
|
horizontal_alignment = 1
|
||||||
|
|
||||||
|
[node name="HSeparator" type="HSeparator" parent="Panel/MarginContainer/VBoxContainer" unique_id=1345822244]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="CollectibleTexture" type="TextureRect" parent="Panel/MarginContainer/VBoxContainer" unique_id=506844785]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
modulate = Color(0.16206557, 0.1620656, 0.16206557, 1)
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_vertical = 3
|
||||||
|
texture = ExtResource("1_x3wje")
|
||||||
|
stretch_mode = 3
|
||||||
11
core/photo_mode/ui/photo.gd
Normal file
11
core/photo_mode/ui/photo.gd
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
extends Control
|
||||||
|
|
||||||
|
class_name Photo
|
||||||
|
|
||||||
|
@onready var texture_rect: TextureRect = $%PhotoTexture
|
||||||
|
|
||||||
|
func setup(texture: Texture) -> void:
|
||||||
|
if texture:
|
||||||
|
if !texture_rect:
|
||||||
|
texture_rect = $%PhotoTexture
|
||||||
|
texture_rect.texture = texture
|
||||||
1
core/photo_mode/ui/photo.gd.uid
Normal file
1
core/photo_mode/ui/photo.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://dsey5dvc11vpq
|
||||||
38
core/photo_mode/ui/photo.tscn
Normal file
38
core/photo_mode/ui/photo.tscn
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
[gd_scene format=3 uid="uid://cvus62qkop3qi"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://dsey5dvc11vpq" path="res://core/photo_mode/ui/photo.gd" id="1_u0arp"]
|
||||||
|
|
||||||
|
[node name="Photo" type="Control" unique_id=201865221]
|
||||||
|
custom_minimum_size = Vector2(200, 200)
|
||||||
|
layout_mode = 3
|
||||||
|
anchors_preset = 0
|
||||||
|
offset_right = 200.0
|
||||||
|
offset_bottom = 200.0
|
||||||
|
script = ExtResource("1_u0arp")
|
||||||
|
|
||||||
|
[node name="ColorRect" type="ColorRect" parent="." unique_id=1208008621]
|
||||||
|
layout_mode = 0
|
||||||
|
offset_right = 200.0
|
||||||
|
offset_bottom = 200.0
|
||||||
|
|
||||||
|
[node name="MarginContainer" type="MarginContainer" parent="ColorRect" unique_id=1141643525]
|
||||||
|
layout_mode = 1
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
theme_override_constants/margin_left = 12
|
||||||
|
theme_override_constants/margin_top = 12
|
||||||
|
theme_override_constants/margin_right = 12
|
||||||
|
theme_override_constants/margin_bottom = 12
|
||||||
|
|
||||||
|
[node name="Panel" type="PanelContainer" parent="ColorRect/MarginContainer" unique_id=1372516531]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="PhotoTexture" type="TextureRect" parent="ColorRect/MarginContainer/Panel" unique_id=506844785]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_vertical = 3
|
||||||
|
expand_mode = 1
|
||||||
|
stretch_mode = 6
|
||||||
27
core/photo_mode/ui/photo_gallery.gd
Normal file
27
core/photo_mode/ui/photo_gallery.gd
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
extends Control
|
||||||
|
|
||||||
|
@export var photo_scene: PackedScene
|
||||||
|
|
||||||
|
@onready var grid_container: GridContainer = $%PhotoGrid
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
CollectionManager.on_photo_saved.connect(_create_photo_thumbnail)
|
||||||
|
load_gallery()
|
||||||
|
|
||||||
|
func load_gallery() -> void:
|
||||||
|
for child in grid_container.get_children():
|
||||||
|
child.queue_free()
|
||||||
|
|
||||||
|
var saved_photos = CollectionManager.saved_photos
|
||||||
|
|
||||||
|
for file_path in saved_photos:
|
||||||
|
if FileAccess.file_exists(file_path):
|
||||||
|
_create_photo_thumbnail(file_path)
|
||||||
|
|
||||||
|
func _create_photo_thumbnail(file_path: String) -> void:
|
||||||
|
var image = Image.load_from_file(file_path)
|
||||||
|
if image:
|
||||||
|
var photo: Photo = photo_scene.instantiate()
|
||||||
|
var texture = ImageTexture.create_from_image(image)
|
||||||
|
photo.setup(texture)
|
||||||
|
grid_container.add_child(photo)
|
||||||
1
core/photo_mode/ui/photo_gallery.gd.uid
Normal file
1
core/photo_mode/ui/photo_gallery.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://k4iqrlkbjppl
|
||||||
50
core/photo_mode/ui/photo_gallery.tscn
Normal file
50
core/photo_mode/ui/photo_gallery.tscn
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
[gd_scene format=3 uid="uid://b6r787sik5yil"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://k4iqrlkbjppl" path="res://core/photo_mode/ui/photo_gallery.gd" id="1_bp5uf"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://cvus62qkop3qi" path="res://core/photo_mode/ui/photo.tscn" id="2_45wok"]
|
||||||
|
|
||||||
|
[node name="PhotoGallery" type="Control" unique_id=354419843]
|
||||||
|
layout_mode = 3
|
||||||
|
anchors_preset = 8
|
||||||
|
anchor_left = 0.5
|
||||||
|
anchor_top = 0.5
|
||||||
|
anchor_right = 0.5
|
||||||
|
anchor_bottom = 0.5
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
script = ExtResource("1_bp5uf")
|
||||||
|
photo_scene = ExtResource("2_45wok")
|
||||||
|
|
||||||
|
[node name="PanelContainer" type="PanelContainer" parent="." unique_id=640179265]
|
||||||
|
layout_mode = 1
|
||||||
|
anchors_preset = 8
|
||||||
|
anchor_left = 0.5
|
||||||
|
anchor_top = 0.5
|
||||||
|
anchor_right = 0.5
|
||||||
|
anchor_bottom = 0.5
|
||||||
|
offset_left = -350.0
|
||||||
|
offset_top = -350.0
|
||||||
|
offset_right = 350.0
|
||||||
|
offset_bottom = 350.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
|
||||||
|
[node name="MarginContainer" type="MarginContainer" parent="PanelContainer" unique_id=125147979]
|
||||||
|
layout_mode = 2
|
||||||
|
theme_override_constants/margin_left = 12
|
||||||
|
theme_override_constants/margin_top = 12
|
||||||
|
theme_override_constants/margin_right = 12
|
||||||
|
theme_override_constants/margin_bottom = 12
|
||||||
|
|
||||||
|
[node name="ScrollContainer" type="ScrollContainer" parent="PanelContainer/MarginContainer" unique_id=348576028]
|
||||||
|
layout_mode = 2
|
||||||
|
draw_focus_border = true
|
||||||
|
|
||||||
|
[node name="PhotoGrid" type="GridContainer" parent="PanelContainer/MarginContainer/ScrollContainer" unique_id=1187865988]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_horizontal = 6
|
||||||
|
size_flags_vertical = 2
|
||||||
|
theme_override_constants/h_separation = 12
|
||||||
|
theme_override_constants/v_separation = 12
|
||||||
|
columns = 3
|
||||||
31
core/radio/radio.gd
Normal file
31
core/radio/radio.gd
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
extends AudioStreamPlayer
|
||||||
|
|
||||||
|
class_name Radio
|
||||||
|
|
||||||
|
@export var playlist: Array[AudioStream] = []
|
||||||
|
var current_track_index: int = 0
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
finished.connect(next_track)
|
||||||
|
|
||||||
|
func play_track(index: int = current_track_index):
|
||||||
|
if playlist.is_empty():
|
||||||
|
return
|
||||||
|
|
||||||
|
current_track_index = posmod(index, playlist.size())
|
||||||
|
stream = playlist[current_track_index]
|
||||||
|
play()
|
||||||
|
stream_paused = false
|
||||||
|
|
||||||
|
func next_track():
|
||||||
|
play_track(current_track_index + 1)
|
||||||
|
|
||||||
|
func prev_track():
|
||||||
|
play_track(current_track_index - 1)
|
||||||
|
|
||||||
|
func toggle_pause():
|
||||||
|
stream_paused = !stream_paused
|
||||||
|
|
||||||
|
func stop_radio():
|
||||||
|
stop()
|
||||||
|
stream_paused = false
|
||||||
1
core/radio/radio.gd.uid
Normal file
1
core/radio/radio.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://bwrgh6xlvhqch
|
||||||
7
core/radio/radio.tscn
Normal file
7
core/radio/radio.tscn
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
[gd_scene format=3 uid="uid://cpeyt1dgrtglc"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://bwrgh6xlvhqch" path="res://core/radio/radio.gd" id="1_2akjj"]
|
||||||
|
|
||||||
|
[node name="Radio" type="AudioStreamPlayer" unique_id=1234112225]
|
||||||
|
bus = &"Music"
|
||||||
|
script = ExtResource("1_2akjj")
|
||||||
15
default_bus_layout.tres
Normal file
15
default_bus_layout.tres
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
[gd_resource type="AudioBusLayout" format=3 uid="uid://cqvx62pwvvboj"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
bus/1/name = &"Music"
|
||||||
|
bus/1/solo = false
|
||||||
|
bus/1/mute = false
|
||||||
|
bus/1/bypass_fx = false
|
||||||
|
bus/1/volume_db = 0.0
|
||||||
|
bus/1/send = &"Master"
|
||||||
|
bus/2/name = &"SFX"
|
||||||
|
bus/2/solo = false
|
||||||
|
bus/2/mute = false
|
||||||
|
bus/2/bypass_fx = false
|
||||||
|
bus/2/volume_db = 0.0
|
||||||
|
bus/2/send = &"Master"
|
||||||
92
docs/gyms/ai/gym_ai.tscn
Normal file
92
docs/gyms/ai/gym_ai.tscn
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
[gd_scene format=3 uid="uid://dqvrhiqgkd3w1"]
|
||||||
|
|
||||||
|
[ext_resource type="PackedScene" uid="uid://clx701xdwelgx" path="res://core/ai/agents/base/ai_base.tscn" id="1_a2xtd"]
|
||||||
|
|
||||||
|
[sub_resource type="NavigationMesh" id="NavigationMesh_optuv"]
|
||||||
|
vertices = PackedVector3Array(10.984741, 0.25012434, -1.0140381, 11.234741, 0.25012434, 0.23596191, 19.484741, 0.25012434, 0.23596191, 19.484741, 0.25012434, -19.514038, 9.234741, 0.25012434, -1.0140381, -19.515259, 0.25012434, -19.514038, -19.515259, 0.25012434, -0.014038086, 8.984741, 0.25012434, -0.014038086, 10.984741, 0.25012434, 1.2359619, 19.484741, 0.25012434, 19.235962, 9.234741, 0.25012434, 1.2359619, -19.515259, 0.25012434, 19.235962)
|
||||||
|
polygons = [PackedInt32Array(1, 0, 2), PackedInt32Array(2, 0, 3), PackedInt32Array(6, 5, 4), PackedInt32Array(4, 5, 3), PackedInt32Array(3, 0, 4), PackedInt32Array(4, 7, 6), PackedInt32Array(1, 2, 8), PackedInt32Array(8, 2, 9), PackedInt32Array(6, 10, 11), PackedInt32Array(11, 10, 9), PackedInt32Array(10, 8, 9), PackedInt32Array(6, 7, 10)]
|
||||||
|
|
||||||
|
[sub_resource type="PlaneMesh" id="PlaneMesh_optuv"]
|
||||||
|
|
||||||
|
[sub_resource type="BoxShape3D" id="BoxShape3D_xtjak"]
|
||||||
|
size = Vector3(1.9942131, 0.09710693, 1.984024)
|
||||||
|
|
||||||
|
[sub_resource type="BoxMesh" id="BoxMesh_lmjyn"]
|
||||||
|
|
||||||
|
[sub_resource type="BoxShape3D" id="BoxShape3D_lmjyn"]
|
||||||
|
|
||||||
|
[sub_resource type="Environment" id="Environment_lmjyn"]
|
||||||
|
|
||||||
|
[node name="GymAI" type="Node3D" unique_id=868339787]
|
||||||
|
|
||||||
|
[node name="NavigationRegion3D" type="NavigationRegion3D" parent="." unique_id=774907858]
|
||||||
|
navigation_mesh = SubResource("NavigationMesh_optuv")
|
||||||
|
|
||||||
|
[node name="Floor" type="MeshInstance3D" parent="NavigationRegion3D" unique_id=1976415311]
|
||||||
|
transform = Transform3D(20, 0, 0, 0, 20, 0, 0, 0, 20, 0, -0.83473957, 0)
|
||||||
|
mesh = SubResource("PlaneMesh_optuv")
|
||||||
|
|
||||||
|
[node name="StaticBody3D" type="StaticBody3D" parent="NavigationRegion3D/Floor" unique_id=2007477719]
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="NavigationRegion3D/Floor/StaticBody3D" unique_id=1446628130]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0036563873, -0.009703338, -0.00868988)
|
||||||
|
shape = SubResource("BoxShape3D_xtjak")
|
||||||
|
|
||||||
|
[node name="Obstacle" type="MeshInstance3D" parent="NavigationRegion3D" unique_id=710701082]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 10.148018, 0.06508446, 0)
|
||||||
|
mesh = SubResource("BoxMesh_lmjyn")
|
||||||
|
|
||||||
|
[node name="StaticBody3D" type="StaticBody3D" parent="NavigationRegion3D/Obstacle" unique_id=67152580]
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="NavigationRegion3D/Obstacle/StaticBody3D" unique_id=1663742898]
|
||||||
|
shape = SubResource("BoxShape3D_lmjyn")
|
||||||
|
|
||||||
|
[node name="AIBase" parent="." unique_id=1228675528 instance=ExtResource("1_a2xtd")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.48246834, 0.21202153, 0.11262059)
|
||||||
|
|
||||||
|
[node name="Camera3D" type="Camera3D" parent="." unique_id=1148396057]
|
||||||
|
transform = Transform3D(-2.0613477e-08, 0.8818225, -0.47158146, 3.854569e-08, 0.47158146, 0.8818225, 1, -3.5527137e-15, -4.371139e-08, -18.21907, 28.71355, 0)
|
||||||
|
|
||||||
|
[node name="WorldEnvironment" type="WorldEnvironment" parent="." unique_id=1772424900]
|
||||||
|
environment = SubResource("Environment_lmjyn")
|
||||||
|
|
||||||
|
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="." unique_id=269230449]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 0.17952333, 0.98375374, 0, -0.98375374, 0.17952333, 0, 18.920979, 0)
|
||||||
|
|
||||||
|
[node name="Control" type="Control" parent="." unique_id=1072240389]
|
||||||
|
layout_mode = 3
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
|
||||||
|
[node name="PanelContainer" type="PanelContainer" parent="Control" unique_id=1647272132]
|
||||||
|
layout_mode = 0
|
||||||
|
offset_left = 50.0
|
||||||
|
offset_top = 50.0
|
||||||
|
offset_right = 400.0
|
||||||
|
offset_bottom = 827.0
|
||||||
|
|
||||||
|
[node name="Label" type="Label" parent="Control/PanelContainer" unique_id=272421245]
|
||||||
|
custom_minimum_size = Vector2(1, 1)
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_vertical = 1
|
||||||
|
text = "System Logic:
|
||||||
|
- The NPC uses a finite state machine to switch between behaviors.
|
||||||
|
- State logic runs during physics updates, while movement is handled by the agent through NavigationAgent3D.
|
||||||
|
|
||||||
|
AI States:
|
||||||
|
- IdleState: The agent waits in place for the duration defined by wait_time.
|
||||||
|
- PatrolState: The agent selects a valid random destination and moves toward it.
|
||||||
|
|
||||||
|
Core Components:
|
||||||
|
- NavigationAgent3D: Calculates the path and reports when the destination has been reached.
|
||||||
|
- PatrolRadiusShape: Defines the random movement area used when choosing the next patrol point.
|
||||||
|
- StateMachine: Initializes the available states and handles transitions between them.
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
- Speed: Movement speed of the agent.
|
||||||
|
- Wait Time: Delay in seconds on the IdleState node.
|
||||||
|
- Area Radius: Radius of the SphereShape3D used by PatrolRadiusShape."
|
||||||
|
autowrap_mode = 2
|
||||||
7
docs/gyms/photo_mode/gym_photo_mode.gd
Normal file
7
docs/gyms/photo_mode/gym_photo_mode.gd
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
extends Node3D
|
||||||
|
|
||||||
|
@onready var gallery: Control = $%Gallery
|
||||||
|
|
||||||
|
|
||||||
|
func _on_button_gallery_pressed() -> void:
|
||||||
|
gallery.visible = !gallery.visible
|
||||||
1
docs/gyms/photo_mode/gym_photo_mode.gd.uid
Normal file
1
docs/gyms/photo_mode/gym_photo_mode.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://7oglx4br38d5
|
||||||
138
docs/gyms/photo_mode/gym_photo_mode.tscn
Normal file
138
docs/gyms/photo_mode/gym_photo_mode.tscn
Normal file
@@ -0,0 +1,138 @@
|
|||||||
|
[gd_scene format=3 uid="uid://bwc8slnbu7dmn"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://7oglx4br38d5" path="res://docs/gyms/photo_mode/gym_photo_mode.gd" id="1_cl1h5"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://vni5kjalum6d" path="res://core/photo_mode/runtime/photo_mode_controller.tscn" id="2_q5kgc"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bmkxt6btcx8qr" path="res://core/photo_mode/runtime/collectible.tscn" id="3_734hf"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://c3grftlmap4q5" path="res://tgcc/chunk/prop/tree/leaf1_alpha.png" id="4_00joj"]
|
||||||
|
[ext_resource type="Script" uid="uid://bj34o0org55ei" path="res://core/photo_mode/data/collectible_resource.gd" id="5_crfij"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bvw086glfpcba" path="res://core/photo_mode/ui/collectible_gallery.tscn" id="6_6aab5"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://b6r787sik5yil" path="res://core/photo_mode/ui/photo_gallery.tscn" id="7_tb1ii"]
|
||||||
|
|
||||||
|
[sub_resource type="Environment" id="Environment_48mla"]
|
||||||
|
|
||||||
|
[sub_resource type="PlaneMesh" id="PlaneMesh_hh1ka"]
|
||||||
|
|
||||||
|
[sub_resource type="BoxShape3D" id="BoxShape3D_ynvi2"]
|
||||||
|
size = Vector3(1.9942131, 0.09710693, 1.984024)
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_ynvi2"]
|
||||||
|
script = ExtResource("5_crfij")
|
||||||
|
id = &"gatto"
|
||||||
|
title = "Gatto"
|
||||||
|
image = ExtResource("4_00joj")
|
||||||
|
metadata/_custom_type_script = "uid://bj34o0org55ei"
|
||||||
|
|
||||||
|
[sub_resource type="BoxMesh" id="BoxMesh_hh1ka"]
|
||||||
|
|
||||||
|
[node name="GymPhotoMode" type="Node3D" unique_id=1314600330]
|
||||||
|
script = ExtResource("1_cl1h5")
|
||||||
|
|
||||||
|
[node name="WorldEnvironment" type="WorldEnvironment" parent="." unique_id=213183287]
|
||||||
|
environment = SubResource("Environment_48mla")
|
||||||
|
|
||||||
|
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="." unique_id=1274975837]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 0.17952333, 0.98375374, 0, -0.98375374, 0.17952333, 0, 18.920979, 0)
|
||||||
|
|
||||||
|
[node name="Floor" type="MeshInstance3D" parent="." unique_id=958865480]
|
||||||
|
transform = Transform3D(20, 0, 0, 0, 20, 0, 0, 0, 20, 0, -0.83473957, 0)
|
||||||
|
mesh = SubResource("PlaneMesh_hh1ka")
|
||||||
|
|
||||||
|
[node name="StaticBody3D" type="StaticBody3D" parent="Floor" unique_id=2096983240]
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="Floor/StaticBody3D" unique_id=188185045]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0036563873, -0.009703338, -0.00868988)
|
||||||
|
shape = SubResource("BoxShape3D_ynvi2")
|
||||||
|
|
||||||
|
[node name="PhotoModeController" parent="." unique_id=695158870 node_paths=PackedStringArray("rotation_target") instance=ExtResource("2_q5kgc")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 0.49999994, 0.8660254, 0, -0.8660254, 0.49999994, 0, 30, 20)
|
||||||
|
movement_bounds = AABB(-5, -5, -5, 10, 10, 10)
|
||||||
|
rotation_target = NodePath("../Node3D")
|
||||||
|
|
||||||
|
[node name="Node3D" type="Node3D" parent="." unique_id=570786250]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 10, 0)
|
||||||
|
|
||||||
|
[node name="Node3D2" type="Node3D" parent="." unique_id=15037296]
|
||||||
|
|
||||||
|
[node name="Collectible" parent="Node3D2" unique_id=1229019813 instance=ExtResource("3_734hf")]
|
||||||
|
collectible_data = SubResource("Resource_ynvi2")
|
||||||
|
|
||||||
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="Node3D2" unique_id=553040412]
|
||||||
|
mesh = SubResource("BoxMesh_hh1ka")
|
||||||
|
|
||||||
|
[node name="Control" type="Control" parent="." unique_id=1802496396]
|
||||||
|
layout_mode = 3
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
mouse_filter = 2
|
||||||
|
|
||||||
|
[node name="ButtonGallery" type="Button" parent="Control" unique_id=539195532]
|
||||||
|
layout_mode = 0
|
||||||
|
offset_left = 50.0
|
||||||
|
offset_top = 50.0
|
||||||
|
offset_right = 163.0
|
||||||
|
offset_bottom = 81.0
|
||||||
|
text = "Menu"
|
||||||
|
|
||||||
|
[node name="Gallery" type="HSplitContainer" parent="Control" unique_id=1388833682]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
visible = false
|
||||||
|
layout_mode = 1
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
offset_left = 420.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
|
||||||
|
[node name="CollectibleGallery" parent="Control/Gallery" unique_id=354419843 instance=ExtResource("6_6aab5")]
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
|
||||||
|
[node name="PhotoGallery" parent="Control/Gallery" unique_id=263414560 instance=ExtResource("7_tb1ii")]
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
|
||||||
|
[node name="PanelContainer" type="PanelContainer" parent="Control" unique_id=2015953740]
|
||||||
|
layout_mode = 0
|
||||||
|
offset_left = 50.0
|
||||||
|
offset_top = 150.0
|
||||||
|
offset_right = 400.0
|
||||||
|
offset_bottom = 927.0
|
||||||
|
|
||||||
|
[node name="ScrollContainer" type="ScrollContainer" parent="Control/PanelContainer" unique_id=1474258594]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="Label" type="Label" parent="Control/PanelContainer/ScrollContainer" unique_id=1982569320]
|
||||||
|
custom_minimum_size = Vector2(1, 1)
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
text = "System Logic:
|
||||||
|
- The system allows players to toggle a free camera mode to photograph and collect museum items.
|
||||||
|
- Game Pause: Activating the mode pauses the SceneTree, freezing the world while allowing the camera to remain functional.
|
||||||
|
- Taking a photo saves the captured image to disk and checks which collectibles are visible and unobstructed before unlocking them.
|
||||||
|
- CollectionManager acts as a global singleton that tracks unlocked collectibles, saved photos, and the data used by the UI.
|
||||||
|
|
||||||
|
Photo Mode Actions:
|
||||||
|
- Toggle Mode(P): Switches between normal gameplay and the photo camera, capturing or releasing the mouse, and toggles the global pause state.
|
||||||
|
- Rotate(Mouse): The camera orbits around the configured target while photo mode is active.
|
||||||
|
- Pan(Input Actions): The camera can be moved horizontally and vertically within the configured bounds.
|
||||||
|
- Capture(F): Saves the current frame and performs frustum and raycast checks against collectibles in view.
|
||||||
|
|
||||||
|
Core Components:
|
||||||
|
- PhotoModeController: Manages camera inputs, movement logic, and the photo-taking process.
|
||||||
|
- Collectible: An Area3D node placed on objects to make them identifiable by the camera.
|
||||||
|
- CollectionManager: Handles the logic for unlocking items and provides data to the UI.
|
||||||
|
- CollectibleGallery: Displays all collectibles and visually highlights the unlocked ones.
|
||||||
|
- PhotoGallery: Displays the photos saved by the player during the session.
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
- Pan & Rotation Speed: Defines how fast the camera moves and rotates.
|
||||||
|
- Movement Bounds: An AABB that restricts the camera's panning area.
|
||||||
|
- Collectible Data: Resource files containing the ID, title, and image for each item.
|
||||||
|
- Library: A central list of all CollectibleResources registered in the game."
|
||||||
|
autowrap_mode = 2
|
||||||
|
|
||||||
|
[connection signal="pressed" from="Control/ButtonGallery" to="." method="_on_button_gallery_pressed"]
|
||||||
35
docs/gyms/radio/gym_radio.gd
Normal file
35
docs/gyms/radio/gym_radio.gd
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
extends Node3D
|
||||||
|
|
||||||
|
@onready var radio: Radio = $%Radio
|
||||||
|
@onready var button_pause_resume: Button = $%Button_Pause_Resume
|
||||||
|
@onready var settings_menu: SettingsMenu = $%SettingsMenu
|
||||||
|
|
||||||
|
func _on_button_play_pressed() -> void:
|
||||||
|
if !radio.playing:
|
||||||
|
radio.play_track()
|
||||||
|
|
||||||
|
|
||||||
|
func _on_button_pause_pressed() -> void:
|
||||||
|
radio.toggle_pause()
|
||||||
|
if !button_pause_resume:
|
||||||
|
button_pause_resume = $%Button_Pause_Resume
|
||||||
|
if radio.stream_paused:
|
||||||
|
button_pause_resume.text = "Resume"
|
||||||
|
else:
|
||||||
|
button_pause_resume.text = "Pause"
|
||||||
|
|
||||||
|
|
||||||
|
func _on_button_stop_pressed() -> void:
|
||||||
|
radio.stop_radio()
|
||||||
|
|
||||||
|
|
||||||
|
func _on_button_next_pressed() -> void:
|
||||||
|
radio.next_track()
|
||||||
|
|
||||||
|
|
||||||
|
func _on_button_previous_pressed() -> void:
|
||||||
|
radio.prev_track()
|
||||||
|
|
||||||
|
|
||||||
|
func _on_button_settings_menu_pressed() -> void:
|
||||||
|
settings_menu.visible = !settings_menu.visible
|
||||||
1
docs/gyms/radio/gym_radio.gd.uid
Normal file
1
docs/gyms/radio/gym_radio.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://ew4b78u5tkiu
|
||||||
104
docs/gyms/radio/gym_radio.tscn
Normal file
104
docs/gyms/radio/gym_radio.tscn
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
[gd_scene format=3 uid="uid://bdkdhn1oallke"]
|
||||||
|
|
||||||
|
[ext_resource type="PackedScene" uid="uid://cpeyt1dgrtglc" path="res://core/radio/radio.tscn" id="1_8yomj"]
|
||||||
|
[ext_resource type="Script" uid="uid://ew4b78u5tkiu" path="res://docs/gyms/radio/gym_radio.gd" id="1_h5r8c"]
|
||||||
|
[ext_resource type="AudioStream" uid="uid://70cc8she43re" path="res://docs/gyms/radio/lofi_01.ogg" id="3_ltpvc"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://caqf471x0kttc" path="res://core/audio/settings/settings_menu.tscn" id="4_8pw2j"]
|
||||||
|
|
||||||
|
[node name="GymRadio" type="Node3D" unique_id=204859062]
|
||||||
|
script = ExtResource("1_h5r8c")
|
||||||
|
|
||||||
|
[node name="Radio" parent="." unique_id=1234112225 instance=ExtResource("1_8yomj")]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
playlist = Array[AudioStream]([ExtResource("3_ltpvc")])
|
||||||
|
|
||||||
|
[node name="Control" type="Control" parent="." unique_id=1232082176]
|
||||||
|
layout_mode = 3
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
|
||||||
|
[node name="SettingsMenu" parent="Control" unique_id=1639777294 instance=ExtResource("4_8pw2j")]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
visible = false
|
||||||
|
layout_mode = 1
|
||||||
|
anchors_preset = 8
|
||||||
|
anchor_left = 0.5
|
||||||
|
anchor_top = 0.5
|
||||||
|
anchor_right = 0.5
|
||||||
|
anchor_bottom = 0.5
|
||||||
|
|
||||||
|
[node name="VBoxContainer2" type="VBoxContainer" parent="Control" unique_id=2092627240]
|
||||||
|
layout_mode = 1
|
||||||
|
anchors_preset = 9
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
offset_right = 229.0
|
||||||
|
grow_vertical = 2
|
||||||
|
|
||||||
|
[node name="VBoxContainer" type="VBoxContainer" parent="Control/VBoxContainer2" unique_id=2097365775]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="Button_Play" type="Button" parent="Control/VBoxContainer2/VBoxContainer" unique_id=1422696340]
|
||||||
|
layout_mode = 2
|
||||||
|
text = "Play"
|
||||||
|
|
||||||
|
[node name="Button_Pause_Resume" type="Button" parent="Control/VBoxContainer2/VBoxContainer" unique_id=2016690081]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
layout_mode = 2
|
||||||
|
text = "Pause"
|
||||||
|
|
||||||
|
[node name="Button_Stop" type="Button" parent="Control/VBoxContainer2/VBoxContainer" unique_id=61861870]
|
||||||
|
layout_mode = 2
|
||||||
|
text = "Stop"
|
||||||
|
|
||||||
|
[node name="Button_Next" type="Button" parent="Control/VBoxContainer2/VBoxContainer" unique_id=957606385]
|
||||||
|
layout_mode = 2
|
||||||
|
text = "Next"
|
||||||
|
|
||||||
|
[node name="Button_Previous" type="Button" parent="Control/VBoxContainer2/VBoxContainer" unique_id=929072518]
|
||||||
|
layout_mode = 2
|
||||||
|
text = "Previous"
|
||||||
|
|
||||||
|
[node name="Button_SettingsMenu" type="Button" parent="Control/VBoxContainer2/VBoxContainer" unique_id=431867154]
|
||||||
|
layout_mode = 2
|
||||||
|
text = "SettingsMenu"
|
||||||
|
|
||||||
|
[node name="PanelContainer" type="PanelContainer" parent="Control/VBoxContainer2" unique_id=1558442050]
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_vertical = 3
|
||||||
|
|
||||||
|
[node name="ScrollContainer" type="ScrollContainer" parent="Control/VBoxContainer2/PanelContainer" unique_id=7789304]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="Label" type="Label" parent="Control/VBoxContainer2/PanelContainer/ScrollContainer" unique_id=2043293564]
|
||||||
|
custom_minimum_size = Vector2(1, 1)
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
size_flags_vertical = 1
|
||||||
|
text = "System Logic:
|
||||||
|
- The system is an extension of AudioStreamPlayer designed to manage sequential audio playback.
|
||||||
|
- It automatically triggers the next track in the sequence when the current one finishes via the finished signal.
|
||||||
|
|
||||||
|
Core Functionality:
|
||||||
|
- Playlist Management: Stores a list of AudioStream resources and tracks the current song index.
|
||||||
|
- Track Navigation: Allows cycling forward and backward through the playlist with index wrapping (loops back to start/end).
|
||||||
|
- Playback Control: Supports jumping to specific tracks, toggling the pause state, and stopping the stream.
|
||||||
|
- Audio Settings: If the Music bus exists, the Settings menu can be used to test and adjust playback volume.
|
||||||
|
|
||||||
|
Key Methods:
|
||||||
|
- play_track: Loads a specific stream from the playlist and begins playback.
|
||||||
|
- next_track / prev_track: Increments or decrements the index to navigate the playlist.
|
||||||
|
- toggle_pause: Resumes or pauses the current stream without resetting its position.
|
||||||
|
|
||||||
|
Adjustable Parameters:
|
||||||
|
- Playlist: An Array in the inspector where you can assign one or more AudioStream resources."
|
||||||
|
autowrap_mode = 2
|
||||||
|
|
||||||
|
[connection signal="pressed" from="Control/VBoxContainer2/VBoxContainer/Button_Play" to="." method="_on_button_play_pressed"]
|
||||||
|
[connection signal="pressed" from="Control/VBoxContainer2/VBoxContainer/Button_Pause_Resume" to="." method="_on_button_pause_pressed"]
|
||||||
|
[connection signal="pressed" from="Control/VBoxContainer2/VBoxContainer/Button_Stop" to="." method="_on_button_stop_pressed"]
|
||||||
|
[connection signal="pressed" from="Control/VBoxContainer2/VBoxContainer/Button_Next" to="." method="_on_button_next_pressed"]
|
||||||
|
[connection signal="pressed" from="Control/VBoxContainer2/VBoxContainer/Button_Previous" to="." method="_on_button_previous_pressed"]
|
||||||
|
[connection signal="pressed" from="Control/VBoxContainer2/VBoxContainer/Button_SettingsMenu" to="." method="_on_button_settings_menu_pressed"]
|
||||||
BIN
docs/gyms/radio/lofi_01.ogg
Normal file
BIN
docs/gyms/radio/lofi_01.ogg
Normal file
Binary file not shown.
19
docs/gyms/radio/lofi_01.ogg.import
Normal file
19
docs/gyms/radio/lofi_01.ogg.import
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="oggvorbisstr"
|
||||||
|
type="AudioStreamOggVorbis"
|
||||||
|
uid="uid://70cc8she43re"
|
||||||
|
path="res://.godot/imported/lofi_01.ogg-0aacd597266806080412021811923091.oggvorbisstr"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://docs/gyms/radio/lofi_01.ogg"
|
||||||
|
dest_files=["res://.godot/imported/lofi_01.ogg-0aacd597266806080412021811923091.oggvorbisstr"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
loop=false
|
||||||
|
loop_offset=0
|
||||||
|
bpm=0
|
||||||
|
beat_count=0
|
||||||
|
bar_beats=4
|
||||||
@@ -19,6 +19,9 @@ config/icon="uid://bfar1kk3pgq8f"
|
|||||||
[autoload]
|
[autoload]
|
||||||
|
|
||||||
UIEvents="*uid://dehu28iq27mbn"
|
UIEvents="*uid://dehu28iq27mbn"
|
||||||
|
GameState="*uid://b17g2w2g101o6"
|
||||||
|
CollectionManager="*uid://c3kq1qddpm8tf"
|
||||||
|
AudioManager="*uid://dcttbbavtwtsg"
|
||||||
|
|
||||||
[display]
|
[display]
|
||||||
|
|
||||||
@@ -34,6 +37,39 @@ weather_vegetables_node=""
|
|||||||
wind_node="Materials to apply wind"
|
wind_node="Materials to apply wind"
|
||||||
weather_node=""
|
weather_node=""
|
||||||
|
|
||||||
|
[input]
|
||||||
|
|
||||||
|
photo_pan_left={
|
||||||
|
"deadzone": 0.2,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":65,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
photo_pan_right={
|
||||||
|
"deadzone": 0.2,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
photo_pan_up={
|
||||||
|
"deadzone": 0.2,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
photo_pan_down={
|
||||||
|
"deadzone": 0.2,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
take_photo={
|
||||||
|
"deadzone": 0.2,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":70,"key_label":0,"unicode":102,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
toggle_photo_mode={
|
||||||
|
"deadzone": 0.2,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":80,"key_label":0,"unicode":112,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
[physics]
|
[physics]
|
||||||
|
|
||||||
3d/physics_engine="Jolt Physics"
|
3d/physics_engine="Jolt Physics"
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -20,6 +20,7 @@ shader_parameter/variance_scale = 0.1
|
|||||||
shader_parameter/variance_color = Color(0.09803922, 0.18039216, 0.05490196, 1)
|
shader_parameter/variance_color = Color(0.09803922, 0.18039216, 0.05490196, 1)
|
||||||
shader_parameter/variance_intensity = 0.90000004275
|
shader_parameter/variance_intensity = 0.90000004275
|
||||||
shader_parameter/snow_color = Color(0.85, 0.9, 0.95, 1)
|
shader_parameter/snow_color = Color(0.85, 0.9, 0.95, 1)
|
||||||
|
shader_parameter/snow_visibility = 1.0
|
||||||
shader_parameter/height_min = 0.0
|
shader_parameter/height_min = 0.0
|
||||||
shader_parameter/height_max = 5.0
|
shader_parameter/height_max = 5.0
|
||||||
shader_parameter/shadow_intensity = 0.610000028975
|
shader_parameter/shadow_intensity = 0.610000028975
|
||||||
@@ -27,3 +28,4 @@ shader_parameter/highlight_intensity = 0.0
|
|||||||
shader_parameter/light_steps = 2.150000054625
|
shader_parameter/light_steps = 2.150000054625
|
||||||
shader_parameter/random_mix = 0.0
|
shader_parameter/random_mix = 0.0
|
||||||
shader_parameter/cast_shadow_strength = 0.6
|
shader_parameter/cast_shadow_strength = 0.6
|
||||||
|
shader_parameter/wetness_darkening = 0.25
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ shader_parameter/variance_scale = 0.06
|
|||||||
shader_parameter/variance_color = Color(0.3, 0.5, 0.2, 1)
|
shader_parameter/variance_color = Color(0.3, 0.5, 0.2, 1)
|
||||||
shader_parameter/variance_intensity = 0.350000016625
|
shader_parameter/variance_intensity = 0.350000016625
|
||||||
shader_parameter/snow_color = Color(0.85, 0.9, 0.95, 1)
|
shader_parameter/snow_color = Color(0.85, 0.9, 0.95, 1)
|
||||||
|
shader_parameter/snow_visibility = 1.0
|
||||||
shader_parameter/height_min = 0.0
|
shader_parameter/height_min = 0.0
|
||||||
shader_parameter/height_max = 5.0
|
shader_parameter/height_max = 5.0
|
||||||
shader_parameter/shadow_intensity = 0.6000000285
|
shader_parameter/shadow_intensity = 0.6000000285
|
||||||
@@ -35,3 +36,4 @@ shader_parameter/highlight_intensity = 0.10000000475
|
|||||||
shader_parameter/light_steps = 8.600000361
|
shader_parameter/light_steps = 8.600000361
|
||||||
shader_parameter/random_mix = 0.0150000007125
|
shader_parameter/random_mix = 0.0150000007125
|
||||||
shader_parameter/cast_shadow_strength = 0.6
|
shader_parameter/cast_shadow_strength = 0.6
|
||||||
|
shader_parameter/wetness_darkening = 0.25
|
||||||
|
|||||||
@@ -22,3 +22,4 @@ shader_parameter/light_steps = 10.0
|
|||||||
shader_parameter/random_mix = 0.138000006555
|
shader_parameter/random_mix = 0.138000006555
|
||||||
shader_parameter/cast_shadow_strength = 0.6
|
shader_parameter/cast_shadow_strength = 0.6
|
||||||
shader_parameter/wetness_darkening = 0.25
|
shader_parameter/wetness_darkening = 0.25
|
||||||
|
shader_parameter/snow_visibility = 1.0
|
||||||
|
|||||||
@@ -22,3 +22,4 @@ shader_parameter/light_steps = 10.0
|
|||||||
shader_parameter/random_mix = 0.010000000475
|
shader_parameter/random_mix = 0.010000000475
|
||||||
shader_parameter/cast_shadow_strength = 0.6
|
shader_parameter/cast_shadow_strength = 0.6
|
||||||
shader_parameter/wetness_darkening = 0.25
|
shader_parameter/wetness_darkening = 0.25
|
||||||
|
shader_parameter/snow_visibility = 1.0
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ shader_parameter/puddle_threshold = 0.45
|
|||||||
[node name="TreeTest3" unique_id=1532527216 groups=["weather_node", "wind_node"] instance=ExtResource("1_8jt4o")]
|
[node name="TreeTest3" unique_id=1532527216 groups=["weather_node", "wind_node"] instance=ExtResource("1_8jt4o")]
|
||||||
transform = Transform3D(1.7, 0, 0, 0, 1.7, 0, 0, 0, 1.7, 0, 0, 0)
|
transform = Transform3D(1.7, 0, 0, 0, 1.7, 0, 0, 0, 1.7, 0, 0, 0)
|
||||||
|
|
||||||
[node name="Leaf" parent="." index="0" unique_id=2098078578]
|
[node name="Leaf" parent="." index="0" unique_id=2028330452]
|
||||||
transform = Transform3D(100, 0, 0, 0, -4.3711384e-06, 99.99999, 0, -99.99999, -4.3711384e-06, 0, 0, 0)
|
transform = Transform3D(100, 0, 0, 0, -4.3711384e-06, 99.99999, 0, -99.99999, -4.3711384e-06, 0, 0, 0)
|
||||||
cast_shadow = 3
|
cast_shadow = 3
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@ material_override = ExtResource("4_8rfui")
|
|||||||
cast_shadow = 0
|
cast_shadow = 0
|
||||||
multimesh = SubResource("MultiMesh_8rfui")
|
multimesh = SubResource("MultiMesh_8rfui")
|
||||||
|
|
||||||
[node name="tree" parent="." index="1" unique_id=1483228573]
|
[node name="tree" parent="." index="1" unique_id=2124791569]
|
||||||
material_overlay = SubResource("ShaderMaterial_kpc41")
|
material_overlay = SubResource("ShaderMaterial_kpc41")
|
||||||
surface_material_override/0 = ExtResource("3_imfiy")
|
surface_material_override/0 = ExtResource("3_imfiy")
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -40,7 +40,7 @@ buffer = PackedFloat32Array(3.9456527e-08, -0.6345529, 0.77417296, 8.223151, -1.
|
|||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_xfgwo"]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_xfgwo"]
|
||||||
size = Vector3(20, 10, 20)
|
size = Vector3(20, 10, 20)
|
||||||
|
|
||||||
[node name="chunk_railway_curve" unique_id=238887300 node_paths=PackedStringArray("connection_left", "connection_right") instance=ExtResource("1_r0w7x")]
|
[node name="chunk_railway_curve" unique_id=238887300 groups=["weather_node"] node_paths=PackedStringArray("connection_left", "connection_right") instance=ExtResource("1_r0w7x")]
|
||||||
script = ExtResource("2_nebt2")
|
script = ExtResource("2_nebt2")
|
||||||
chunk_type = 2
|
chunk_type = 2
|
||||||
have_lamppost = true
|
have_lamppost = true
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ shader_parameter/random_mix = 0.0
|
|||||||
shader_parameter/cast_shadow_strength = 0.0
|
shader_parameter/cast_shadow_strength = 0.0
|
||||||
shader_parameter/wetness_darkening = 0.25
|
shader_parameter/wetness_darkening = 0.25
|
||||||
|
|
||||||
[node name="chunk_railway_curve" unique_id=238887300 node_paths=PackedStringArray("connection_left", "connection_right") instance=ExtResource("1_5qkha")]
|
[node name="chunk_railway_curve" unique_id=238887300 groups=["weather_node"] node_paths=PackedStringArray("connection_left", "connection_right") instance=ExtResource("1_5qkha")]
|
||||||
script = ExtResource("2_ebdep")
|
script = ExtResource("2_ebdep")
|
||||||
chunk_type = 2
|
chunk_type = 2
|
||||||
have_lamppost = true
|
have_lamppost = true
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ buffer = PackedFloat32Array(0, 0, -1.001, -9.885065, -1.001, 1.1534962e-07, 0, -
|
|||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_nij0i"]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_nij0i"]
|
||||||
size = Vector3(20, 10, 20)
|
size = Vector3(20, 10, 20)
|
||||||
|
|
||||||
[node name="chunk_railway_station_doubleside" unique_id=1591869611 instance=ExtResource("1_nkssc")]
|
[node name="chunk_railway_station_doubleside" unique_id=1591869611 groups=["weather_node"] instance=ExtResource("1_nkssc")]
|
||||||
script = ExtResource("2_i3rfy")
|
script = ExtResource("2_i3rfy")
|
||||||
chunk_type = 1
|
chunk_type = 1
|
||||||
est = true
|
est = true
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ buffer = PackedFloat32Array(0, 0, -1.001, 7.610373, -1.001, 7.557342e-08, 0, -2.
|
|||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_60nuv"]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_60nuv"]
|
||||||
size = Vector3(20, 10, 20)
|
size = Vector3(20, 10, 20)
|
||||||
|
|
||||||
[node name="chunk_railway_station_oneside" unique_id=310632835 node_paths=PackedStringArray("connection_left", "connection_right") instance=ExtResource("1_38ujo")]
|
[node name="chunk_railway_station_oneside" unique_id=310632835 groups=["weather_node"] node_paths=PackedStringArray("connection_left", "connection_right") instance=ExtResource("1_38ujo")]
|
||||||
script = ExtResource("2_a8mxs")
|
script = ExtResource("2_a8mxs")
|
||||||
chunk_type = 1
|
chunk_type = 1
|
||||||
west = true
|
west = true
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ buffer = PackedFloat32Array(0, 0, 1.001, -7.3240447, -1.001, -1.6308361e-07, 0,
|
|||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_jordb"]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_jordb"]
|
||||||
size = Vector3(20, 10, 20)
|
size = Vector3(20, 10, 20)
|
||||||
|
|
||||||
[node name="chunk_railway_straight" unique_id=1509029322 node_paths=PackedStringArray("connection_left", "connection_right") instance=ExtResource("1_koika")]
|
[node name="chunk_railway_straight" unique_id=1509029322 groups=["weather_node"] node_paths=PackedStringArray("connection_left", "connection_right") instance=ExtResource("1_koika")]
|
||||||
script = ExtResource("2_25ann")
|
script = ExtResource("2_25ann")
|
||||||
chunk_type = 1
|
chunk_type = 1
|
||||||
have_lamppost = true
|
have_lamppost = true
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ buffer = PackedFloat32Array(0, 0, 1.001, 9.632912, -1.001, -1.6308361e-07, 0, -1
|
|||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_hj62k"]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_hj62k"]
|
||||||
size = Vector3(20, 10, 20)
|
size = Vector3(20, 10, 20)
|
||||||
|
|
||||||
[node name="chunk_railway_straight_2" unique_id=476549215 instance=ExtResource("1_g8fwq")]
|
[node name="chunk_railway_straight_2" unique_id=476549215 groups=["weather_node"] instance=ExtResource("1_g8fwq")]
|
||||||
script = ExtResource("2_5gtba")
|
script = ExtResource("2_5gtba")
|
||||||
chunk_type = 1
|
chunk_type = 1
|
||||||
est = true
|
est = true
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ buffer = PackedFloat32Array(0.2749959, -2.0141332e-08, -0.96248555, -5.003987, -
|
|||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_fx2d1"]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_fx2d1"]
|
||||||
size = Vector3(20, 10, 20)
|
size = Vector3(20, 10, 20)
|
||||||
|
|
||||||
[node name="chunk_railway_straight_3" unique_id=1086786013 instance=ExtResource("1_k6h6t")]
|
[node name="chunk_railway_straight_3" unique_id=1086786013 groups=["weather_node"] instance=ExtResource("1_k6h6t")]
|
||||||
script = ExtResource("2_3rloo")
|
script = ExtResource("2_3rloo")
|
||||||
chunk_type = 1
|
chunk_type = 1
|
||||||
river_est = true
|
river_est = true
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ buffer = PackedFloat32Array(0.55643237, 8.195835e-08, 0.8320963, -5.862966, -0.8
|
|||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_56q8g"]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_56q8g"]
|
||||||
size = Vector3(20, 10, 20)
|
size = Vector3(20, 10, 20)
|
||||||
|
|
||||||
[node name="chunk_railway_straight_bridge" unique_id=1049036234 node_paths=PackedStringArray("connection_left", "connection_right") instance=ExtResource("1_bwiif")]
|
[node name="chunk_railway_straight_bridge" unique_id=1049036234 groups=["weather_node"] node_paths=PackedStringArray("connection_left", "connection_right") instance=ExtResource("1_bwiif")]
|
||||||
script = ExtResource("1_uoylj")
|
script = ExtResource("1_uoylj")
|
||||||
chunk_type = 1
|
chunk_type = 1
|
||||||
est = true
|
est = true
|
||||||
|
|||||||
@@ -108,31 +108,31 @@ west = true
|
|||||||
river_north = true
|
river_north = true
|
||||||
river_south = true
|
river_south = true
|
||||||
|
|
||||||
[node name="Argini_F_003" parent="." index="0" unique_id=1943456620]
|
[node name="Argini_F_003" parent="." index="0" unique_id=1480268542]
|
||||||
surface_material_override/0 = ExtResource("2_wqn5s")
|
surface_material_override/0 = ExtResource("2_wqn5s")
|
||||||
|
|
||||||
[node name="Flower_021" parent="." index="1" unique_id=1248562513]
|
[node name="Flower_021" parent="." index="1" unique_id=2125433847]
|
||||||
visible = false
|
visible = false
|
||||||
|
|
||||||
[node name="FlowerG_020" parent="." index="2" unique_id=522984193]
|
[node name="FlowerG_020" parent="." index="2" unique_id=588074656]
|
||||||
visible = false
|
visible = false
|
||||||
|
|
||||||
[node name="MSH_Staccioanta_1_019" parent="." index="3" unique_id=712328040]
|
[node name="MSH_Staccioanta_1_019" parent="." index="3" unique_id=1959253560]
|
||||||
surface_material_override/0 = ExtResource("3_amhor")
|
surface_material_override/0 = ExtResource("3_amhor")
|
||||||
|
|
||||||
[node name="Strada_011" parent="." index="4" unique_id=1636902357]
|
[node name="Strada_011" parent="." index="4" unique_id=651344270 groups=["weather_node"]]
|
||||||
surface_material_override/0 = ExtResource("4_amhor")
|
surface_material_override/0 = ExtResource("4_amhor")
|
||||||
|
|
||||||
[node name="Water_F_003" parent="." index="5" unique_id=1352549891]
|
[node name="Water_F_003" parent="." index="5" unique_id=1436454617]
|
||||||
surface_material_override/0 = ExtResource("6_es1d0")
|
surface_material_override/0 = ExtResource("6_es1d0")
|
||||||
|
|
||||||
[node name="bridge" parent="." index="6" unique_id=283522162]
|
[node name="bridge" parent="." index="6" unique_id=780103758 groups=["weather_node"]]
|
||||||
surface_material_override/0 = ExtResource("6_062h7")
|
surface_material_override/0 = ExtResource("6_062h7")
|
||||||
surface_material_override/1 = SubResource("ShaderMaterial_0snf2")
|
surface_material_override/1 = SubResource("ShaderMaterial_0snf2")
|
||||||
surface_material_override/2 = ExtResource("8_0snf2")
|
surface_material_override/2 = ExtResource("8_0snf2")
|
||||||
surface_material_override/3 = SubResource("ShaderMaterial_i6s7h")
|
surface_material_override/3 = SubResource("ShaderMaterial_i6s7h")
|
||||||
|
|
||||||
[node name="grass" parent="." index="7" unique_id=863206516]
|
[node name="grass" parent="." index="7" unique_id=995119855]
|
||||||
surface_material_override/0 = ExtResource("2_wqn5s")
|
surface_material_override/0 = ExtResource("2_wqn5s")
|
||||||
|
|
||||||
[node name="grass2" type="Node3D" parent="." index="8" unique_id=1023384553 groups=["weather_vegetables_node", "wind_node"]]
|
[node name="grass2" type="Node3D" parent="." index="8" unique_id=1023384553 groups=["weather_vegetables_node", "wind_node"]]
|
||||||
@@ -185,7 +185,7 @@ material_override = ExtResource("9_m21ki")
|
|||||||
cast_shadow = 0
|
cast_shadow = 0
|
||||||
multimesh = SubResource("MultiMesh_2tw0t")
|
multimesh = SubResource("MultiMesh_2tw0t")
|
||||||
|
|
||||||
[node name="Bambu" type="Node3D" parent="." index="10" unique_id=1893888958]
|
[node name="Bambu" type="Node3D" parent="." index="10" unique_id=1893888958 groups=["weather_vegetables_node", "wind_node"]]
|
||||||
|
|
||||||
[node name="Bambù" parent="Bambu" index="0" unique_id=514636059 instance=ExtResource("10_fenj0")]
|
[node name="Bambù" parent="Bambu" index="0" unique_id=514636059 instance=ExtResource("10_fenj0")]
|
||||||
transform = Transform3D(0.99893546, 0.04613013, 0, -0.046085197, 0.9979625, 0.044125047, 0.002035494, -0.044078074, 0.999026, 9.461747, 0, -3.4025283)
|
transform = Transform3D(0.99893546, 0.04613013, 0, -0.046085197, 0.9979625, 0.044125047, 0.002035494, -0.044078074, 0.999026, 9.461747, 0, -3.4025283)
|
||||||
|
|||||||
@@ -51,19 +51,19 @@ script = ExtResource("2_bmrw7")
|
|||||||
river_south = true
|
river_south = true
|
||||||
river_west = true
|
river_west = true
|
||||||
|
|
||||||
[node name="Argini_009" parent="." index="0" unique_id=650454440]
|
[node name="Argini_009" parent="." index="0" unique_id=935781577]
|
||||||
surface_material_override/0 = ExtResource("2_x8fyt")
|
surface_material_override/0 = ExtResource("2_x8fyt")
|
||||||
|
|
||||||
[node name="Argini_F_001" parent="." index="1" unique_id=1709224433]
|
[node name="Argini_F_001" parent="." index="1" unique_id=1677324626]
|
||||||
surface_material_override/0 = ExtResource("2_x8fyt")
|
surface_material_override/0 = ExtResource("2_x8fyt")
|
||||||
|
|
||||||
[node name="Chunk_017" parent="." index="2" unique_id=1001158626]
|
[node name="Chunk_017" parent="." index="2" unique_id=677601716]
|
||||||
surface_material_override/0 = ExtResource("2_x8fyt")
|
surface_material_override/0 = ExtResource("2_x8fyt")
|
||||||
|
|
||||||
[node name="Water_010" parent="." index="3" unique_id=822678307]
|
[node name="Water_010" parent="." index="3" unique_id=273066291]
|
||||||
surface_material_override/0 = ExtResource("3_bmrw7")
|
surface_material_override/0 = ExtResource("3_bmrw7")
|
||||||
|
|
||||||
[node name="Water_F_001" parent="." index="4" unique_id=1952113981]
|
[node name="Water_F_001" parent="." index="4" unique_id=1939449230]
|
||||||
surface_material_override/0 = ExtResource("5_wcs53")
|
surface_material_override/0 = ExtResource("5_wcs53")
|
||||||
|
|
||||||
[node name="grass" type="Node3D" parent="." index="5" unique_id=91576374 groups=["weather_vegetables_node", "wind_node"]]
|
[node name="grass" type="Node3D" parent="." index="5" unique_id=91576374 groups=["weather_vegetables_node", "wind_node"]]
|
||||||
|
|||||||
@@ -53,25 +53,25 @@ size = Vector2(1, 1)
|
|||||||
script = ExtResource("2_kvbtp")
|
script = ExtResource("2_kvbtp")
|
||||||
river_north = true
|
river_north = true
|
||||||
|
|
||||||
[node name="Argini_018" parent="." index="0" unique_id=798153780]
|
[node name="Argini_018" parent="." index="0" unique_id=1877504536]
|
||||||
surface_material_override/0 = ExtResource("3_4mfxv")
|
surface_material_override/0 = ExtResource("3_4mfxv")
|
||||||
|
|
||||||
[node name="Argini_F_002" parent="." index="1" unique_id=224286275]
|
[node name="Argini_F_002" parent="." index="1" unique_id=1630210022]
|
||||||
surface_material_override/0 = ExtResource("3_4mfxv")
|
surface_material_override/0 = ExtResource("3_4mfxv")
|
||||||
|
|
||||||
[node name="Cube_034" parent="." index="2" unique_id=763901855]
|
[node name="Cube_034" parent="." index="2" unique_id=536917094]
|
||||||
surface_material_override/0 = ExtResource("4_w8tpk")
|
surface_material_override/0 = ExtResource("4_w8tpk")
|
||||||
|
|
||||||
[node name="Grass_020" parent="." index="3" unique_id=1008856994]
|
[node name="Grass_020" parent="." index="3" unique_id=228303770]
|
||||||
surface_material_override/0 = ExtResource("3_4mfxv")
|
surface_material_override/0 = ExtResource("3_4mfxv")
|
||||||
|
|
||||||
[node name="MSH_Staccioanta_1_021" parent="." index="4" unique_id=1790761410]
|
[node name="MSH_Staccioanta_1_021" parent="." index="4" unique_id=777398218]
|
||||||
surface_material_override/0 = ExtResource("5_i0i0i")
|
surface_material_override/0 = ExtResource("5_i0i0i")
|
||||||
|
|
||||||
[node name="Water_019" parent="." index="5" unique_id=1519616413]
|
[node name="Water_019" parent="." index="5" unique_id=726411103]
|
||||||
surface_material_override/0 = ExtResource("6_tf5mu")
|
surface_material_override/0 = ExtResource("6_tf5mu")
|
||||||
|
|
||||||
[node name="Water_F_002" parent="." index="6" unique_id=903800211]
|
[node name="Water_F_002" parent="." index="6" unique_id=1656129705]
|
||||||
surface_material_override/0 = ExtResource("7_w3iym")
|
surface_material_override/0 = ExtResource("7_w3iym")
|
||||||
|
|
||||||
[node name="grass2" type="Node3D" parent="." index="7" unique_id=1169806788 groups=["weather_vegetables_node", "wind_node"]]
|
[node name="grass2" type="Node3D" parent="." index="7" unique_id=1169806788 groups=["weather_vegetables_node", "wind_node"]]
|
||||||
|
|||||||
@@ -87,56 +87,60 @@ script = ExtResource("2_8ueaj")
|
|||||||
west = true
|
west = true
|
||||||
river_south = true
|
river_south = true
|
||||||
|
|
||||||
[node name="Argini_013" parent="." index="0" unique_id=1870487458]
|
[node name="Argini_013" parent="." index="0" unique_id=1843791596]
|
||||||
surface_material_override/0 = ExtResource("3_oqr18")
|
surface_material_override/0 = ExtResource("3_oqr18")
|
||||||
|
|
||||||
[node name="Argini_F_005" parent="." index="1" unique_id=1126095130]
|
[node name="Argini_F_005" parent="." index="1" unique_id=582785221]
|
||||||
surface_material_override/0 = ExtResource("3_oqr18")
|
surface_material_override/0 = ExtResource("3_oqr18")
|
||||||
|
|
||||||
[node name="Cavi_008" parent="." index="3" unique_id=613985618]
|
[node name="Cart_003" parent="." index="2" unique_id=311439268 groups=["weather_node"]]
|
||||||
|
|
||||||
|
[node name="Cavi_008" parent="." index="3" unique_id=1909926940]
|
||||||
surface_material_override/0 = ExtResource("4_h5fgh")
|
surface_material_override/0 = ExtResource("4_h5fgh")
|
||||||
surface_material_override/1 = ExtResource("4_h5fgh")
|
surface_material_override/1 = ExtResource("4_h5fgh")
|
||||||
|
|
||||||
[node name="Cortile_006" parent="." index="4" unique_id=1701095883]
|
[node name="Cortile_006" parent="." index="4" unique_id=148752356]
|
||||||
surface_material_override/0 = ExtResource("5_5r0cx")
|
surface_material_override/0 = ExtResource("5_5r0cx")
|
||||||
|
|
||||||
[node name="Cube_036" parent="." index="5" unique_id=672869904]
|
[node name="Cube_036" parent="." index="5" unique_id=1290455108]
|
||||||
surface_material_override/0 = ExtResource("6_wdn0q")
|
surface_material_override/0 = ExtResource("6_wdn0q")
|
||||||
|
|
||||||
[node name="Flower_012" parent="." index="6" unique_id=2051395944]
|
[node name="Flower_012" parent="." index="6" unique_id=1926855227]
|
||||||
visible = false
|
visible = false
|
||||||
|
|
||||||
[node name="FlowerG_011" parent="." index="7" unique_id=1394853760]
|
[node name="FlowerG_011" parent="." index="7" unique_id=234619118]
|
||||||
visible = false
|
visible = false
|
||||||
|
|
||||||
[node name="Grass_016" parent="." index="8" unique_id=1019594918]
|
[node name="Grass_016" parent="." index="8" unique_id=114005812]
|
||||||
surface_material_override/0 = ExtResource("3_oqr18")
|
surface_material_override/0 = ExtResource("3_oqr18")
|
||||||
|
|
||||||
[node name="House_M_3_001|Cube_212|Dupli|" parent="House_M_3_001" parent_id_path=PackedInt32Array(2053098324) index="0" unique_id=1484776379]
|
[node name="House_M_3_001" parent="." index="9" unique_id=6044761 groups=["weather_node"]]
|
||||||
|
|
||||||
|
[node name="House_M_3_001|Cube_212|Dupli|" parent="House_M_3_001" index="0" unique_id=1860507976]
|
||||||
surface_material_override/0 = ExtResource("7_h5fgh")
|
surface_material_override/0 = ExtResource("7_h5fgh")
|
||||||
surface_material_override/1 = ExtResource("8_5r0cx")
|
surface_material_override/1 = ExtResource("8_5r0cx")
|
||||||
|
|
||||||
[node name="Lanterne_008" parent="." index="10" unique_id=2140482727]
|
[node name="Lanterne_008" parent="." index="10" unique_id=2056781625]
|
||||||
surface_material_override/0 = ExtResource("8_5r0cx")
|
surface_material_override/0 = ExtResource("8_5r0cx")
|
||||||
surface_material_override/1 = ExtResource("7_h5fgh")
|
surface_material_override/1 = ExtResource("7_h5fgh")
|
||||||
|
|
||||||
[node name="MSH_Staccioanta_1_013" parent="." index="11" unique_id=1624527004]
|
[node name="MSH_Staccioanta_1_013" parent="." index="11" unique_id=1642530430]
|
||||||
surface_material_override/0 = ExtResource("9_kfusd")
|
surface_material_override/0 = ExtResource("9_kfusd")
|
||||||
|
|
||||||
[node name="PaliLuci_006" parent="." index="12" unique_id=604291129]
|
[node name="PaliLuci_006" parent="." index="12" unique_id=232961267]
|
||||||
surface_material_override/0 = ExtResource("10_3krle")
|
surface_material_override/0 = ExtResource("10_3krle")
|
||||||
surface_material_override/1 = ExtResource("10_3krle")
|
surface_material_override/1 = ExtResource("10_3krle")
|
||||||
|
|
||||||
[node name="Panchina_001" parent="." index="13" unique_id=1738965733]
|
[node name="Panchina_001" parent="." index="13" unique_id=72973576 groups=["weather_node"]]
|
||||||
surface_material_override/0 = ExtResource("10_3krle")
|
surface_material_override/0 = ExtResource("10_3krle")
|
||||||
|
|
||||||
[node name="Strada_012" parent="." index="14" unique_id=809715190]
|
[node name="Strada_012" parent="." index="14" unique_id=493735262 groups=["weather_node"]]
|
||||||
surface_material_override/0 = ExtResource("5_5r0cx")
|
surface_material_override/0 = ExtResource("5_5r0cx")
|
||||||
|
|
||||||
[node name="Water_014" parent="." index="15" unique_id=1068824614]
|
[node name="Water_014" parent="." index="15" unique_id=1232138158]
|
||||||
surface_material_override/0 = ExtResource("11_3krle")
|
surface_material_override/0 = ExtResource("11_3krle")
|
||||||
|
|
||||||
[node name="Water_F_005" parent="." index="16" unique_id=607663394]
|
[node name="Water_F_005" parent="." index="16" unique_id=1247573710]
|
||||||
surface_material_override/0 = ExtResource("12_nfiu6")
|
surface_material_override/0 = ExtResource("12_nfiu6")
|
||||||
|
|
||||||
[node name="grass" type="Node3D" parent="." index="17" unique_id=64319559 groups=["weather_vegetables_node", "wind_node"]]
|
[node name="grass" type="Node3D" parent="." index="17" unique_id=64319559 groups=["weather_vegetables_node", "wind_node"]]
|
||||||
|
|||||||
@@ -75,36 +75,36 @@ script = ExtResource("2_6ts01")
|
|||||||
west = true
|
west = true
|
||||||
river_north = true
|
river_north = true
|
||||||
|
|
||||||
[node name="Argini_014" parent="." index="0" unique_id=1144332199]
|
[node name="Argini_014" parent="." index="0" unique_id=1594457990]
|
||||||
surface_material_override/0 = ExtResource("2_6cke1")
|
surface_material_override/0 = ExtResource("2_6cke1")
|
||||||
surface_material_override/1 = ExtResource("2_6cke1")
|
surface_material_override/1 = ExtResource("2_6cke1")
|
||||||
|
|
||||||
[node name="Argini_F_007" parent="." index="1" unique_id=1754711084]
|
[node name="Argini_F_007" parent="." index="1" unique_id=987117353]
|
||||||
surface_material_override/0 = ExtResource("2_6cke1")
|
surface_material_override/0 = ExtResource("2_6cke1")
|
||||||
|
|
||||||
[node name="Chunk_024" parent="." index="2" unique_id=1720184777]
|
[node name="Chunk_024" parent="." index="2" unique_id=1981797526]
|
||||||
surface_material_override/0 = ExtResource("2_6cke1")
|
surface_material_override/0 = ExtResource("2_6cke1")
|
||||||
|
|
||||||
[node name="Chunk_033" parent="." index="3" unique_id=1628229952]
|
[node name="Chunk_033" parent="." index="3" unique_id=540804286]
|
||||||
surface_material_override/0 = ExtResource("3_dxc7w")
|
surface_material_override/0 = ExtResource("3_dxc7w")
|
||||||
|
|
||||||
[node name="Cube_038" parent="." index="4" unique_id=2039579000]
|
[node name="Cube_038" parent="." index="4" unique_id=1304238242 groups=["weather_node"]]
|
||||||
surface_material_override/0 = ExtResource("4_wiylo")
|
surface_material_override/0 = ExtResource("4_wiylo")
|
||||||
|
|
||||||
[node name="Flower_013" parent="." index="5" unique_id=1366790519]
|
[node name="Flower_013" parent="." index="5" unique_id=794398748]
|
||||||
visible = false
|
visible = false
|
||||||
|
|
||||||
[node name="FlowerG_012" parent="." index="6" unique_id=73383829]
|
[node name="FlowerG_012" parent="." index="6" unique_id=810367425]
|
||||||
visible = false
|
visible = false
|
||||||
|
|
||||||
[node name="MSH_Staccioanta_1_014" parent="." index="7" unique_id=1893629780]
|
[node name="MSH_Staccioanta_1_014" parent="." index="7" unique_id=965987551]
|
||||||
surface_material_override/0 = ExtResource("5_scsij")
|
surface_material_override/0 = ExtResource("5_scsij")
|
||||||
|
|
||||||
[node name="Water_015" parent="." index="8" unique_id=1485337117]
|
[node name="Water_015" parent="." index="8" unique_id=596373854]
|
||||||
surface_material_override/0 = ExtResource("6_6ts01")
|
surface_material_override/0 = ExtResource("6_6ts01")
|
||||||
surface_material_override/1 = ExtResource("6_6ts01")
|
surface_material_override/1 = ExtResource("6_6ts01")
|
||||||
|
|
||||||
[node name="Water_F_007" parent="." index="9" unique_id=1341709621]
|
[node name="Water_F_007" parent="." index="9" unique_id=315436041]
|
||||||
surface_material_override/0 = ExtResource("8_rc623")
|
surface_material_override/0 = ExtResource("8_rc623")
|
||||||
|
|
||||||
[node name="grass" type="Node3D" parent="." index="10" unique_id=970290101 groups=["weather_vegetables_node", "wind_node"]]
|
[node name="grass" type="Node3D" parent="." index="10" unique_id=970290101 groups=["weather_vegetables_node", "wind_node"]]
|
||||||
@@ -717,7 +717,7 @@ cast_shadow = 0
|
|||||||
mesh = SubResource("PlaneMesh_gbwoc")
|
mesh = SubResource("PlaneMesh_gbwoc")
|
||||||
surface_material_override/0 = ExtResource("5_wiylo")
|
surface_material_override/0 = ExtResource("5_wiylo")
|
||||||
|
|
||||||
[node name="Bambu" type="Node3D" parent="." index="13" unique_id=1744420008]
|
[node name="Bambu" type="Node3D" parent="." index="13" unique_id=1744420008 groups=["weather_vegetables_node", "wind_node"]]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 25.91278, 0, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 25.91278, 0, 0)
|
||||||
|
|
||||||
[node name="Bambù15" parent="Bambu" index="0" unique_id=483033916 instance=ExtResource("9_fbq43")]
|
[node name="Bambù15" parent="Bambu" index="0" unique_id=483033916 instance=ExtResource("9_fbq43")]
|
||||||
|
|||||||
@@ -73,45 +73,49 @@ est = true
|
|||||||
south = true
|
south = true
|
||||||
river_west = true
|
river_west = true
|
||||||
|
|
||||||
[node name="Argini_F_010" parent="." index="0" unique_id=465659850]
|
[node name="Argini_F_010" parent="." index="0" unique_id=570570760]
|
||||||
surface_material_override/0 = ExtResource("2_js6cw")
|
surface_material_override/0 = ExtResource("2_js6cw")
|
||||||
|
|
||||||
[node name="Cavi_009" parent="." index="1" unique_id=1083143600]
|
[node name="Cavi_009" parent="." index="1" unique_id=1773824101]
|
||||||
surface_material_override/0 = ExtResource("3_8s23f")
|
surface_material_override/0 = ExtResource("3_8s23f")
|
||||||
surface_material_override/1 = ExtResource("3_8s23f")
|
surface_material_override/1 = ExtResource("3_8s23f")
|
||||||
|
|
||||||
[node name="Cube_044" parent="." index="2" unique_id=1074625311]
|
[node name="Cube_044" parent="." index="2" unique_id=1674825184 groups=["weather_node"]]
|
||||||
surface_material_override/0 = ExtResource("4_4oehn")
|
surface_material_override/0 = ExtResource("4_4oehn")
|
||||||
|
|
||||||
[node name="Flower_015" parent="." index="3" unique_id=237452355]
|
[node name="Flower_015" parent="." index="3" unique_id=726745390]
|
||||||
visible = false
|
visible = false
|
||||||
|
|
||||||
[node name="FlowerG_013" parent="." index="4" unique_id=612907917]
|
[node name="FlowerG_013" parent="." index="4" unique_id=2134918644]
|
||||||
visible = false
|
visible = false
|
||||||
|
|
||||||
[node name="Grass_018" parent="." index="5" unique_id=1699521721]
|
[node name="Grass_018" parent="." index="5" unique_id=746329037]
|
||||||
surface_material_override/0 = ExtResource("2_js6cw")
|
surface_material_override/0 = ExtResource("2_js6cw")
|
||||||
|
|
||||||
[node name="House_C_1_010|Cube_330|Dupli|" parent="House_C_1_010" parent_id_path=PackedInt32Array(1377410594) index="0" unique_id=1906771548]
|
[node name="House_C_1_010" parent="." index="6" unique_id=1285140680 groups=["weather_node"]]
|
||||||
|
|
||||||
|
[node name="House_C_1_010|Cube_330|Dupli|" parent="House_C_1_010" index="0" unique_id=2056261753]
|
||||||
surface_material_override/0 = ExtResource("5_471jd")
|
surface_material_override/0 = ExtResource("5_471jd")
|
||||||
surface_material_override/1 = ExtResource("6_wwyrs")
|
surface_material_override/1 = ExtResource("6_wwyrs")
|
||||||
|
|
||||||
[node name="House_C_1_011|Cube_330|Dupli|" parent="House_C_1_011" parent_id_path=PackedInt32Array(381470710) index="0" unique_id=758032673]
|
[node name="House_C_1_011" parent="." index="7" unique_id=1413801634 groups=["weather_node"]]
|
||||||
|
|
||||||
|
[node name="House_C_1_011|Cube_330|Dupli|" parent="House_C_1_011" index="0" unique_id=1638321395]
|
||||||
surface_material_override/0 = ExtResource("5_471jd")
|
surface_material_override/0 = ExtResource("5_471jd")
|
||||||
surface_material_override/1 = ExtResource("6_wwyrs")
|
surface_material_override/1 = ExtResource("6_wwyrs")
|
||||||
|
|
||||||
[node name="Lanterne_009" parent="." index="8" unique_id=643151751]
|
[node name="Lanterne_009" parent="." index="8" unique_id=1499773616]
|
||||||
surface_material_override/0 = ExtResource("6_wwyrs")
|
surface_material_override/0 = ExtResource("6_wwyrs")
|
||||||
surface_material_override/1 = ExtResource("5_471jd")
|
surface_material_override/1 = ExtResource("5_471jd")
|
||||||
|
|
||||||
[node name="MSH_Staccioanta_1_016" parent="." index="9" unique_id=1505741880]
|
[node name="MSH_Staccioanta_1_016" parent="." index="9" unique_id=1184159133]
|
||||||
surface_material_override/0 = ExtResource("7_i7crw")
|
surface_material_override/0 = ExtResource("7_i7crw")
|
||||||
|
|
||||||
[node name="PaliLuci_007" parent="." index="10" unique_id=138242778]
|
[node name="PaliLuci_007" parent="." index="10" unique_id=103133870]
|
||||||
surface_material_override/0 = ExtResource("8_dwkbu")
|
surface_material_override/0 = ExtResource("8_dwkbu")
|
||||||
surface_material_override/1 = ExtResource("7_i7crw")
|
surface_material_override/1 = ExtResource("7_i7crw")
|
||||||
|
|
||||||
[node name="Strada_014" parent="." index="11" unique_id=1837061207]
|
[node name="Strada_014" parent="." index="11" unique_id=132166129 groups=["weather_node"]]
|
||||||
surface_material_override/0 = ExtResource("9_qbooo")
|
surface_material_override/0 = ExtResource("9_qbooo")
|
||||||
|
|
||||||
[node name="grass" type="Node3D" parent="." index="12" unique_id=1609312469 groups=["weather_vegetables_node", "wind_node"]]
|
[node name="grass" type="Node3D" parent="." index="12" unique_id=1609312469 groups=["weather_vegetables_node", "wind_node"]]
|
||||||
@@ -310,5 +314,5 @@ shadow_opacity = 0.96
|
|||||||
omni_range = 10.0
|
omni_range = 10.0
|
||||||
omni_attenuation = 2.0
|
omni_attenuation = 2.0
|
||||||
|
|
||||||
[node name="Water_F_010" parent="." index="16" unique_id=1190276160]
|
[node name="Water_F_010" parent="." index="16" unique_id=1575540816]
|
||||||
surface_material_override/0 = ExtResource("17_tuv54")
|
surface_material_override/0 = ExtResource("17_tuv54")
|
||||||
|
|||||||
@@ -70,31 +70,31 @@ est = true
|
|||||||
river_south = true
|
river_south = true
|
||||||
river_west = true
|
river_west = true
|
||||||
|
|
||||||
[node name="Argini_016" parent="." index="0" unique_id=2109436536]
|
[node name="Argini_016" parent="." index="0" unique_id=1569700439]
|
||||||
surface_material_override/0 = ExtResource("3_jrxr5")
|
surface_material_override/0 = ExtResource("3_jrxr5")
|
||||||
|
|
||||||
[node name="Argini_F_011" parent="." index="1" unique_id=1501903033]
|
[node name="Argini_F_011" parent="." index="1" unique_id=746029105]
|
||||||
surface_material_override/0 = ExtResource("3_jrxr5")
|
surface_material_override/0 = ExtResource("3_jrxr5")
|
||||||
|
|
||||||
[node name="Chunk_019" parent="." index="2" unique_id=2048565985]
|
[node name="Chunk_019" parent="." index="2" unique_id=432366291]
|
||||||
surface_material_override/0 = ExtResource("3_jrxr5")
|
surface_material_override/0 = ExtResource("3_jrxr5")
|
||||||
|
|
||||||
[node name="Flower_017" parent="." index="3" unique_id=1701289870]
|
[node name="Flower_017" parent="." index="3" unique_id=1602823058]
|
||||||
visible = false
|
visible = false
|
||||||
|
|
||||||
[node name="FlowerG_014" parent="." index="4" unique_id=1473582000]
|
[node name="FlowerG_014" parent="." index="4" unique_id=1108572235]
|
||||||
visible = false
|
visible = false
|
||||||
|
|
||||||
[node name="MSH_Staccioanta_1_010" parent="." index="5" unique_id=1293236768]
|
[node name="MSH_Staccioanta_1_010" parent="." index="5" unique_id=1356459847]
|
||||||
surface_material_override/0 = ExtResource("4_br2wm")
|
surface_material_override/0 = ExtResource("4_br2wm")
|
||||||
|
|
||||||
[node name="Sentieri_002" parent="." index="6" unique_id=115567893]
|
[node name="Sentieri_002" parent="." index="6" unique_id=645670437 groups=["weather_node"]]
|
||||||
surface_material_override/0 = ExtResource("5_br2wm")
|
surface_material_override/0 = ExtResource("5_br2wm")
|
||||||
|
|
||||||
[node name="Water_017" parent="." index="7" unique_id=1815217646]
|
[node name="Water_017" parent="." index="7" unique_id=133111535]
|
||||||
surface_material_override/0 = ExtResource("6_nbmm4")
|
surface_material_override/0 = ExtResource("6_nbmm4")
|
||||||
|
|
||||||
[node name="Water_F_011" parent="." index="8" unique_id=299227028]
|
[node name="Water_F_011" parent="." index="8" unique_id=1907133028]
|
||||||
surface_material_override/0 = ExtResource("7_enote")
|
surface_material_override/0 = ExtResource("7_enote")
|
||||||
|
|
||||||
[node name="grass" type="Node3D" parent="." index="9" unique_id=1171398973 groups=["weather_vegetables_node", "wind_node"]]
|
[node name="grass" type="Node3D" parent="." index="9" unique_id=1171398973 groups=["weather_vegetables_node", "wind_node"]]
|
||||||
@@ -443,7 +443,7 @@ cast_shadow = 0
|
|||||||
mesh = SubResource("PlaneMesh_3o8wc")
|
mesh = SubResource("PlaneMesh_3o8wc")
|
||||||
surface_material_override/0 = ExtResource("7_omm55")
|
surface_material_override/0 = ExtResource("7_omm55")
|
||||||
|
|
||||||
[node name="Bambu" type="Node3D" parent="." index="12" unique_id=720397067]
|
[node name="Bambu" type="Node3D" parent="." index="12" unique_id=720397067 groups=["weather_vegetables_node", "wind_node"]]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 19.506226, 0, 11.726283)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 19.506226, 0, 11.726283)
|
||||||
|
|
||||||
[node name="Bambù15" parent="Bambu" index="0" unique_id=514636059 instance=ExtResource("11_ypskt")]
|
[node name="Bambù15" parent="Bambu" index="0" unique_id=514636059 instance=ExtResource("11_ypskt")]
|
||||||
|
|||||||
@@ -4,8 +4,7 @@
|
|||||||
[ext_resource type="Material" uid="uid://df1ghvw3d61x8" path="res://tgcc/train/train1.tres" id="2_crne2"]
|
[ext_resource type="Material" uid="uid://df1ghvw3d61x8" path="res://tgcc/train/train1.tres" id="2_crne2"]
|
||||||
[ext_resource type="Material" uid="uid://cufolpn48xxmv" path="res://tgcc/train/train2.tres" id="3_tf27f"]
|
[ext_resource type="Material" uid="uid://cufolpn48xxmv" path="res://tgcc/train/train2.tres" id="3_tf27f"]
|
||||||
[ext_resource type="Material" uid="uid://bu8wmlp0ffark" path="res://tgcc/train/train3.tres" id="4_e08y7"]
|
[ext_resource type="Material" uid="uid://bu8wmlp0ffark" path="res://tgcc/train/train3.tres" id="4_e08y7"]
|
||||||
|
[ext_resource type="Material" uid="uid://cn5vw7unbqgve" path="res://core/daynight/weather_overlay.tres" id="5_weather"]
|
||||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_tvivt"]
|
|
||||||
|
|
||||||
[sub_resource type="PlaneMesh" id="PlaneMesh_8k78i"]
|
[sub_resource type="PlaneMesh" id="PlaneMesh_8k78i"]
|
||||||
|
|
||||||
@@ -19,7 +18,7 @@ transform = Transform3D(-0.85, 0, -1.2834644e-07, 0, 0.85, 0, 1.2834644e-07, 0,
|
|||||||
|
|
||||||
[node name="polySurface3708_002" parent="." index="0" unique_id=1080693866]
|
[node name="polySurface3708_002" parent="." index="0" unique_id=1080693866]
|
||||||
transform = Transform3D(99.99998, 0, 0, 0, -4.3711375e-06, 99.99999, 0, -99.99997, -4.3711384e-06, 0, 1.5, 0)
|
transform = Transform3D(99.99998, 0, 0, 0, -4.3711375e-06, 99.99999, 0, -99.99997, -4.3711384e-06, 0, 1.5, 0)
|
||||||
material_overlay = SubResource("ShaderMaterial_tvivt")
|
material_overlay = ExtResource("5_weather")
|
||||||
surface_material_override/0 = ExtResource("2_crne2")
|
surface_material_override/0 = ExtResource("2_crne2")
|
||||||
surface_material_override/1 = ExtResource("3_tf27f")
|
surface_material_override/1 = ExtResource("3_tf27f")
|
||||||
surface_material_override/2 = ExtResource("2_crne2")
|
surface_material_override/2 = ExtResource("2_crne2")
|
||||||
|
|||||||
Reference in New Issue
Block a user