Skip to content

Commit

Permalink
Add support for indicating FSR2, Direct3D 12, ANGLE and OpenGL ES on …
Browse files Browse the repository at this point in the history
…Linux
  • Loading branch information
Calinou committed Dec 15, 2023
1 parent 2d5d670 commit 9d36ea2
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 14 deletions.
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.2.0] - 2023-12-15

### Added

- Support for indicating the use of FSR2 upscaling and antialiasing.
- Support for indicating Direct3D 12, Metal and custom rendering drivers (will be displayed as-is).
- Support for indicating ANGLE as rendering driver on Windows/macOS and OpenGL ES on Linux.

### Changed

- Vulkan on macOS and iOS is now displayed as "Vulkan via MoltenVK", since these platforms don't natively support Vulkan.

### Fixed

- TAA is no longer marked as enabled if FSR2 scaling mode is used, as FSR2 includes its own temporal antialiasing implementation.
- [Fixed not being able to set `DebugMenu.style`.](https://github.com/godot-extended-libraries/godot-debug-menu/pull/16)

## [1.1.2] - 2023-08-23

### Fixed
Expand Down Expand Up @@ -47,7 +64,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Initial versioned release.

[Unreleased]: https://github.com/godot-extended-libraries/godot-debug-menu/compare/v1.1.2...HEAD
[Unreleased]: https://github.com/godot-extended-libraries/godot-debug-menu/compare/v1.2.0...HEAD
[1.2.0]: https://github.com/godot-extended-libraries/godot-debug-menu/compare/v1.1.2...v1.2.0
[1.1.2]: https://github.com/godot-extended-libraries/godot-debug-menu/compare/v1.1.1...v1.1.2
[1.1.1]: https://github.com/godot-extended-libraries/godot-debug-menu/compare/v1.1.0...v1.1.1
[1.1.0]: https://github.com/godot-extended-libraries/godot-debug-menu/compare/v1.0.1...v1.1.0
Expand Down
50 changes: 38 additions & 12 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,24 +179,37 @@ 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,
]

if not antialiasing_3d_string.is_empty():
settings.text += "\n3D Antialiasing: %s" % antialiasing_3d_string

var environment := viewport.get_camera_3d().get_world_3d().environment
if environment:
if environment.ssr_enabled:
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"

0 comments on commit 9d36ea2

Please sign in to comment.