Skip to content

TrailView phone tier: a coarser far terrain whose nodes still meet #3779

Closed

Description

@timohueser

Status: approved

Part of #3656. Depends on #3777.

TL;DR

Goal: On the phone tier, the terrain draws each level over 0.8 times the desktop's distance, and neighbouring nodes still meet. This saves about 4.5 ms of GPU time and about 96 MiB on the iPhone 13. The near meshes of the new roads end where level 18 ends, so they end at about 0.89 times the desktop's distance.
Systems: trailview
Size: S (1 system, no contract)

Plan

  1. terrain/lod.ts: cdlod takes the morph band, and Rule carries it. The constants MORPH and RANGE move into the budget: on the desktop the least range 4.6, the most 8 and the morph band 0.3; on the phone the least and the most 3.7 and the morph band 0.15. So the phone's range is 3.7 at every render size: at its 1,182 rows bestRange gives 4.0, and a lower least alone would give 4.0.
  2. terrain/terrain.ts takes the range limits from the budget (bestRange, qualitySteps and the rule) and writes the morph band into the surface uniform. terrain/drawn-height.wgsl, plan/cells.wgsl and roads/corridor.wgsl read it from there in place of their constant (if TrailView ground plan GP19: the ground plan becomes the only path, the old code goes, docs, budgets, merge into develop #3110 merged first, corridor.wgsl is gone). plan/pieces.ts reads it from the rule.
  3. terrain/lod.test.ts: the selection test runs at the least range and the morph band of each tier.
  4. terrain/terrain.ts: the bound in the comment of PROBE_ABOVE_M doubles with the half band. Check that it stays far below 1 at a walk's eye height, and update the comment.
  5. The crack flight (flight.mjs --gpu --cracks 10 over cracks.json) at tier=phone on the M1 Pro finds no cracks.
  6. The gallery of the far terrain (the epic's "The galleries"). The shorter morph shows only in motion: the owner watches one walk at tier=phone in one viewer window.

Activity

  1. timohueser commented on Nov 21, 2026

    @timohueser
    OwnerAuthor

    Gallery approved by the owner (in the build session: "gallery is approved"). The gallery: headless Chromium on Metal, 780 × 1688; desktop against the far-terrain cut and against the whole phone tier, eight scenes. Numbers in #3791.

  2. timohueser commented on Nov 21, 2026

    @timohueser
    OwnerAuthor

    The owner watched one walk at tier=phone in one viewer window: "Walk looks fine". Every Done-when step of this issue is met.

  3. added a commit that references this issue on Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions