Skip to content

LOD GPU roadmap Phase 3: GPU culling and indirect command generation #918

Description

@MichaelFisher1997

Goal

Move high-cardinality visibility and draw-command compaction to GPU compute after CPU visibility and MDI are efficient and measurable.

Depends on

Phases 0-2: metrics, stable pooled/indirect rendering, and safe asynchronous resource lifetime.

Parallel workstreams

Data contract and fallback

  • Define compact per-region bounds, LOD hierarchy/fade state, draw ranges, water ranges, and coverage flags.
  • Extend RHI contracts for compute-to-indirect barriers and count/indirect drawing as needed.
  • Retain CPU culling below a measured candidate threshold and on unsupported devices.

Compute visibility

  • Implement distance and frustum culling into compact visible-instance and indirect-command buffers.
  • Preserve parent fallback until required children are renderable.
  • Generate separate terrain and water command streams without duplicating visibility work.
  • Add overflow bounds, counters, validation mode, and CPU/GPU result comparison.

Optional occlusion

  • Integrate the existing depth pyramid only after frustum/indirect culling is stable.
  • Use temporal hysteresis/conservative bounds to avoid popping.
  • Benchmark whether occlusion pays for itself in open terrain; disable it when candidate count or expected occlusion is low.

Relevant code

  • modules/world-lod/src/lod_renderer.zig
  • modules/engine-rhi/
  • modules/engine-graphics/src/vulkan/
  • assets/shaders/vulkan/culling.comp
  • assets/shaders/vulkan/depth_pyramid.comp

Acceptance criteria

  • The environment/config GPU-culling option performs real GPU culling rather than warning and falling back.
  • GPU output matches CPU reference visibility in validation mode.
  • Terrain and water are rendered from compact indirect command streams.
  • Compute/barrier cost is reported separately and improves CPU frame time at large horizons.
  • Small workloads automatically retain the cheaper CPU path.
  • No hierarchy holes, transition popping, indirect-buffer overflows, or one-frame stale draws.

Risks

Synchronization/barrier errors, indirect-count feature portability, delayed occlusion visibility, and atomic compaction contention. Mesh shaders are explicitly out of scope until conventional compute + MDI is proven insufficient.

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