Skip to content

LOD GPU roadmap Phase 4: compact GPU-rendered far-terrain tiles #917

Description

@MichaelFisher1997

Goal

Replace conventional CPU-expanded LOD3/4 meshes with compact height/material tiles and a GPU-friendly reusable representation. This is the main architectural step toward Distant Horizons-like scale.

Depends on

Phases 0-3. Requires measured evidence that CPU meshing, uploads, vertex memory, or vertex/raster work remains a limiting factor after earlier fixes.

Design spike

Before production implementation, compare:

  1. Reusable indexed grid + compact tile textures/storage buffers.
  2. Compute expansion into pooled vertex/index buffers.
  3. Mesh shaders only on supported hardware with a conventional fallback.

Evaluate transfer bytes, VRAM, shader bandwidth, seams, normals, edit latency, platform support, and maintenance cost. Do not assume compute expansion is automatically superior.

Parallel workstreams after design approval

  • Define compact quantized height, material, water, lighting, vegetation, and provenance representation.
  • Implement CPU generation/persistence of compact tiles; avoid GPU readback.
  • Implement reusable-grid or compute-generated rendering for LOD3/4.
  • Generate normals from neighboring height samples with stable boundary handling.
  • Implement skirts/stitching/geomorphing for cross-LOD seams.
  • Add a simplified far-water pipeline without unnecessary SSR/reflection/depth work.
  • Preserve CPU-mesh fallback and near LOD quality path.

Relevant code

  • modules/world-core/src/lod_data.zig
  • modules/world-lod/src/lod_mesh.zig
  • modules/world-lod/src/lod_geometry.zig
  • modules/world-lod/src/lod_seam.zig
  • modules/world-lod/src/lod_vertex_pool.zig
  • assets/shaders/vulkan/terrain.vert
  • assets/shaders/vulkan/terrain.frag
  • assets/shaders/vulkan/water.frag

CPU/GPU decision

CPU keeps procedural generation, edits, persistence, hierarchy policy, and compact-tile production. GPU handles expansion/rendering, normals where local, visibility, and drawing.

Acceptance criteria

  • LOD3/4 upload bytes and resident geometry memory are materially lower than CPU-expanded meshes.
  • Worker mesh time for far levels is eliminated or substantially reduced.
  • Visual baselines show no unacceptable cracks, normal discontinuities, water artifacts, or transition instability.
  • Quality can scale independently from raw vertex uploads.
  • Unsupported devices use a maintained fallback.

Risks

Quantization artifacts, shader bandwidth replacing vertex bandwidth, difficult seams, edit propagation latency, and increased pipeline complexity. A design review is required before committing to mesh shaders.

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