Skip to content

Commit 11d6a81

Browse files
committed
Add fallbacks and mention non-working features when using Compatibility
- Make 3D lights with shadows darker when using Compatibility to better match the apperance 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.
1 parent adf6d7e commit 11d6a81

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+424
-129
lines changed

Diff for: 2d/particles/particles.tscn

+21-6
Large diffs are not rendered by default.

Diff for: 2d/particles/pause.gd

+14-3
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,34 @@
11
extends Label
22

3+
var is_compatibility := false
4+
5+
6+
func _ready() -> void:
7+
if ProjectSettings.get_setting_with_override("rendering/renderer/rendering_method") == "gl_compatibility":
8+
is_compatibility = true
9+
text = "Space: Pause/Resume\nG: Toggle glow\n\n\n"
10+
get_parent().get_node("UnsupportedLabel").visible = true
11+
# Increase glow intensity to compensate for lower dynamic range.
12+
get_node("../..").environment.glow_intensity = 4.0
13+
314

415
func _input(event: InputEvent) -> void:
516
if event.is_action_pressed("toggle_pause"):
617
get_tree().paused = not get_tree().paused
718

8-
if event.is_action_pressed("toggle_trails"):
19+
if not is_compatibility and event.is_action_pressed("toggle_trails"):
920
# Particles disappear if trail type is changed while paused.
1021
# Prevent changing particle type while paused to avoid confusion.
1122
for particles in get_tree().get_nodes_in_group("trailable_particles"):
1223
particles.trail_enabled = not particles.trail_enabled
1324

14-
if event.is_action_pressed("increase_trail_length"):
25+
if not is_compatibility and event.is_action_pressed("increase_trail_length"):
1526
# Particles disappear if trail type is changed while paused.
1627
# Prevent changing particle type while paused to avoid confusion.
1728
for particles in get_tree().get_nodes_in_group("trailable_particles"):
1829
particles.trail_lifetime = clampf(particles.trail_lifetime + 0.05, 0.1, 1.0)
1930

20-
if event.is_action_pressed("decrease_trail_length"):
31+
if not is_compatibility and event.is_action_pressed("decrease_trail_length"):
2132
# Particles disappear if trail type is changed while paused.
2233
# Prevent changing particle type while paused to avoid confusion.
2334
for particles in get_tree().get_nodes_in_group("trailable_particles"):

Diff for: 2d/particles/project.godot

+9-8
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ config_version=5
1010

1111
[application]
1212

13-
config/name="2D GPUParticles3D"
13+
config/name="2D GPUParticles"
1414
config/description="This demo showcases how 2D particle systems work in Godot."
1515
config/tags=PackedStringArray("2d", "demo", "official", "rendering")
1616
run/main_scene="res://particles.tscn"
17-
config/features=PackedStringArray("4.2")
17+
config/features=PackedStringArray("4.3")
1818
config/icon="res://icon.webp"
1919

2020
[debug]
@@ -30,28 +30,28 @@ window/stretch/aspect="expand"
3030

3131
toggle_pause={
3232
"deadzone": 0.2,
33-
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":32,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null)
34-
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194313,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null)
33+
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":32,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
34+
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194313,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
3535
]
3636
}
3737
toggle_trails={
3838
"deadzone": 0.2,
39-
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":84,"key_label":0,"unicode":0,"echo":false,"script":null)
39+
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":84,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
4040
]
4141
}
4242
increase_trail_length={
4343
"deadzone": 0.2,
44-
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194320,"key_label":0,"unicode":0,"echo":false,"script":null)
44+
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194320,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
4545
]
4646
}
4747
decrease_trail_length={
4848
"deadzone": 0.2,
49-
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194322,"key_label":0,"unicode":0,"echo":false,"script":null)
49+
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194322,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
5050
]
5151
}
5252
toggle_glow={
5353
"deadzone": 0.2,
54-
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":71,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null)
54+
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":71,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
5555
]
5656
}
5757

