Repository navigation
perf(milky-way): draw the far galaxy as 33 merged-copy layers so phones stop flickering - #1588
Merged
Merged
Conversation
… sky only once the camera stops" This reverts commit 8b63604.
… holds its three optical copies
…hone holds the far galaxy
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.
Change
On phones the Milky Way flickered (layers blinking out every other frame) and on the iPad it froze for about 200 ms when crossing into or out of the galaxy. Both came from the far galaxy drawing 390 full-screen layers: 52/52/26 slabs, each drawn three times as optical copies.
What changes:
--merged-copiesflag. The prepared volume declaresmergedOpticalCopies: 3and the bank's prototype records it, so a reused bank keeps it. Volume topology now tells merged and unmerged encodings apart.Body guide: Milky Way volume README.
Known limit, accepted by the owner on the phone: a merged copy is exact only for faint material. Face-on, an opaque pixel draws at a third and a half-opaque one at 0.29 instead of 0.5. That is 31% of the slabs' total alpha face-on and 0.8% at grazing views. The alternatives were measured and rejected: two layers per slab ran the phone out of tile memory again (56 to 62 frames with missing tiles), and fewer, thicker slabs (7/7/4) showed gaps between the sheets.
Prepared assets
node packages/bake/authoring/milky-way-dust/prepare-layers.mts --slabs-only). A second bake reproduced the inventory exactly, andCSSEARTH_GALAXY_FULL_REPLAY=1rebuilds all 33 slabs and 6 sky faces from the restored inputs byte for byte.node packages/bake/cli/publish-runtime-assets.mts --object=milky-way-volume);check-assets-publishedverifies every key live.inventory.json, and no baked files.Evidence and limits
Proves the change, same 8 s touch turn of the galaxy on the phone (Chrome traces):
Clean:
pnpm typecheck, eslint on the touched packages, galaxy bake tests with the CI-pinned NumPy 2.5.4 and Pillow 13.0.0, renderer volume and universe tests, objects volume tests (369 passed),check-prepared-delivery,check-no-variables,check-no-hashes,check-color-spelling,typescript-ownership.The phone still drops about 5% of frames on this view, the same as before #1581. That remaining cost is the star labels: about 240 composited labels restyled every frame. It's separate work.