diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8600572..6c6cd8b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,3 +13,4 @@ jobs: node-version: '24' - run: npx prettier --check . - run: npx eslint . + - run: node --test tests/*.test.js diff --git a/AGENTS.md b/AGENTS.md index 0310a96..9a0cd37 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -46,16 +46,25 @@ Comments are part of the standard — treat them as required, not optional. See the stack section below for the exact doc-comment syntax in this repo's language. -## Stack: Vanilla JS +## Stack: Vanilla JS + Three.js (WebGPU) - No build step. Open `index.html` directly, or serve the folder: `npx serve .` / `python3 -m http.server`. -- Plain ES modules: no bundler, no framework. Keep it dependency-free. +- Plain ES modules: no bundler, no framework, no `package.json`. +- **Three.js is the one allowed runtime dependency.** It is pinned to an exact version in + the import maps (`webgpu/index.html`) and loaded from a CDN. Keep everything else + dependency-free, and when bumping Three.js change every import map in one commit. +- `webgpu/` is the primary renderer and `canvas/` is the fallback. `legacy/` is kept for + reference and is not maintained. - Format with Prettier: `npx prettier --check .` (run `--write` to fix). - House style with ESLint: `npx eslint .` (run `--fix` to fix). Enforces the - "breathing" layout Prettier can't — a blank line before a function's final + "breathing" layout Prettier can't: a blank line before a function's final expression, between class members, and around declaration groups. -- Shared logic lives in `shared/`; entry points stay thin. +- Unit tests: `node --test tests/*.test.js`. +- Shared logic lives in `shared/`; entry points stay thin. Look definitions live only in + `shared/looks.js`. +- Shaders are TSL. Read the "Shader pitfalls" in `docs/ARCHITECTURE.md` before editing + them (shared nodes across `If` branches, `pow` with negative bases, seeded buffers). ## Before you finish diff --git a/CHANGELOG.md b/CHANGELOG.md index 10e9ac2..29da93d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- WebGPU renderer (`webgpu/`) built on Three.js and TSL: a true 3D globe with a real sun and terminator, a ray-marched atmosphere, living clouds with shadows, ocean glint, relief, procedural city lights, aurora, a lit moon, orbit rings with satellites and shooting stars. +- Five switchable looks, cross-faded live without recompiling shaders: Realistic, Cartoon, Neon, Hologram and Ink & Paper. Choose one with the new look lenses, `?look=`, or the `look` scene setting. +- GPU compute particles: impact sparks in a ring buffer and about 40k ambient orbital motes, advected entirely by compute kernels. +- One-time GPU bakes of the static planet fields (biomes, relief, ocean, clouds, sky), so the globe shader only samples textures. +- Bloom, chromatic fringe, scanlines, vignette and grain as a per-look post-processing pipeline. +- New `look`, `clouds` and `bloom` scene settings. The schema is now version 2, and fields can be scoped to renderers with `renderers: [...]`. +- Landing page with a live globe in a frame and a look picker that re-dresses the whole page. +- `shared/looks.js`, the dependency-free single source of truth for the looks. +- Unit tests for the scene schema and look data (`node --test tests/`). - Initial project scaffold from [Studio51 Standards](https://github.com/studio51/standards). - Cinematic arrival (`intro`): ~3.2s choreographed bloom on load (nebula → stars → sphere → atmosphere → land → night/aurora/orbits → beams), with rotation easing in from stillness. - Six cinematic canvas layers: orbiting moon, rare comet, shimmering constellations, ocean sun glint, HQ heartbeat wave, and city surges. @@ -18,6 +27,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Refreshed interface: glass panels, a settings drawer, look lenses, and a redrawn brand. Every surface themes itself per look (glass, chunky cartoon cards, neon, hologram wireframe, paper and ink), and the Canvas fallback shares the same chrome. +- The root page is now a landing page for the WebGPU renderer. The Canvas 2D renderer is the automatic fallback and keeps your URL options. +- The Canvas renderer hides settings it cannot draw (the schema marks them by renderer). +- Orbit now depends on Three.js (pinned, loaded from a CDN through an import map), the one allowed runtime dependency. AGENTS.md and the docs say so. +- The SVG renderer moved to `legacy/svg/` and is no longer maintained. - Canvas renderer performance: zero trig in the hot loops (precomputed sin/cos with angle-sum projection), tier-sorted land dots drawn as contiguous runs, low-res offscreen terminator upscaled to screen, and cached GeoJSON rebuilt only when the sun moves. - Adaptive quality in `BaseEngine`: an EMA of frame time nudges a dpr multiplier (down to 0.55) with cooldown hysteresis so weak GPUs get a softer image instead of dropped frames. - Richer visuals: deeper offset-lit ocean, wider atmospheric rim with a crisp shell line, 4-layer beams, twin impact rings, 3-pass aurora, warmer city lights. diff --git a/README.md b/README.md index f113cd0..b0bd570 100644 --- a/README.md +++ b/README.md @@ -2,24 +2,24 @@ # Orbit -> A real-time 3D globe that visualizes live activity as luminous beams arcing across the Earth — extracted from games.directory as a standalone, drop-in widget. +> A real-time 3D globe that visualizes live activity as luminous beams arcing across the Earth, extracted from games.directory as a standalone, drop-in widget. [![License: MIT](https://img.shields.io/badge/license-MIT-blue)](LICENSE) [![CI](https://github.com/studio51/orbit/actions/workflows/ci.yml/badge.svg)](https://github.com/studio51/orbit/actions/workflows/ci.yml) Orbit is the centerpiece hero globe for the [games.directory](https://games.directory) landing page, packaged here as a self-contained plugin with no dependencies on -the rest of the site. Clone it, serve it, and play with the live controls — or +the rest of the site. Clone it, serve it, and play with the live controls, or drop it into your own page and point it at your own HQ, cities, and activity -types. It ships **rendered two ways**, Canvas 2D (recommended) and SVG, over one -shared core, with a day/night terminator, aurora, parallax starfield, meteors, -and more — all tunable live. +types. It renders on **WebGPU** (a true 3D sphere with GPU compute particles) in five +switchable looks, and falls back to Canvas 2D where WebGPU is unavailable. ## Docs - [Architecture](docs/ARCHITECTURE.md) - [Install & setup](docs/INSTALL.md) - [Usage](docs/USAGE.md) +- [Looks](docs/LOOKS.md) - [Changelog](CHANGELOG.md) - [Contributing](CONTRIBUTING.md) - [Security](SECURITY.md) diff --git a/canvas/index.html b/canvas/index.html index 9866138..ebadfb8 100644 --- a/canvas/index.html +++ b/canvas/index.html @@ -4,10 +4,14 @@ Orbit · Activity Globe (Canvas) + @@ -23,17 +27,17 @@
-
g
+
Orbit
-
Live activity · worldwide
+
Live activity, worldwide