1
0
This repository has been archived on 2026-08-25. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
tera/src/test
Claude 76ca903cd2 fix: the ground's detail was switched off everywhere, and the map was a grid of stars
Three defects in the round before this one, all of them found by rendering the
board and looking at it, none of them by a test that existed.

**1. The fade was wrong by a factor of nine, so the map did nothing.** It copied
`SEA_CALM_NEAR`'s form: `length( vViewPosition )` against a window converted from
real metres by `metresPerUnit`. That conversion assumes the camera's distance is
a plan measurement. On this board it is not — `verticalExaggeration` is 15, so a
camera lifted to 0.6 of its stand-off sits `sqrt(1 + (0.6 x 15)²) = 9.06`
stand-offs away in scene units — so a window written as "25 km to 70 km" closed
at about 2.8 km of stand-off and the detail was off everywhere a viewer can
actually go. Proved rather than guessed: a fivefold amplitude produced a
byte-identical PNG of the Central Valley.

It now measures the quantity instead of inferring it. `fwidth` of the detail UV
is exactly how much of one repeat a pixel covers, so its reciprocal is the
repeat's width in pixels — independent of board scale, exaggeration, field of
view, viewport and device pixel ratio, all five of which the old form was
guessing at. Off under 2 px, full over 8: the same thresholds the stand-off study
arrived at, without any of its assumptions. The geometric mean of the two axes
floored at an eighth of the larger, because that is what `anisotropy = 8`
resolves.

**2. The repeat went 220 m -> 440 m, and the recipe with it.** With the map
finally visible, the flat valley came out as a regular grid of four-pointed
stars, one per repeat, marching to the horizon. The cause is `tileableNoise` at a
`scale` of 2: below about 4, the blend's own wrapped cross-fade is the largest
feature in the tile. The layers now run 8 / 22 / 60 on a 128 lattice at 512², so
a repeat holds eight or so features instead of one and nothing in it is
identifiable. Mean slope 9.9°, peak 39.4°.

**3. The shore plate needed the map, not just the material.** A textured terrain
against a smooth plate makes the grid's stair-stepped rim legible — which is the
one thing `createShorePlates` exists to hide — and at San Francisco it came back
as a zigzag. Both now come out of one `groundMaterial`, which is two material
objects (the plate is a flat colour, the terrain a vertex ramp, and three
compiles those to different programs regardless) and the same one material per
mesh as before. The bytes of the detail map are built once and shared; the
`DataTexture`s are not, because `scene.ts` disposes a board by traversing it.

Zero new draw calls, unchanged: 437 at the whole-board pose, 348 at 7.7 km over
SF, 389 at 7.7 km over LA. Triangles unchanged to within the drift of the moving
vessels and aircraft.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-24 20:13:35 -07:00
..