GalaxyJS 3.4.0 "Optics" — an optional three.js tier + 6 scenes (80 → 86) - #6
Merged
Conversation
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.
What's in it
Six new animations (80 → 86) on a new, optional three.js tier. The library still has zero required dependencies.
registerAnimationnow acceptsrenderer: "three", andregisterThree(name, { defaults, scene })gives a scene the same lifecycle every other animation gets. three.js is fetched by dynamicimport()the first time such a scene mounts — once per page, shared by all six. A page that never mounts one requests nothing. If the load fails, the surface paints a still poster, exactly as the WebGL2 tier degrades when WebGL2 is missing.Each of the six does something the 2D and fragment-shader tiers genuinely cannot:
eventHorizond²u/dφ² = -u + 3/2·rs·u²) — photon ring, Einstein ring and the lensed far side of the disk emerge from the geodesics; Doppler beaming (I ∝ δ⁴) gives the real asymmetrymolecularCloudData3DTextureraymarched in local space, lit from within by an embedded protostar via a secondary Beer–Lambert shadow ray + Henyey–Greenstein phase — true parallax and self-occlusionspiralForgeringedWorldgravitySimstarGlareAlso fixed
A shader whose program failed to build crashed instead of falling back.
glPosterFallbackreached for the 2D context unconditionally, but a canvas that already has a live WebGL2 context can never hand one back — so the "graceful" path threwCannot set properties of null. This affected the WebGL2 tier as shipped in 3.3.0, not just the new one. The poster now paints the host element with the equivalent CSS gradient when there is no 2D context.Verification
npm run validategreen: manifest → lint (0 errors) → minify →test.mjs→test-mcp.mjsprefers-reduced-motionall six paint a real still frame with zero rAF ticks; with three.js unreachable all six fall back to a poster with no throwsCounts
86 animations — 2D 72 · WebGL2 8 · three.js 6 (optional). Also adds the PR/issue templates and dependabot config, which existed locally but had never been pushed.