aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client/game.tscn4
-rw-r--r--client/global.gd5
-rw-r--r--client/map/environment_setup.gd24
3 files changed, 30 insertions, 3 deletions
diff --git a/client/game.tscn b/client/game.tscn
index 61370569..460cde3d 100644
--- a/client/game.tscn
+++ b/client/game.tscn
@@ -1,7 +1,8 @@
-[gd_scene load_steps=10 format=3 uid="uid://c6krh36hoqfg8"]
+[gd_scene load_steps=11 format=3 uid="uid://c6krh36hoqfg8"]
[ext_resource type="Script" path="res://game.gd" id="1_sftfn"]
[ext_resource type="PackedScene" uid="uid://b31mlnao6ybt8" path="res://player/follow_camera.tscn" id="2_s8y6o"]
+[ext_resource type="Script" path="res://map/environment_setup.gd" id="4_hixq3"]
[ext_resource type="PackedScene" uid="uid://c0euiv7duqfp4" path="res://player/marker.tscn" id="4_igl0o"]
[ext_resource type="Script" path="res://multiplayer.gd" id="6_fbxu8"]
[ext_resource type="PackedScene" uid="uid://b4gone8fu53r7" path="res://map/map.tscn" id="6_prg6t"]
@@ -35,6 +36,7 @@ target = NodePath("..")
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource("Environment_m4dli")
+script = ExtResource("4_hixq3")
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(-0.412548, 0.834939, -0.364255, 4.90703e-08, 0.399869, 0.916572, 0.910936, 0.37813, -0.164965, 0, 0, 0)
diff --git a/client/global.gd b/client/global.gd
index 50a27c89..db85a603 100644
--- a/client/global.gd
+++ b/client/global.gd
@@ -39,14 +39,15 @@ var languages := [tr("System default"), "en", "de"]
var default_settings := {
"language": DropdownSetting.new(tr("Language"), 0, languages),
- "aa": DropdownSetting.new(tr("Anti-aliasing"), 2, [tr("Disabled"), "FXAA", "MSAA 2x", "MSAA 4x"]),
- "taa": ToggleSetting.new(tr("Temporal Anti-Aliasing"), false),
"fullscreen": ToggleSetting.new(tr("Fullscreen"), false),
"touch_controls": ToggleSetting.new(tr("Enable touch screen conrols"), DisplayServer.is_touchscreen_available()),
"interpolate_camera_rotation": ToggleSetting.new(tr("Interpolate the camera rotation"), true),
"invert_camera": ToggleSetting.new(tr("Invert camera movement"), false),
"server_binary": TextSetting.new(tr("Server binary (leave empty to search PATH)"), "", "Enter path"),
"server_data": TextSetting.new(tr("Server data directory (leave empty to auto-detect)"), "", "Enter path"),
+ "aa": DropdownSetting.new(tr("Anti-aliasing"), 2, [tr("Disabled"), "FXAA", "MSAA 2x", "MSAA 4x"]),
+ "ssao": ToggleSetting.new(tr("Ambient occlusion"), true),
+ "taa": ToggleSetting.new(tr("Temporal Anti-Aliasing"), false),
"voxel_gi": ToggleSetting.new(tr("Use VoxelGI (Blocks the game on map update but is more accurate)"), false),
"sdfgi": ToggleSetting.new(tr("Use SDFGI (Doesn't block the game but produces more artifacts)"), false),
"debug_info": ToggleSetting.new(tr("Display debug info (Framerate, etc.)"), false),
diff --git a/client/map/environment_setup.gd b/client/map/environment_setup.gd
new file mode 100644
index 00000000..d6798944
--- /dev/null
+++ b/client/map/environment_setup.gd
@@ -0,0 +1,24 @@
+# Undercooked - a game about cooking
+# Copyright 2024 tpart
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, version 3 of the License only.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+#
+extends WorldEnvironment
+class_name EnvironmentSetup
+
+func _ready():
+ apply_settings()
+ Global.settings_changed.connect(apply_settings)
+
+func apply_settings():
+ environment.ssao_enabled = Global.get_setting("ssao")