open-fpsz/interfaces/menus/boot/settings/scripts/msaa.gd

32 lines
1.2 KiB
GDScript3
Raw Permalink Normal View History

# This file is part of open-fpsz.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
2024-10-16 21:43:01 +00:00
extends OptionButton
2024-10-16 21:43:01 +00:00
func _ready() -> void:
select(Settings.get_value("video", "msaa"))
2024-10-16 21:43:01 +00:00
func _on_item_selected(index: int) -> void:
Settings.set_value("video", "msaa", index)
# Multi-sample anti-aliasing. High quality, but slow. It also does not smooth out the edges of
# transparent (alpha scissor) textures.
if index == 0: # Disabled (default)
get_viewport().msaa_3d = Viewport.MSAA_DISABLED
elif index == 1: # 2×
get_viewport().msaa_3d = Viewport.MSAA_2X
elif index == 2: # 4×
get_viewport().msaa_3d = Viewport.MSAA_4X
elif index == 3: # 8×
get_viewport().msaa_3d = Viewport.MSAA_8X