42 lines
1.5 KiB
GDScript

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