From 8cbe79df3444241f8375678cb022c027c0c1b02c Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Fri, 15 Dec 2023 15:31:13 +0100 Subject: [PATCH] Bump to version 1.2.0 --- addons/debug_menu/debug_menu.gd | 48 +++++++++++++++++++++++++-------- addons/debug_menu/plugin.cfg | 2 +- project.godot | 9 +++---- test.gd | 5 ++++ test.tscn | 16 +++++++++-- 5 files changed, 61 insertions(+), 19 deletions(-) create mode 100644 test.gd diff --git a/addons/debug_menu/debug_menu.gd b/addons/debug_menu/debug_menu.gd index ed29e9d..a1ab064 100644 --- a/addons/debug_menu/debug_menu.gd +++ b/addons/debug_menu/debug_menu.gd @@ -153,8 +153,9 @@ func update_settings_label() -> void: if ProjectSettings.has_setting("application/config/version"): settings.text += "Project Version: %s\n" % ProjectSettings.get_setting("application/config/version") - var rendering_method_string := "" - match str(ProjectSettings.get_setting("rendering/renderer/rendering_method")): + var rendering_method := str(ProjectSettings.get_setting_with_override("rendering/renderer/rendering_method")) + var rendering_method_string := rendering_method + match rendering_method: "forward_plus": rendering_method_string = "Forward+" "mobile": @@ -178,8 +179,21 @@ func update_settings_label() -> void: # Display 3D settings only if relevant. if viewport.get_camera_3d(): + var scaling_3d_mode_string := "(unknown)" + match viewport.scaling_3d_mode: + Viewport.SCALING_3D_MODE_BILINEAR: + scaling_3d_mode_string = "Bilinear" + Viewport.SCALING_3D_MODE_FSR: + scaling_3d_mode_string = "FSR 1.0" + Viewport.SCALING_3D_MODE_FSR2: + scaling_3d_mode_string = "FSR 2.2" + var antialiasing_3d_string := "" - if viewport.use_taa: + if viewport.scaling_3d_mode == Viewport.SCALING_3D_MODE_FSR2: + # The FSR2 scaling mode includes its own temporal antialiasing implementation. + antialiasing_3d_string += (" + " if not antialiasing_3d_string.is_empty() else "") + "FSR 2.2" + if viewport.scaling_3d_mode != Viewport.SCALING_3D_MODE_FSR2 and viewport.use_taa: + # Godot's own TAA is ignored when using FSR2 scaling mode, as FSR2 provides its own TAA implementation. antialiasing_3d_string += (" + " if not antialiasing_3d_string.is_empty() else "") + "TAA" if viewport.msaa_3d >= Viewport.MSAA_2X: antialiasing_3d_string += (" + " if not antialiasing_3d_string.is_empty() else "") + "%d× MSAA" % pow(2, viewport.msaa_3d) @@ -187,7 +201,7 @@ func update_settings_label() -> void: antialiasing_3d_string += (" + " if not antialiasing_3d_string.is_empty() else "") + "FXAA" settings.text += "3D scale (%s): %d%% = %d×%d" % [ - "Bilinear" if viewport.scaling_3d_mode == Viewport.SCALING_3D_MODE_BILINEAR else "FSR 1.0", + scaling_3d_mode_string, viewport.scaling_3d_scale * 100, viewport_render_size.x * viewport.scaling_3d_scale, viewport_render_size.y * viewport.scaling_3d_scale, @@ -252,15 +266,27 @@ func update_information_label() -> void: # Release export template build. release_string = "release" - var graphics_api_string := "" - if str(ProjectSettings.get_setting("rendering/renderer/rendering_method")) != "gl_compatibility": - graphics_api_string = "Vulkan" + var rendering_method := str(ProjectSettings.get_setting_with_override("rendering/renderer/rendering_method")) + var rendering_driver := str(ProjectSettings.get_setting_with_override("rendering/rendering_device/driver")) + var graphics_api_string := rendering_driver + if rendering_method != "gl_compatibility": + if rendering_driver == "d3d12": + graphics_api_string = "Direct3D 12" + elif rendering_driver == "metal": + graphics_api_string = "Metal" + elif rendering_driver == "vulkan": + if OS.has_feature("macos") or OS.has_feature("ios"): + graphics_api_string = "Vulkan via MoltenVK" + else: + graphics_api_string = "Vulkan" else: - if OS.has_feature("web"): - graphics_api_string = "WebGL" - elif OS.has_feature("mobile"): + if rendering_driver == "opengl3_angle": + graphics_api_string = "OpenGL via ANGLE" + elif OS.has_feature("mobile") or rendering_driver == "opengl3_es": graphics_api_string = "OpenGL ES" - else: + elif OS.has_feature("web"): + graphics_api_string = "WebGL" + elif rendering_driver == "opengl3": graphics_api_string = "OpenGL" information.text = ( diff --git a/addons/debug_menu/plugin.cfg b/addons/debug_menu/plugin.cfg index 851c3da..54100f7 100644 --- a/addons/debug_menu/plugin.cfg +++ b/addons/debug_menu/plugin.cfg @@ -3,5 +3,5 @@ name="Debug Menu" description="In-game debug menu displaying performance metrics and hardware information" author="Calinou" -version="1.1.2" +version="1.2.0" script="plugin.gd" diff --git a/project.godot b/project.godot index f1f759a..d5a95e0 100644 --- a/project.godot +++ b/project.godot @@ -12,10 +12,10 @@ config_version=5 config/name="Debug Menu Demo" config/description="Demo for the debug menu add-on." +config/version="1.2.0" run/main_scene="res://test.tscn" -config/features=PackedStringArray("4.1") +config/features=PackedStringArray("4.2") config/icon="res://icon.svg" -config/version="1.1.2" [autoload] @@ -32,7 +32,6 @@ enabled=PackedStringArray("res://addons/debug_menu/plugin.cfg") [rendering] -scaling_3d/mode=1 -scaling_3d/scale=0.75 +scaling_3d/mode=2 +scaling_3d/scale=0.67 anti_aliasing/quality/msaa_3d=1 -anti_aliasing/quality/use_taa=true diff --git a/test.gd b/test.gd new file mode 100644 index 0000000..0347acf --- /dev/null +++ b/test.gd @@ -0,0 +1,5 @@ +extends Node3D + + +func _on_cycle_debug_menu_display_mode_pressed() -> void: + DebugMenu.style = wrapi(DebugMenu.style + 1, 0, DebugMenu.Style.MAX) diff --git a/test.tscn b/test.tscn index e329d23..f87aaea 100644 --- a/test.tscn +++ b/test.tscn @@ -1,4 +1,6 @@ -[gd_scene load_steps=16 format=3 uid="uid://cyn6ed84egpjf"] +[gd_scene load_steps=17 format=3 uid="uid://cyn6ed84egpjf"] + +[ext_resource type="Script" path="res://test.gd" id="1_j7f4p"] [sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_5ncgh"] sky_horizon_color = Color(0.64625, 0.65575, 0.67075, 1) @@ -87,6 +89,7 @@ _data = { gradient = SubResource("Gradient_8hfrt") [node name="Node3D" type="Node3D"] +script = ExtResource("1_j7f4p") [node name="DirectionalLight3D" type="DirectionalLight3D" parent="."] transform = Transform3D(-0.866023, -0.433016, 0.250001, 0, 0.499998, 0.866027, -0.500003, 0.749999, -0.43301, 0, 0, 0) @@ -163,10 +166,10 @@ shadow_enabled = true omni_range = 15.0 [node name="AnimationPlayer" type="AnimationPlayer" parent="."] -autoplay = "move" libraries = { "": SubResource("AnimationLibrary_sld3c") } +autoplay = "move" [node name="Camera2D" type="Camera2D" parent="."] position = Vector2(707, 368) @@ -175,6 +178,13 @@ position = Vector2(707, 368) position = Vector2(1087, 148) texture = SubResource("GradientTexture2D_dlbxm") +[node name="CycleDebugMenuDisplayMode" type="Button" parent="."] +offset_left = 144.0 +offset_top = 58.0 +offset_right = 315.0 +offset_bottom = 102.0 +text = "Cycle Debug Menu" + [node name="Label" type="Label" parent="."] modulate = Color(1, 1, 1, 0.501961) offset_left = 922.0 @@ -186,3 +196,5 @@ theme_override_constants/outline_size = 4 text = "2D drawing example (should appear behind the debug menu). Also notice the Camera2D offset in the editor." + +[connection signal="pressed" from="CycleDebugMenuDisplayMode" to="." method="_on_cycle_debug_menu_display_mode_pressed"]