From 8ab921d5b4515bed1e3c681e24c7b2f3bc8ab420 Mon Sep 17 00:00:00 2001 From: Ryhon Date: Wed, 17 Jul 2024 14:49:27 +0200 Subject: [PATCH] Add FSR 2.2, exclusive fullscreen and ultra SSAO/SSIL to 3D Graphics Settings demo --- 3d/graphics_settings/control.tscn | 16 ++++++++++++---- 3d/graphics_settings/settings.gd | 19 ++++++++++++++++--- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/3d/graphics_settings/control.tscn b/3d/graphics_settings/control.tscn index e1f7e252..2f89440e 100644 --- a/3d/graphics_settings/control.tscn +++ b/3d/graphics_settings/control.tscn @@ -169,10 +169,12 @@ layout_mode = 2 size_flags_horizontal = 3 theme_override_font_sizes/font_size = 16 selected = 0 -item_count = 2 +item_count = 3 popup/item_0/text = "Bilinear (Fastest)" popup/item_1/text = "FSR 1.0 (Fast)" popup/item_1/id = 1 +popup/item_2/text = "FSR 2.2 (Slow)" +popup/item_2/id = 2 [node name="FSRSharpnessLabel" type="Label" parent="SettingsMenu/ScrollContainer/VBoxContainer/GridContainer2"] unique_name_in_owner = true @@ -203,10 +205,12 @@ layout_mode = 2 size_flags_horizontal = 3 theme_override_font_sizes/font_size = 16 selected = 0 -item_count = 2 +item_count = 3 popup/item_0/text = "Disabled" popup/item_1/text = "Enabled" popup/item_1/id = 1 +popup/item_2/text = "Exclusive" +popup/item_2/id = 2 [node name="VsyncLabel" type="Label" parent="SettingsMenu/ScrollContainer/VBoxContainer/GridContainer2"] layout_mode = 2 @@ -448,7 +452,7 @@ layout_mode = 2 size_flags_horizontal = 3 theme_override_font_sizes/font_size = 16 selected = 0 -item_count = 5 +item_count = 6 popup/item_0/text = "Disabled (Fastest)" popup/item_1/text = "Very Low (Fast)" popup/item_1/id = 1 @@ -458,6 +462,8 @@ popup/item_3/text = "Medium (Average)" popup/item_3/id = 3 popup/item_4/text = "High (Slow)" popup/item_4/id = 4 +popup/item_5/text = "Ultra (Slower)" +popup/item_5/id = 5 [node name="SSReflectionsLabel" type="Label" parent="SettingsMenu/ScrollContainer/VBoxContainer/Environment"] layout_mode = 2 @@ -492,7 +498,7 @@ layout_mode = 2 size_flags_horizontal = 3 theme_override_font_sizes/font_size = 16 selected = 0 -item_count = 5 +item_count = 6 popup/item_0/text = "Disabled (Fastest)" popup/item_1/text = "Very Low (Fast)" popup/item_1/id = 1 @@ -502,6 +508,8 @@ popup/item_3/text = "Medium (Slow)" popup/item_3/id = 3 popup/item_4/text = "High (Slower)" popup/item_4/id = 4 +popup/item_5/text = "Ultra (Slowest)" +popup/item_5/id = 5 [node name="VolumetricFogLabel" type="Label" parent="SettingsMenu/ScrollContainer/VBoxContainer/Environment"] layout_mode = 2 diff --git a/3d/graphics_settings/settings.gd b/3d/graphics_settings/settings.gd index b22f621c..60c64ed2 100644 --- a/3d/graphics_settings/settings.gd +++ b/3d/graphics_settings/settings.gd @@ -83,12 +83,17 @@ func _on_filter_option_button_item_selected(index: int) -> void: # Viewport scale mode setting. if index == 0: # Bilinear (Fastest) get_viewport().scaling_3d_mode = Viewport.SCALING_3D_MODE_BILINEAR - # FSR Sharpness is only effective when the scaling mode is FSR 1.0. + # FSR Sharpness is only effective when the scaling mode is FSR 1.0 or 2.2. %FSRSharpnessLabel.visible = false %FSRSharpnessSlider.visible = false elif index == 1: # FSR 1.0 (Fast) get_viewport().scaling_3d_mode = Viewport.SCALING_3D_MODE_FSR - # FSR Sharpness is only effective when the scaling mode is FSR 1.0. + # FSR Sharpness is only effective when the scaling mode is FSR 1.0 or 2.2. + %FSRSharpnessLabel.visible = true + %FSRSharpnessSlider.visible = true + elif index == 2: # FSR 2.2 (Fast) + get_viewport().scaling_3d_mode = Viewport.SCALING_3D_MODE_FSR2 + # FSR Sharpness is only effective when the scaling mode is FSR 1.0 or 2.2. %FSRSharpnessLabel.visible = true %FSRSharpnessSlider.visible = true @@ -259,13 +264,16 @@ func _on_ssao_option_button_item_selected(index: int) -> void: RenderingServer.environment_set_ssao_quality(RenderingServer.ENV_SSAO_QUALITY_VERY_LOW, true, 0.5, 2, 50, 300) if index == 2: # Low world_environment.environment.ssao_enabled = true - RenderingServer.environment_set_ssao_quality(RenderingServer.ENV_SSAO_QUALITY_VERY_LOW, true, 0.5, 2, 50, 300) + RenderingServer.environment_set_ssao_quality(RenderingServer.ENV_SSAO_QUALITY_LOW, true, 0.5, 2, 50, 300) if index == 3: # Medium world_environment.environment.ssao_enabled = true RenderingServer.environment_set_ssao_quality(RenderingServer.ENV_SSAO_QUALITY_MEDIUM, true, 0.5, 2, 50, 300) if index == 4: # High world_environment.environment.ssao_enabled = true RenderingServer.environment_set_ssao_quality(RenderingServer.ENV_SSAO_QUALITY_HIGH, true, 0.5, 2, 50, 300) + if index == 5: # Ultra + world_environment.environment.ssao_enabled = true + RenderingServer.environment_set_ssao_quality(RenderingServer.ENV_SSAO_QUALITY_ULTRA, true, 0.5, 2, 50, 300) func _on_ssil_option_button_item_selected(index: int) -> void: @@ -286,6 +294,9 @@ func _on_ssil_option_button_item_selected(index: int) -> void: if index == 4: # High world_environment.environment.ssil_enabled = true RenderingServer.environment_set_ssil_quality(RenderingServer.ENV_SSIL_QUALITY_HIGH, true, 0.5, 4, 50, 300) + if index == 5: # Ultra + world_environment.environment.ssil_enabled = true + RenderingServer.environment_set_ssil_quality(RenderingServer.ENV_SSIL_QUALITY_ULTRA, true, 0.5, 4, 50, 300) func _on_sdfgi_option_button_item_selected(index: int) -> void: @@ -310,8 +321,10 @@ func _on_glow_option_button_item_selected(index: int) -> void: world_environment.environment.glow_enabled = false if index == 1: # Low world_environment.environment.glow_enabled = true + RenderingServer.environment_glow_set_use_bicubic_upscale(false) if index == 2: # High world_environment.environment.glow_enabled = true + RenderingServer.environment_glow_set_use_bicubic_upscale(true) func _on_volumetric_fog_option_button_item_selected(index: int) -> void: