H14: No sun shadows under the OpenGL fallback

Godot's Compatibility renderer draws a shadowed directional light in a
pass of its own and adds it after the frame is in sRGB, so sunlit pixels
come out as srgb(ambient) + srgb(sun) (measured to within 1/255 on
llvmpipe) and ground and rocks wash out. No environment or project
setting avoids it, so Look.sun_shadows_supported() is false under
gl_compatibility and the sun casts no shadows there on any preset.

Adds the sun_probe and sun_shadow_probe capture scenarios to recheck
after an engine upgrade, a test, and the explanation in PLAY.md and the
README.

Closes #81

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-14 20:28:31 -05:00
co-authored by Claude Opus 5.5
parent 358234d246
commit 8710c099b3
9 changed files with 106 additions and 8 deletions
+20
View File
@@ -174,6 +174,26 @@ func test_a_preset_sets_the_viewport_and_the_sun() -> void:
view.free()
func test_no_sun_shadows_under_the_opengl_fallback() -> void:
# H14: Compatibility adds a shadowed sun's pass in sRGB, which washes out sunlit
# ground, so the sun casts no shadows there whatever the preset.
assert_true(Look.sun_shadows_supported("forward_plus"))
assert_true(Look.sun_shadows_supported("mobile"))
assert_false(Look.sun_shadows_supported("gl_compatibility"))
var expected: bool = Look.sun_shadows_supported()
var sun: DirectionalLight3D = Look.sun()
assert_eq(sun.shadow_enabled, expected, "Look.sun follows the renderer")
sun.free()
var view: MatchView = MatchView.new()
view.sun = Look.sun()
view.add_child(view.sun)
var settings: GameSettings = GameSettings.new()
settings.quality = GameSettings.QUALITY_HIGH
view.apply_settings(settings)
assert_eq(view.sun.shadow_enabled, expected, "presets don't turn them back on")
view.free()
func test_presets_never_change_how_far_cover_is_drawn() -> void:
# A lower preset must never let a player see through trees and rocks it stopped
# drawing: nothing about props is in the presets.