Skip to content

Commit

Permalink
Bump to version 1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Calinou committed Dec 15, 2023
1 parent 7171afa commit 8cbe79d
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 19 deletions.
48 changes: 37 additions & 11 deletions addons/debug_menu/debug_menu.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand All @@ -178,16 +179,29 @@ 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)
if viewport.screen_space_aa == Viewport.SCREEN_SPACE_AA_FXAA:
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,
Expand Down Expand Up @@ -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 = (
Expand Down
2 changes: 1 addition & 1 deletion addons/debug_menu/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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"
9 changes: 4 additions & 5 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand All @@ -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
5 changes: 5 additions & 0 deletions test.gd
Original file line number Diff line number Diff line change
@@ -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)
16 changes: 14 additions & 2 deletions test.tscn
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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"]

0 comments on commit 8cbe79d

Please sign in to comment.