fix(bodies): register every body texture on its prime meridian#508
Merged
Conversation
`uvSphereMesh` emitted u = lon/2π, putting u=0 on the local +x axis the IAU rotation aims a body's prime meridian at. Standard equirectangular maps paint longitude 0 at the image CENTRE, so every body riding the shared sphere rendered its surface 180° round about the pole — visibly, on the tidally locked Moon, which showed its far side to Earth. Earth escaped it: `cubeSphereMesh` bakes the registration offset already, and the cloud deck compensated with a hand-rolled +0.5 in its fragment shader. Bake the offset into `uvSphereMesh` instead, from the same constant, and drop the shader patch — one convention, one site per mesh. u runs 0.5..1.5 unwrapped so the samplers' `repeat` addressing closes the turn, keeping the quad derivatives continuous across the antimeridian. The constant is no longer Earth's, so `EARTH_TEXTURE_PRIME_MERIDIAN_U` becomes `TEXTURE_PRIME_MERIDIAN_U` (via `npm run refactor`). Picks up and removes the `body-texture-meridian-registration` backlog item, whose "no observable consequence today" reading missed that tidal locking is itself a rotational-phase ground truth. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
skymap | 6b557a4 | Commit Preview URL Branch Preview URL |
Jul 24 2026, 11:13 PM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Moon showed its far side to Earth.
Root cause
uvSphereMeshemittedu = lon / 2π, putting u=0 on the local +x axis the IAU rotation aims a body's prime meridian at. Every standard equirectangular map — Solar System Scope, USGS, Blue Marble — paints longitude 0 at the image centre (u=0.5). So the shared sphere sampled the map's antimeridian where the prime meridian should be: the whole surface 180° round about the pole, on all twelve bodies riding that mesh (Moon, Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune, the four Galileans).Confirmed against the asset: in
moon-2048.jpgthe maria sit dead centre and the far-side cratering is at the edges. The Moon is tidally locked, so its prime meridian points at Earth — which makes it the one body with a permanent rotational-phase ground truth, and the one where the bug is unmissable.Earth escaped it two different ways: its surface rides the Earth-only
cubeSphereMesh, which bakes the offset, and its cloud deck (on the shared sphere) compensated with a hand-rolled+0.5incloudShell/fragment.wesl.The fix
Bake the registration into
uvSphereMeshfrom the same constantcubeSphereMeshuses, and delete the cloud shader's patch — one convention, one site per mesh, instead of a per-shader correction that only the shaders someone noticed ever received.u runs 0.5→1.5 unwrapped rather than wrapping back into [0,1]: both samplers address u as
repeat, so the hardware closes the turn, and a mid-sphere whole-turn jump would break the fragment quad's derivatives at the seam (coarsest mip along a ~1px antimeridian line).The constant stops being Earth's, so
EARTH_TEXTURE_PRIME_MERIDIAN_U→TEXTURE_PRIME_MERIDIAN_Uand its file follows the symbol, both vianpm run refactor.Backlog
Picks up and removes
body-texture-meridian-registration(surfaced 2026-07-21 during the terminator fix, #472). Its deferral rested on "no other body has a rotational-phase ground truth" — tidal locking is one.Verification
npm run buildgreen (WESL relinks).🤖 Generated with Claude Code