Skip to content

[Lighting Overhaul][Phase 4] Bring AO, materials, water, LOD, and volumetrics to parity #902

Description

@MichaelFisher1997

Parent

Part of #898.

Depends on

#901.

Goal

Bring AO, materials, water, distant terrain, and optional cinematic effects into parity with the corrected baseline without compromising the 60 FPS target.

Scope

  • Convert SSAO inputs to one coordinate space and replace box blur with depth/normal-aware bilateral filtering.
  • Run SSAO at a cost-appropriate resolution and apply it only to indirect diffuse.
  • Add tile-safe diffuse/normal/roughness mipmaps through gutters, padding, or texture-array migration; make anisotropy meaningful.
  • Preserve material-frequency detail beyond the current 32-128 unit flattening range.
  • Give LOD terrain propagated lighting semantics and atmosphere/shadow continuity rather than full hard-coded skylight.
  • Rework water around Schlick Fresnel, atmosphere/sky reflection, scene reflection, depth-based Beer-Lambert absorption, modest scattering, and RGB block light.
  • Remove fixed cyan and nighttime luminance floors from water.
  • Reintroduce bounded volumetric sun scattering only after baseline benchmark budgets pass.
  • Keep LPV explicitly experimental/quarantined with no allocation or update cost when disabled.
  • Evaluate LPV separately after this phase; do not make it a completion dependency.

Acceptance criteria

  • SSAO has no silhouette halos or coordinate-dependent rotation artifacts.
  • AO strengthens contact depth without darkening direct sun/specular.
  • Distant textures retain stable detail without atlas bleeding.
  • LOD handoff does not change lighting semantics or expose a shadow wall.
  • Water reflects the sky, responds to depth, and carries colored nearby light without opaque cyan plastic behavior.
  • Optional volumetrics remain temporally stable and target below 2 ms at high preset/1080p.
  • Disabled LPV allocates no textures/buffers and runs no update pass.

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 -Dauto-world=normal -Dscreenshot-path=screenshots/lighting-phase4-world.png -Dscreenshot-frame=180 -Dscreenshot-delay-seconds=3
nix develop --command zig build benchmark -Doptimize=ReleaseFast -Dbenchmark-preset=high -Dbenchmark-duration=60 -Dbenchmark-output=lighting-phase4-high.json

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions