From 3d2bae03a51f8f96f0983af11ff7bfe693e7dbd9 Mon Sep 17 00:00:00 2001 From: tpart Date: Thu, 4 Jul 2024 10:05:04 +0200 Subject: Add setting to disable shadows --- client/map/auto_setup/environment_setup.gd | 27 +++++++++++++++++++++++++++ client/map/auto_setup/light_setup.gd | 24 ++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 client/map/auto_setup/environment_setup.gd create mode 100644 client/map/auto_setup/light_setup.gd (limited to 'client/map/auto_setup') diff --git a/client/map/auto_setup/environment_setup.gd b/client/map/auto_setup/environment_setup.gd new file mode 100644 index 00000000..f163588b --- /dev/null +++ b/client/map/auto_setup/environment_setup.gd @@ -0,0 +1,27 @@ +# 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 . +# +extends WorldEnvironment +class_name EnvironmentSetup + +@export var allow_sdfgi := true + +func _ready(): + apply_settings() + Global.settings_changed.connect(apply_settings) + +func apply_settings(): + environment.ssao_enabled = Global.get_setting("ssao") + environment.sdfgi_enabled = Global.get_setting("sdfgi") if allow_sdfgi else false diff --git a/client/map/auto_setup/light_setup.gd b/client/map/auto_setup/light_setup.gd new file mode 100644 index 00000000..c74fb5ee --- /dev/null +++ b/client/map/auto_setup/light_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 . +# +extends DirectionalLight3D +class_name LightSetup + +func _ready(): + apply_settings() + Global.settings_changed.connect(apply_settings) + +func apply_settings(): + shadow_enabled = Global.get_setting("shadows") -- cgit v1.2.3-70-g09d2