acdream/tests/AcDream.App.Tests/Rendering/Packs
Erik eec9553582 fix(render): foliage wind no longer depends on the directional-shadow gate (Campaign VM VM6 review 4)
The reviewer's offline pixel apparatus found a real design defect, not a
test artefact: foliage wind was welded to "directional shadows rendered
this frame." Evidence: offline High preset, sun-shadow-strength=0,
wind-strength 2 + lean/branch 1 m — wind-on vs wind-off at the same
pinned clock differed by only 49-65 px, inside the apparatus's own 22 px
run-to-run noise floor (no measurable motion). A CPU probe independently
confirmed ResolveFoliageWind was correct (first advance snaps to Clear
0.25/0.15, gate 1, one graph) — the correct uniform never reached the
world pass.

Root cause: DirectionalSunShadowRenderer.Render's two early-out paths
(!environment.ShouldRender, ResidentWindowUnavailable) left
_currentFrameBinding at its pure Disabled (no-buffer) default.
WbDrawDispatcher.PipelinesFor and TerrainModernRenderer's matching
selection logic only choose the atmospheric receiver pipeline
(mesh_atmospheric, the only pipeline that #includes foliage_wind.glsl)
when TryGetCurrentFrameBinding returns true; with no buffer it always
returned false, so the world pass silently fell back to the plain
mesh_modern pipeline, which has no wind code at all. Because the shadow
gate is ActiveDayGroupMultiplier = dayGroupPolicy x elevationResponse x
strength, this killed wind every night (elevation response -> 0), at
user sun-shadow-strength 0, and under the portal/login cover.

Fix (decouple, not patch): DirectionalShadowFrameBinding gained
IsBindableFor ("a real current-frame allocation exists") separate from
IsValidFor ("...and it is Enabled with real shadow content" -- kept
exactly as VolumetricShaftRenderer's own gate needs it).
TryGetCurrentFrameBinding now returns IsBindableFor. When the built-in
pack supplies an AtmosphericFrame binding (declared packs never do, so
their receiver shaders -- which never declare set 3 binding 5 -- are
unaffected), Render's two early-out paths call a new
PublishDisabledReceiverBinding: it allocates one real ring slice and
writes a DISABLED DirectionalShadowUniforms block -- every matrix
Identity, every control/bias term zero, TextureAndFlags all zero (bit 0
clear is exactly what directional_shadow_receiver.glsl's
acdreamDirectionalShadowVisibility already reads as "no shadow, full
visibility" via its existing early return 1.0), and a unit light
direction (0,0,1) so a fragment shader's normalize() can never produce
NaN. BindDirectionalShadowReceiver and TerrainModernRenderer's
shadow-buffer bind now check Buffer is not null instead of Enabled, so
the disabled block actually gets bound once it is selected.

PublishDisabledReceiverBinding is internal (not private) specifically so
it is testable without standing up a real WbDrawDispatcher/
TerrainModernRenderer pair -- no test in this suite constructs either.
New tests: (a)/(b) PublishDisabledReceiverBinding is bindable-not-valid
with a bound AtmosphericFrame and a genuine no-op with an unbound one;
(c) BindDirectionalShadowReceiver emits both UniformDirectionalShadow and
UniformAtmosphericFrame binds for a disabled binding; (d)
VolumetricShaftRenderer's gate still reports NoCurrentDirectionalShadow
for a disabled binding. ShouldSelectReceiverPipeline itself is untouched
and its existing tests (parametrized directly on bindingValid) remain
valid; no existing test asserted the old "disabled shadows -> plain
pipeline / no binding" behaviour in a way this fix invalidates -- every
existing caller either bypasses Render (calls RenderPrepared directly)
or uses a stale-serial binding IsBindableFor still correctly rejects.

Verify: Release build 0 warnings/0 errors. App hermetic-lane filter
6,050/0 failed. Core.Tests 4,695/0 failed. Full hermetic-filtered
solution: 15,278/0 failed across 15 projects.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-23 03:29:57 +02:00
..
AtmosphericAutoQualityControllerTests.cs feat(render): implement Campaign AR and terrain fidelity 2026-08-22 13:13:29 +02:00
AtmosphericColorPipelineTests.cs docs(vm3): closeout - owner gate brief with the measured curve table; #422 filed; tests pin the shipped defaults 2026-08-22 23:53:26 +02:00
AtmosphericCpuStageProfilerTests.cs feat(render): implement Campaign AR and terrain fidelity 2026-08-22 13:13:29 +02:00
AtmosphericGpuTimerSamplingTests.cs feat(render): implement Campaign AR and terrain fidelity 2026-08-22 13:13:29 +02:00
AtmosphericPostProcessGraphTests.cs refactor(render): one group-creation seam, required foliage key field, first-frame wind snap (Campaign VM VM6 review 3) 2026-08-23 03:03:56 +02:00
AtmosphericShaderAbiTests.cs feat(render): weather-driven foliage wind for procedural scenery, shadows follow (Campaign VM VM6b) 2026-08-23 00:56:34 +02:00
AuthoredCelestialShadowSourceResolverTests.cs feat(render): implement Campaign AR and terrain fidelity 2026-08-22 13:13:29 +02:00
FoliageWindModelTests.cs fix(render): correct foliage-wind classification, receiver/caster desync, and frame binding (Campaign VM VM6 review) 2026-08-23 01:54:36 +02:00
NoOpRenderPackProductionIntegrationTests.cs feat(render): implement Campaign AR and terrain fidelity 2026-08-22 13:13:29 +02:00
PackSettingsUniformsTests.cs feat(render): implement Campaign AR and terrain fidelity 2026-08-22 13:13:29 +02:00
RenderPackAtmospherePolicyEvaluationTests.cs fix(render): foliage wind keys on the DAT-classified WeatherKind, not the day-group index (Campaign VM VM6) 2026-08-23 01:07:54 +02:00
RenderPackAutoRuntimeTests.cs feat(render): implement Campaign AR and terrain fidelity 2026-08-22 13:13:29 +02:00
RenderPackCapabilityResolverTests.cs feat(render): implement Campaign AR and terrain fidelity 2026-08-22 13:13:29 +02:00
RenderPackControllerTests.cs feat(render): implement Campaign AR and terrain fidelity 2026-08-22 13:13:29 +02:00
RenderPackLongCycleConvergenceTests.cs feat(render): implement Campaign AR and terrain fidelity 2026-08-22 13:13:29 +02:00
RenderPackPerformanceWindowTests.cs feat(render): implement Campaign AR and terrain fidelity 2026-08-22 13:13:29 +02:00
RenderPackResourceBudgetPlannerTests.cs feat(render): implement Campaign AR and terrain fidelity 2026-08-22 13:13:29 +02:00
RenderPackRuntimeFailureRecoveryTests.cs feat(render): implement Campaign AR and terrain fidelity 2026-08-22 13:13:29 +02:00
RenderPackSpirvValidatorTests.cs fix(render): foliage wind keys on the DAT-classified WeatherKind, not the day-group index (Campaign VM VM6) 2026-08-23 01:07:54 +02:00
VolumetricShaftRendererTests.cs fix(render): foliage wind no longer depends on the directional-shadow gate (Campaign VM VM6 review 4) 2026-08-23 03:29:57 +02:00