Added quality presets
This commit is contained in:
parent
996cb7b6fd
commit
1d37fcd9fd
42
client/ui/settings/Preset.gd
Normal file
42
client/ui/settings/Preset.gd
Normal file
@ -0,0 +1,42 @@
|
||||
extends OptionButton
|
||||
|
||||
func on_item_selected(index: int):
|
||||
match index:
|
||||
0:
|
||||
preset_low()
|
||||
1:
|
||||
preset_medium()
|
||||
2:
|
||||
preset_high()
|
||||
|
||||
get_tree().call_group("video_preset_setting", "_ready")
|
||||
|
||||
func preset_low():
|
||||
get_viewport().scaling_3d_mode = Viewport.SCALING_3D_MODE_BILINEAR
|
||||
get_viewport().scaling_3d_scale = RenderScale.fsrQuality[4]
|
||||
Global.environment.glow_enabled = false
|
||||
Global.environment.ssao_enabled = false
|
||||
Global.environment.ssil_enabled = false
|
||||
Global.environment.volumetric_fog_enabled = false
|
||||
Global.camera_attributes.dof_blur_far_enabled = false
|
||||
Global.camera_attributes.dof_blur_near_enabled = false
|
||||
|
||||
func preset_medium():
|
||||
get_viewport().scaling_3d_mode = Viewport.SCALING_3D_MODE_FSR2
|
||||
get_viewport().scaling_3d_scale = RenderScale.fsrQuality[2]
|
||||
Global.environment.glow_enabled = true
|
||||
Global.environment.ssao_enabled = true
|
||||
Global.environment.ssil_enabled = false
|
||||
Global.environment.volumetric_fog_enabled = false
|
||||
Global.camera_attributes.dof_blur_far_enabled = false
|
||||
Global.camera_attributes.dof_blur_near_enabled = false
|
||||
|
||||
func preset_high():
|
||||
get_viewport().scaling_3d_mode = Viewport.SCALING_3D_MODE_FSR2
|
||||
get_viewport().scaling_3d_scale = RenderScale.fsrQuality[3]
|
||||
Global.environment.glow_enabled = true
|
||||
Global.environment.ssao_enabled = true
|
||||
Global.environment.ssil_enabled = true
|
||||
Global.environment.volumetric_fog_enabled = true
|
||||
Global.camera_attributes.dof_blur_far_enabled = true
|
||||
Global.camera_attributes.dof_blur_near_enabled = true
|
@ -1,6 +1,7 @@
|
||||
class_name RenderScale
|
||||
extends OptionButton
|
||||
|
||||
var fsrQuality: Array[float] = [0.50, 0.59, 0.67, 0.77, 1.0]
|
||||
static var fsrQuality: Array[float] = [0.50, 0.59, 0.67, 0.77, 1.0]
|
||||
|
||||
func _ready():
|
||||
var viewport_scale := get_viewport().scaling_3d_scale
|
||||
|
@ -1,9 +1,10 @@
|
||||
[gd_scene load_steps=12 format=3 uid="uid://bqpbrju7mc7d5"]
|
||||
[gd_scene load_steps=13 format=3 uid="uid://bqpbrju7mc7d5"]
|
||||
|
||||
[ext_resource type="Script" path="res://ui/settings/Settings.gd" id="1_gx3lf"]
|
||||
[ext_resource type="Script" path="res://ui/settings/Glow.gd" id="1_vkhbt"]
|
||||
[ext_resource type="Script" path="res://ui/settings/ScaleMode.gd" id="2_7a2hi"]
|
||||
[ext_resource type="Script" path="res://ui/label/ParentNameLabel.gd" id="2_72a3s"]
|
||||
[ext_resource type="Script" path="res://ui/settings/Preset.gd" id="3_6lki0"]
|
||||
[ext_resource type="Script" path="res://ui/settings/RenderScale.gd" id="3_o5ei3"]
|
||||
[ext_resource type="Script" path="res://ui/settings/DepthOfField.gd" id="5_kjasn"]
|
||||
[ext_resource type="Script" path="res://ui/settings/SSAO.gd" id="6_fu528"]
|
||||
@ -36,6 +37,29 @@ layout_mode = 2
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="TabContainer/Video"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Preset" type="HBoxContainer" parent="TabContainer/Video/VBoxContainer"]
|
||||
custom_minimum_size = Vector2(0, 32)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="TabContainer/Video/VBoxContainer/Preset"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Preset:"
|
||||
script = ExtResource("2_72a3s")
|
||||
|
||||
[node name="OptionButton" type="OptionButton" parent="TabContainer/Video/VBoxContainer/Preset"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
item_count = 3
|
||||
selected = 2
|
||||
popup/item_0/text = "Low"
|
||||
popup/item_0/id = 0
|
||||
popup/item_1/text = "Medium"
|
||||
popup/item_1/id = 1
|
||||
popup/item_2/text = "High"
|
||||
popup/item_2/id = 2
|
||||
script = ExtResource("3_6lki0")
|
||||
|
||||
[node name="Render Scale" type="HBoxContainer" parent="TabContainer/Video/VBoxContainer"]
|
||||
custom_minimum_size = Vector2(0, 32)
|
||||
layout_mode = 2
|
||||
@ -46,7 +70,7 @@ size_flags_horizontal = 3
|
||||
text = "Render Scale:"
|
||||
script = ExtResource("2_72a3s")
|
||||
|
||||
[node name="OptionButton" type="OptionButton" parent="TabContainer/Video/VBoxContainer/Render Scale"]
|
||||
[node name="OptionButton" type="OptionButton" parent="TabContainer/Video/VBoxContainer/Render Scale" groups=["video_preset_setting"]]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
item_count = 5
|
||||
@ -72,7 +96,7 @@ size_flags_horizontal = 3
|
||||
text = "Scale Mode:"
|
||||
script = ExtResource("2_72a3s")
|
||||
|
||||
[node name="OptionButton" type="OptionButton" parent="TabContainer/Video/VBoxContainer/Scale Mode"]
|
||||
[node name="OptionButton" type="OptionButton" parent="TabContainer/Video/VBoxContainer/Scale Mode" groups=["video_preset_setting"]]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
item_count = 3
|
||||
@ -94,7 +118,7 @@ size_flags_horizontal = 3
|
||||
text = "Glow:"
|
||||
script = ExtResource("2_72a3s")
|
||||
|
||||
[node name="CheckButton" type="CheckButton" parent="TabContainer/Video/VBoxContainer/Glow"]
|
||||
[node name="CheckButton" type="CheckButton" parent="TabContainer/Video/VBoxContainer/Glow" groups=["video_preset_setting"]]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
script = ExtResource("1_vkhbt")
|
||||
@ -109,7 +133,7 @@ size_flags_horizontal = 3
|
||||
text = "Depth of Field:"
|
||||
script = ExtResource("2_72a3s")
|
||||
|
||||
[node name="CheckButton" type="CheckButton" parent="TabContainer/Video/VBoxContainer/Depth of Field"]
|
||||
[node name="CheckButton" type="CheckButton" parent="TabContainer/Video/VBoxContainer/Depth of Field" groups=["video_preset_setting"]]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
script = ExtResource("5_kjasn")
|
||||
@ -124,7 +148,7 @@ size_flags_horizontal = 3
|
||||
text = "SSAO:"
|
||||
script = ExtResource("2_72a3s")
|
||||
|
||||
[node name="CheckButton" type="CheckButton" parent="TabContainer/Video/VBoxContainer/SSAO"]
|
||||
[node name="CheckButton" type="CheckButton" parent="TabContainer/Video/VBoxContainer/SSAO" groups=["video_preset_setting"]]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
script = ExtResource("6_fu528")
|
||||
@ -139,7 +163,7 @@ size_flags_horizontal = 3
|
||||
text = "SSIL:"
|
||||
script = ExtResource("2_72a3s")
|
||||
|
||||
[node name="CheckButton" type="CheckButton" parent="TabContainer/Video/VBoxContainer/SSIL"]
|
||||
[node name="CheckButton" type="CheckButton" parent="TabContainer/Video/VBoxContainer/SSIL" groups=["video_preset_setting"]]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
script = ExtResource("7_wt6tg")
|
||||
@ -154,7 +178,7 @@ size_flags_horizontal = 3
|
||||
text = "Volumetric Fog:"
|
||||
script = ExtResource("2_72a3s")
|
||||
|
||||
[node name="CheckButton" type="CheckButton" parent="TabContainer/Video/VBoxContainer/Volumetric Fog"]
|
||||
[node name="CheckButton" type="CheckButton" parent="TabContainer/Video/VBoxContainer/Volumetric Fog" groups=["video_preset_setting"]]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
script = ExtResource("7_wt6tg")
|
||||
@ -220,6 +244,7 @@ layout_mode = 2
|
||||
[node name="Volume" type="HSlider" parent="TabContainer/Audio"]
|
||||
layout_mode = 2
|
||||
|
||||
[connection signal="item_selected" from="TabContainer/Video/VBoxContainer/Preset/OptionButton" to="TabContainer/Video/VBoxContainer/Preset/OptionButton" method="on_item_selected"]
|
||||
[connection signal="item_selected" from="TabContainer/Video/VBoxContainer/Render Scale/OptionButton" to="TabContainer/Video/VBoxContainer/Render Scale/OptionButton" method="on_item_selected"]
|
||||
[connection signal="item_selected" from="TabContainer/Video/VBoxContainer/Scale Mode/OptionButton" to="TabContainer/Video/VBoxContainer/Scale Mode/OptionButton" method="on_item_selected"]
|
||||
[connection signal="toggled" from="TabContainer/Video/VBoxContainer/Glow/CheckButton" to="TabContainer/Video/VBoxContainer/Glow/CheckButton" method="on_toggled"]
|
||||
|
Loading…
Reference in New Issue
Block a user