Skip to content

[Lighting Overhaul][Phase 0] Establish visual baselines and repair pipeline contracts #900

Description

@MichaelFisher1997

Parent

Part of #898.

Goal

Create trustworthy visual/performance baselines and fix pipeline contract bugs that would invalidate comparisons in later phases.

Scope

  • Add deterministic scenes/captures for noon, low sun, cave entrance, sealed cave, RGB emitter, foliage/cutout, water, and a cross-chunk corridor.
  • Capture debug channels for skylight, RGB block light, AO, cascade index, caster coverage, shadow factor, and final output.
  • Correct the sky shadow UBO to four matrices and align every CPU/GLSL field offset.
  • Add a shader ABI test using SPIR-V reflection or equivalent generated offset validation.
  • Transition all shadow array layers correctly and include the required early/late depth stages.
  • Publish the actual allocated shadow resolution to cascade fitting and sampling.
  • Recreate shadow resources/descriptors safely at a frame boundary when quality changes.
  • Make the final display transform format-independent for sRGB and UNORM/headless targets.
  • Record high-preset CPU/GPU timings before behavioral rewrites.

Out of scope

  • Voxel propagation changes.
  • New cascade fitting/sampling math.
  • Artistic lighting retuning.

Acceptance criteria

  • CPU and all shaders agree on shadow UBO size, offsets, and cascade count.
  • Vulkan validation reports no shadow array layout or dependency errors.
  • Runtime shadow resolution changes use matching physical resources and uniforms.
  • Windowed sRGB and headless UNORM captures match within an agreed tolerance.
  • Deterministic scene captures and baseline benchmark JSON are documented and repeatable.
  • Debug channels make each later phase independently diagnosable.

Verification

nix develop --command zig build test
nix develop --command zig build -Dskip-present
nix develop --command zig build test-robustness
nix develop --command zig build run -Dskip-present -Dshadow-test-scene -Dscreenshot-path=screenshots/lighting-phase0-shadow.png -Dscreenshot-frame=180
nix develop --command zig build benchmark -Doptimize=ReleaseFast -Dbenchmark-preset=high -Dbenchmark-duration=60 -Dbenchmark-output=lighting-phase0-high.json

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentationengineenhancementNew feature or requestshaders

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions