Add fallbacks and mention non-working features when using Compatibility or the Web platform (#1132)

- Make 3D lights with shadows darker when using Compatibility to better
  match the appearance of Forward+/Mobile, due to the use of sRGB blending
  for those lights.
- Silence some warnings when running projects with the Compatibility
  rendering method, such as the one about 2D MSAA not being supported.
- Rebake lightmaps in Global Illumination to improve quality and reduce
  light leaking with improvements from 4.3.
  - Increase probe density for dynamic objects, and mark the moving box
    as a dynamic object for GI purposes.

This is done to improve the experience with the web-based demos,
which always run with the Compatibility rendering method.
This commit is contained in:
Hugo Locurcio
2025-10-02 19:31:42 +02:00
committed by GitHub
parent a5bce2f144
commit 6424e02ebf
36 changed files with 374 additions and 86 deletions

View File

@@ -1,5 +1,21 @@
extends Node
func _ready() -> void:
if OS.has_feature("web"):
for button: Button in [
$GridContainer/OpenShellFolder,
$GridContainer/MoveWindowToForeground,
$GridContainer/RequestAttention,
$GridContainer/VibrateDeviceShort,
$GridContainer/VibrateDeviceLong,
$GridContainer/AddGlobalMenuItems,
$GridContainer/RemoveGlobalMenuItem,
$GridContainer/KillCurrentProcess,
]:
button.disabled = true
button.text += "\n(not supported on Web)"
func _on_open_shell_web_pressed() -> void:
OS.shell_open("https://example.com")

View File

@@ -211,7 +211,7 @@ func _ready() -> void:
add_header("Video")
add_line("Adapter name", RenderingServer.get_video_adapter_name())
add_line("Adapter vendor", RenderingServer.get_video_adapter_vendor())
if ProjectSettings.get_setting_with_override("rendering/renderer/rendering_method") != "gl_compatibility":
if RenderingServer.get_current_rendering_method() != "gl_compatibility":
# Querying the adapter type isn't supported in Compatibility.
add_line("Adapter type", [
"Other (Unknown)",

View File

@@ -4,7 +4,22 @@ var mouse_position := Vector2()
@onready var observer: CharacterBody3D = $"../Observer"
func _ready() -> void:
if OS.has_feature("web"):
for button: BaseButton in [
$Buttons/Button_FixedSize,
$Buttons/Button_Minimized,
$Buttons/Button_Maximized,
$Buttons/Button_MoveTo,
$Buttons/Button_Resize,
$Buttons/Button_MouseModeConfined,
$Buttons/Button_MouseModeConfinedHidden,
$CheckButton,
]:
button.disabled = true
button.text += " (not supported on Web)"
if not check_wm_api():
set_physics_process(false)
set_process_input(false)
@@ -35,7 +50,8 @@ func _physics_process(_delta: float) -> void:
$Labels/Label_Mode.text = modetext
$Labels/Label_Position.text = str("Position: ", DisplayServer.window_get_position())
$Labels/Label_Size.text = str("Size: ", DisplayServer.window_get_size())
$Labels/Label_MousePosition.text = str("Mouse Position: ", mouse_position)
# Pad decimals when showing mouse position, as some platforms report floating-point mouse positions.
$Labels/Label_MousePosition.text = str("Mouse Position: %.4v" % mouse_position)
$Labels/Label_Screen_Count.text = str("Screen_Count: ", DisplayServer.get_screen_count())
$Labels/Label_Screen_Current.text = str("Screen: ", DisplayServer.window_get_current_screen())
$Labels/Label_Screen0_Resolution.text = str("Screen0 Resolution:\n", DisplayServer.screen_get_size())

View File

@@ -12,6 +12,7 @@ var state := State.MENU
@onready var camera: Camera3D = $Camera3D
func _process(delta: float) -> void:
if state != State.GRAB:
return

View File

@@ -135,7 +135,7 @@ metadata/_edit_use_custom_anchors = false
layout_mode = 2
size_flags_horizontal = 2
size_flags_vertical = 0
text = "MouseModes:"
text = "Mouse Modes:"
metadata/_edit_layout_mode = 1
metadata/_edit_use_custom_anchors = false