@@ -60,3 +60,4 @@ toggle_glow={
6060
renderer/rendering_method="mobile"
6161
environment/defaults/default_clear_color=Color(0, 0, 0, 1)
6262
anti_aliasing/quality/msaa_2d=2
63+
anti_aliasing/quality/msaa_2d.web=0

Diff for: 2d/polygons_lines/polygons_lines.gd

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
extends Node2D
22

33

4+
func _ready() -> void:
5+
if ProjectSettings.get_setting_with_override("rendering/renderer/rendering_method") == "gl_compatibility":
6+
$MSAA.visible = false
7+
$UnsupportedLabel.visible = true
8+
9+
410
func _on_msaa_option_button_item_selected(index: int) -> void:
511
get_viewport().msaa_2d = index as Viewport.MSAA

Diff for: 2d/polygons_lines/polygons_lines.tscn

+11-2
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,24 @@ text = "MSAA 2D"
146146

147147
[node name="OptionButton" type="OptionButton" parent="MSAA"]
148148
layout_mode = 2
149-
item_count = 4
150149
selected = 0
150+
item_count = 4
151151
popup/item_0/text = "Disabled (Fastest)"
152-
popup/item_0/id = 0
153152
popup/item_1/text = "2× (Average)"
154153
popup/item_1/id = 1
155154
popup/item_2/text = "4× (Slow)"
156155
popup/item_2/id = 2
157156
popup/item_3/text = "8× (Slowest)"
158157
popup/item_3/id = 3
159158

159+
[node name="UnsupportedLabel" type="Label" parent="."]
160+
visible = false
161+
self_modulate = Color(1, 1, 1, 0.6)
162+
offset_left = 24.0
163+
offset_top = 24.0
164+
offset_right = 282.0
165+
offset_bottom = 47.0
166+
text = "MSAA 2D is not supported
167+
in the Compatibility rendering method."
168+
160169
[connection signal="item_selected" from="MSAA/OptionButton" to="." method="_on_msaa_option_button_item_selected"]

Diff for: 2d/polygons_lines/project.godot

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ config/description="A demo of solid and textured 2D polygons and lines using Pol
1515
2D antialiasing is also showcased using two techniques:
1616
MSAA 2D and a specially crafted texture applied to a Line2D node."
1717
run/main_scene="res://polygons_lines.tscn"
18-
config/features=PackedStringArray("4.2")
18+
config/features=PackedStringArray("4.3")
1919
run/low_processor_mode=true
2020
config/icon="res://icon.webp"
2121

Diff for: 3d/antialiasing/anti_aliasing.gd

+21-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,23 @@ var base_height := int(ProjectSettings.get_setting("display/window/size/viewport
1616
@onready var camera: Camera3D = $CameraHolder/RotationX/Camera3D
1717
@onready var fps_label: Label = $FPSLabel
1818

19+
var is_compatibility := false
20+
21+
1922
func _ready() -> void:
23+
if ProjectSettings.get_setting_with_override("rendering/renderer/rendering_method") == "gl_compatibility":
24+
is_compatibility = true
25+
# Hide unsupported features.
26+
$Antialiasing/FXAAContainer.visible = false
27+
$Antialiasing/TAAContainer.visible = false
28+
29+
# Darken the light's energy to compensate for sRGB blending (without affecting sky rendering).
30+
$DirectionalLight3D.sky_mode = DirectionalLight3D.SKY_MODE_SKY_ONLY
31+
var new_light: DirectionalLight3D = $DirectionalLight3D.duplicate()
32+
new_light.light_energy = 0.3
33+
new_light.sky_mode = DirectionalLight3D.SKY_MODE_LIGHT_ONLY
34+
add_child(new_light)
35+
2036
# Disable V-Sync to uncap framerate on supported platforms. This makes performance comparison
2137
# easier on high-end machines that easily reach the monitor's refresh rate.
2238
DisplayServer.window_set_vsync_mode(DisplayServer.VSYNC_DISABLED)
@@ -99,9 +115,11 @@ func _on_render_scale_value_changed(value: float) -> void:
99115
$Antialiasing/RenderScaleContainer/Value.text = "%d%%" % (value * 100)
100116
# Update viewport resolution text.
101117
_on_viewport_size_changed()
102-
# FSR 1.0 is only effective if render scale is below 100%, so hide the setting if at native resolution or higher.
103-
$Antialiasing/FidelityFXFSR.visible = value < 1.0
104-
$Antialiasing/FSRSharpness.visible = get_viewport().scaling_3d_mode == Viewport.SCALING_3D_MODE_FSR and value < 1.0
118+
if not is_compatibility:
119+
# Only show the feature if supported.
120+
# FSR 1.0 is only effective if render scale is below 100%, so hide the setting if at native resolution or higher.
121+
$Antialiasing/FidelityFXFSR.visible = value < 1.0
122+
$Antialiasing/FSRSharpness.visible = get_viewport().scaling_3d_mode == Viewport.SCALING_3D_MODE_FSR and value < 1.0
105123

106124

107125
func _on_amd_fidelityfx_fsr1_toggled(button_pressed: bool) -> void:

Diff for: 3d/antialiasing/anti_aliasing.tscn

+5-10
Original file line numberDiff line numberDiff line change
@@ -900,10 +900,9 @@ vertical_alignment = 1
900900
[node name="MSAA" type="OptionButton" parent="Antialiasing/MSAAContainer"]
901901
custom_minimum_size = Vector2(235, 2.08165e-12)
902902
layout_mode = 2
903-
item_count = 4
904903
selected = 0
904+
item_count = 4
905905
popup/item_0/text = "Disabled (Fastest)"
906-
popup/item_0/id = 0
907906
popup/item_1/text = "2× (Average)"
908907
popup/item_1/id = 1
909908
popup/item_2/text = "4× (Slow)"
@@ -927,10 +926,9 @@ vertical_alignment = 1
927926
[node name="FXAA" type="OptionButton" parent="Antialiasing/FXAAContainer"]
928927
custom_minimum_size = Vector2(235, 2.08165e-12)
929928
layout_mode = 2
930-
item_count = 2
931929
selected = 0
930+
item_count = 2
932931
popup/item_0/text = "Disabled (Fastest)"
933-
popup/item_0/id = 0
934932
popup/item_1/text = "Enabled (Fast)"
935933
popup/item_1/id = 1
936934

@@ -950,10 +948,9 @@ vertical_alignment = 1
950948
[node name="TAA" type="OptionButton" parent="Antialiasing/TAAContainer"]
951949
custom_minimum_size = Vector2(235, 2.08165e-12)
952950
layout_mode = 2
953-
item_count = 2
954951
selected = 0
952+
item_count = 2
955953
popup/item_0/text = "Disabled (Fastest)"
956-
popup/item_0/id = 0
957954
popup/item_1/text = "Enabled (Average)"
958955
popup/item_1/id = 1
959956

@@ -972,10 +969,9 @@ vertical_alignment = 1
972969
[node name="VSync" type="OptionButton" parent="Antialiasing/VSyncContainer"]
973970
custom_minimum_size = Vector2(235, 2.08165e-12)
974971
layout_mode = 2
975-
item_count = 3
976972
selected = 0
973+
item_count = 3
977974
popup/item_0/text = "Disabled"
978-
popup/item_0/id = 0
979975
popup/item_1/text = "Adaptive"
980976
popup/item_1/id = 1
981977
popup/item_2/text = "Enabled"
@@ -1053,10 +1049,9 @@ text = "AMD FidelityFX Super Resolution 1.0"
10531049
[node name="FSRSharpness" type="OptionButton" parent="Antialiasing"]
10541050
visible = false
10551051
layout_mode = 2
1056-
item_count = 5
10571052
selected = 3
1053+
item_count = 5
10581054
popup/item_0/text = "No FSR Sharpness"
1059-
popup/item_0/id = 0
10601055
popup/item_1/text = "Low FSR Sharpness"
10611056
popup/item_1/id = 1
10621057
popup/item_2/text = "Medium FSR Sharpness"

Diff for: 3d/antialiasing/polyhaven/dutch_ship_medium_1k.gltf.import

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ nodes/root_type="Node3D"
1717
nodes/root_name="Scene Root"
1818
nodes/apply_root_scale=true
1919
nodes/root_scale=1.0
20+
nodes/import_as_skeleton_bones=false
2021
meshes/ensure_tangents=true
2122
meshes/generate_lods=true
2223
meshes/create_shadow_meshes=true
@@ -28,6 +29,7 @@ animation/import=true
2829
animation/fps=30
2930
animation/trimming=false
3031
animation/remove_immutable_tracks=true
32+
animation/import_rest_as_RESET=false
3133
import_script/path=""
3234
_subresources={}
3335
gltf/naming_version=0

Diff for: 3d/antialiasing/project.godot

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ config/name="3D Anti-Aliasing"
1414
config/description="This project showcases the various 3D antialiasing techniques supported by Godot."
1515
config/tags=PackedStringArray("3d", "demo", "official")
1616
run/main_scene="res://anti_aliasing.tscn"
17-
config/features=PackedStringArray("4.2")
17+
config/features=PackedStringArray("4.3")
1818
config/icon="res://icon.webp"
1919

2020
[debug]

Diff for: 3d/csg/csg.gd

+9
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,16 @@ var base_height := int(ProjectSettings.get_setting("display/window/size/viewport
1515
@onready var rotation_x: Node3D = $CameraHolder/RotationX
1616
@onready var camera: Camera3D = $CameraHolder/RotationX/Camera3D
1717

18+
1819
func _ready() -> void:
20+
if ProjectSettings.get_setting_with_override("rendering/renderer/rendering_method") == "gl_compatibility":
21+
# Darken the light's energy to compensate for sRGB blending (without affecting sky rendering).
22+
$DirectionalLight3D.sky_mode = DirectionalLight3D.SKY_MODE_SKY_ONLY
23+
var new_light: DirectionalLight3D = $DirectionalLight3D.duplicate()
24+
new_light.light_energy = 0.3
25+
new_light.sky_mode = DirectionalLight3D.SKY_MODE_LIGHT_ONLY
26+
add_child(new_light)
27+
1928
camera_holder.transform.basis = Basis.from_euler(Vector3(0, rot_y, 0))
2029
rotation_x.transform.basis = Basis.from_euler(Vector3(rot_x, 0, 0))
2130
update_gui()

Diff for: 3d/global_illumination/project.godot

+1
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,4 @@ lights_and_shadows/directional_shadow/soft_shadow_filter_quality=3
8484
lights_and_shadows/positional_shadow/soft_shadow_filter_quality=3
8585
anti_aliasing/quality/screen_space_aa=1
8686
anti_aliasing/quality/use_debanding=true
87+
anti_aliasing/quality/msaa_3d.web=2

0 commit comments

Comments
 (0)