3D engine that AI agents drive
Refresh CodePawl site, searchable guides and interactive showcases
Nguyen Xuan An55ca3bd12aa9
diff --git a/.gitignore b/.gitignoreindex c2f6b658..62b8a0c8 100644--- a/.gitignore+++ b/.gitignore@@ -5,6 +5,8 @@ build/public/releases/public/release.jsonpublic/changelog.md+public/guide.md+public/gltf.mdartifacts/.env.env.*diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 615dff56..7c5d3896 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -1,5 +1,16 @@# Changelog+## 0.3.1++- Rebuild the homepage around the scene-to-film workflow and a real video showcase.+- Add searchable documentation, a plain-text guide and an AI agent entry point.+- Align site surfaces with CodePawl and add a transparent outline block logo and local SVG icons.+- Add WALL·E camera compositions, lighting presets, assembly playback and PNG capture.+- Add nature light presets and HDR grading, clockwork detail, appearance controls and frame capture.+- Build a timber footbridge with planks, fasteners, rails and a dedicated viewpoint in Silverwater valley.+- Replace the asset viewer placeholder with an imported clockwork GLB study.+- Reflow object controls below the canvas on mobile and allow studio navigation to wrap.+## 0.3.0- Introduce deterministic keyframe animation and persistent instance updates.diff --git a/README.md b/README.mdindex 7d186b54..c759cd4e 100644--- a/README.md+++ b/README.md@@ -1,5 +1,9 @@# 67.js+**Your 3D scene, from browser to film.**++Explore the [showcase](https://67js.codepawl.com), read the [documentation](https://67js.codepawl.com/docs.html), or give an agent the [plain-text guide](https://67js.codepawl.com/llms.txt).+67.js is a JavaScript graphics engine for interactive worlds, animated models and cinematic media in the browser.Meshes, materials and cameras give Three.js users a familiar foundation. Scene studios, assembly inspection and image/video export extend that foundation into a production workflow.diff --git a/assets.html b/assets.htmlindex 8dcbd01c..865948be 100644--- a/assets.html+++ b/assets.html@@ -5,6 +5,7 @@<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="description" content="Load a GLB asset into 67.js, inspect its materials and scrub rigid node animation." /><title>Asset viewer · 67.js</title>+ <link rel="icon" href="/favicon.svg" /></head><body><main class="workspace">@@ -16,7 +17,7 @@<button data-view="front" aria-pressed="false">Front</button><button data-view="right" aria-pressed="false">Right</button><button data-view="top" aria-pressed="false">Top</button>- </nav>+ <a href="./docs.html">Docs</a><a href="./index.html#examples">Showcase</a></nav><div class="toolbar-actions"><button id="fit">Fit</button><button id="open" class="primary">Open GLB</button></div><input id="file" type="file" accept=".glb,model/gltf-binary" hidden /></header>diff --git a/docs.html b/docs.htmlnew file mode 100644index 00000000..bd18a9ac--- /dev/null+++ b/docs.html@@ -0,0 +1,9 @@+<!doctype html>+<html lang="en">+<head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><meta name="description" content="67.js documentation: scenes, materials, cameras, animation, GLB assets, CPU/GPU media export and AI agent workflows."/><title>Documentation · 67.js</title><link rel="icon" href="/favicon.svg"/></head>+<body>+<a class="skip-link" href="#content">Skip to content</a>+<aside class="navigation"><a class="brand" href="/">67<span>.js</span></a><p class="library-description">By CodePawl</p><span class="version" data-release-version>Loading release</span><nav aria-label="Library"><a href="/">Showcase</a><a href="/getting-started.html">Getting started</a><a href="/docs.html" aria-current="page">Documentation</a><a href="/#downloads">Downloads</a></nav><p class="navigation-note"><a href="https://codepawl.com">A CodePawl project ↗</a></p></aside>+<main id="content" class="docs docs-page"><header><h1>Build with 67.js</h1><p>From your first part to an interactive scene and a finished film.</p></header><label class="docs-search" for="doc-search">Find a topic <input id="doc-search" type="search" placeholder="Materials, memory, agents…" autocomplete="off"/></label><p id="doc-results" role="status"></p><div class="docs-layout"><nav id="doc-toc" aria-label="Documentation topics"></nav><article id="doc-article"></article></div><p class="release-links"><a href="/guide.md" data-icon="book">Download plain-text guide</a><a href="/llms.txt" data-icon="code">Guide for AI agents</a></p><noscript><p>Read the <a href="/guide.md">complete plain-text guide</a> with JavaScript disabled.</p></noscript></main>+<script type="module" src="/src/documentation.js"></script>+</body></html>diff --git a/docs/guide.md b/docs/guide.mdnew file mode 100644index 00000000..91f6d460--- /dev/null+++ b/docs/guide.md@@ -0,0 +1,221 @@+# 67.js guide++Build a scene once. Make it interactive. Export the frame or film.++67.js is a WebGL2 graphics toolkit with shared geometry, deterministic animation and a bounded media pipeline. It is not API-compatible with Three.js and does not provide a Blender-style modeling editor.++## Install++```sh+npm install 67js@npm:@codepawlhq/67js+```++The alias lets your application import `67js`. Without the alias, import `@codepawlhq/67js`. Use a package-aware development server such as Vite. The homepage's release command pins the published version.++Its browser module is a bundled ES module served with CORS headers. A local checkout can be newer than the published package. Check `VERSION` and `release.json` before using a feature.++## Parts and geometry++A scene is an array of parts. Each part has a unique `name`, a shared `geometry`, a column-major 16-value `Float32Array` `matrix`, and a `material`.++Geometry uses `Float32Array` positions and normals, and `Uint32Array` triangle indices. Normals must have unit length and triangles face outward. Optional `uvs` have two values per vertex. Optional `colors` are opaque linear RGB.++Transforms must be finite and invertible. Use one geometry object for repeated parts, rather than creating identical meshes for every instance. Each geometry and texture descriptor identity pair becomes an instanced batch.++```js+import { Renderer67, box } from '67js';+const geometry = box(0.08, 4);+const parts = [{+ name: 'Rounded cube', geometry,+ matrix: new Float32Array([1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1]),+ material: { color: [0.3,0.42,0.55], metallic: 0.7, roughness: 0.3, emission: 0, tag: 'surface' },+}];+const renderer = new Renderer67(canvas, parts, {+ ground: false, hdr: true, samples: 4, pixelRatio: 1.25, memoryBudgetMiB: 256,+});+renderer.render({ eye: [3,2,4], target: [0,0,0] });+```++Supply a real HTML canvas with nonzero CSS width and height. The example assumes `canvas` refers to that element. `box(fillet, samples)`, `cylinder(segments)`, `sphere(segments, rings)` and `torus(tubeRadius, segments, sides)` are core primitives. Inspect the supplied demos for dimension and transform conventions.++## Materials and color++`color` and `emissiveColor` are linear RGB. `metallic` and `roughness` describe the PBR surface. `emission` sets emission intensity. `material.map` is a decoded texture descriptor with an image, UV channel 0, color space and supported sampler settings.++The optional GLB addon creates these descriptors. HDR requires `EXT_color_buffer_float`. Inspect `renderer.capabilities.hdr` and `hdrFallbackReason`. The renderer falls back when floating-point targets are unavailable.++Tags select specialized behavior: `armor` allows studio finish overrides. `floor` is a studio floor. `water` adds animated normals and ripples. `foliage` and `grass` add wind.++`terrain` adds surface variation. `fire` and `smoke` support film effects. `unlit` is a flat color. Other tags use ordinary PBR shading.++## Renderer reference++`new Renderer67(canvas, parts, options)` owns GPU geometry, texture and target allocations. Constructor options:++| Option | Default | Purpose |+| --- | --- | --- |+| batching | true | Share instance batches by geometry and map identity |+| pixelRatio | 1.5 | Render scale relative to CSS size. Not automatically devicePixelRatio |+| ground | true | Add the studio floor. Disable for worlds, 2D and assets |+| world | false | Enable outdoor rendering and world clipping defaults |+| samples | 4 | Requested MSAA count. Negotiated against hardware |+| hdr | false | Request floating-point color targets |+| memoryBudgetMiB | 256 | Estimated render allocation budget |+| environment | {} | Sky, light and fog settings |+| shadowBounds | {} | Custom extent, eye and target for shadow framing |+| benchmark | false | Diagnostic flat shader. Not the appearance renderer |++`render(frame)` draws synchronously. `resize()` replans targets after CSS size or `pixelRatio` changes. `updateParts(parts, { shadows: true })` uploads changed matrices and materials using retained buffers. It does not add new part, geometry or texture identities.++Construct a new renderer for a new graph. `dispose()` releases owned resources.++Read `memoryPlan` for actual width, height, estimatedBytes and reduced status. `capabilities` for HDR and MSAA negotiation. `triangles`, `batches.length` and `cpuMilliseconds` for diagnostics. CPU submission time is not GPU frame time.++## Cameras and framing++A perspective frame supplies `eye`, `target`, optional `up`, `fov` in degrees, `near` and `far`. Set `projection: 'orthographic'` and `orthographicHeight` for axis views. Clipping planes must satisfy `0 < near < far`.++`cameraView('front' | 'right' | 'top' | 'perspective', { target, height, distance })` creates an axis camera. `fitOrthographicHeight(bounds, view, aspect, padding)` frames the bounds without cropping. Bounds have `minimum` and `maximum` vectors. Flat 2D uses XY geometry, the `unlit` tag and a front orthographic camera.++The canvas2d addon supplies a reusable poster scene.++## Effects and lighting++```js+renderer.render({+ eye: [3,2,4], target: [0,0,0], exposure: 1,+ effects: {+ bloom: { strength: 0.18, threshold: 0.9, radius: 1.2 },+ saturation: 1, contrast: 1.04, temperature: 0.03, vignette: 0.12, grain: 0,+ },+});+```++`EFFECT_PRESETS` provides ready-made looks. `resolveEffects` validates and resolves settings. Bloom uses retained half-resolution targets included in the memory estimate. Start with neutral settings and small changes.++Bloom cannot recover missing geometry or lighting detail.++Outdoor `environment` accepts `skyTop`, `skyBottom` (display RGB), `fogColor` (linear RGB), `fogDensity`, `lightDirection` and `daylight`. Set `world: true` and `ground: false`. Frames can override environment and supply `time`, `wind`, `waterRipple` and `rippleTime`.++## Deterministic animation++```js+import { createAnimationClip, createAnimationPlayer } from '67js';+const clip = createAnimationClip({ duration: 2, tracks: [{+ target: 'Rounded cube', property: 'translation', interpolation: 'SMOOTH',+ keyframes: [{ time: 0, value: [0,0,0] }, { time: 2, value: [0,1,0] }],+}] });+const player = createAnimationPlayer(clip, parts);+player.apply(1);+renderer.updateParts(parts);+renderer.render({ eye: [3,2,4], target: [0,0,0], time: 1 });+```++Tracks target unique part names. Supported transform tracks are translation, rotation (quaternion XYZW) and scale. Material tracks include metallic, roughness and emission. Interpolation is LINEAR, STEP or SMOOTH.++`sampleAnimationClip(clip, time)` returns samples without binding parts. Preserve the original graph and apply absolute time so seeking backwards reproduces the scene. Use `requestAnimationFrame` for playback, pause when hidden, and use a fixed sample time for export.++## Assemblies and interaction++Explodable parts include `assembly: { layer: 'exterior' | 'interior', section, offset: [x,y,z], detailOffset: [x,y,z] }`. Base matrices stay assembled. A frame's `assemblyAmount` goes from 0 to 1. Section offsets separate first, small detail offsets separate later.++`assemblyOffset(part, amount)` returns the same offset for export. Filter parts by layer and recreate the renderer after disposing its predecessor.++The object studio implements pointer capture for orbit, wheel zoom, keyboard arrows and a slider. Render only after a change when the scene is static. Use a ResizeObserver to call `resize()` and redraw. Offer keyboard controls and honor `prefers-reduced-motion`.++## Import and export models++```js+import { loadGltf } from '67js/addons/gltf';+const asset = await loadGltf('/model.glb');+const renderer = new Renderer67(canvas, asset.parts, { ground: false, hdr: true });+if (asset.animations.length) renderer.updateParts(asset.applyAnimation(1));+renderer.render({ eye: [3,2,4], target: [0,0,0] });+// Close in this order: renderer.dispose(); asset.dispose();+```++Supported: standard opaque meshes, UV base-color PNG/JPEG textures, vertex colors, emissive color and rigid node animation. Unsupported: skinning, morph targets, transparent or double-sided materials, compressed geometry and additional PBR maps. The optional decoder uses Three.js GLTFLoader, not its renderer. Read the [asset contract](/gltf.md) before choosing a model.++Core `exportGlb(parts)` returns GLB geometry. This geometry exporter is not a full texture/animation round-trip. For exploded output, apply `assemblyOffset` to copied matrices. Use the browser demo's PNG controls for a still.++Render immediately before canvas capture.++## Images and films++Offline media commands run from the repository checkout, not from an installed npm package. Install checkout dependencies and provide Chrome and FFmpeg. The exporter reports missing tools. On Windows it uses Chrome's standard install path and `~/.local/bin/ffmpeg.exe`.++```sh+npm run render -- --scene motion --kind image --backend gpu --time 3 --output artifacts/frame.png+npm run render -- --scene motion --kind video --backend gpu --encoder cpu --preset balanced --duration 12 --fps 24 --memory 384 --output artifacts/film.mp4+npm run render -- --scene motion --kind video --backend cpu --preset cpu --aspect portrait --duration 2 --output artifacts/cpu-trial.mp4+```++Scenes: object, nature, film, motion, view2d and assets. Use `--assembly 1` for object inspection. `--asset path/model.glb` with assets. `--start` for a timeline range.++`--aspect` supports landscape, portrait and square. `--width` and `--height` set dimensions (even dimensions for video). `--encoder gpu` requires NVENC. GPU rasterization and GPU encoding are independent.++Select original film audio with `--audio`. Other scenes default to silent.++Presets: preview 960×540 / 2 samples / 24fps / 256MiB. Balanced 1280×720 / 4 / 24 / 384MiB. High 1920×1080 / 4 / 24 / 512MiB. Cpu 640×360 / 1 / 12 / 192MiB.++Export one short trial before a full film. Inspect output JSON and FFprobe for backend, dimensions, duration, frame count and audio.++## Performance and memory++Reuse geometry and decoded textures. Do not create a renderer per frame. Change existing transforms through `updateParts`. Use lower scene detail before increasing the budget.++Pause hidden scenes and avoid simultaneous GPU exports. For static previews, redraw on demand.++The planner includes geometry, textures and mipmaps, shadows, MSAA, HDR, bloom and one capture staging frame. It reduces render dimensions when necessary. The exporter keeps one pending capture and respects encoder backpressure. This is an estimated allocation budget, not a hard process RAM/VRAM cap.++Driver/browser allocations can still fail. Sampled browser JS heap and Node RSS do not measure total graphics memory.++## Lifecycle and troubleshooting++WebGL2 unavailable: enable hardware acceleration or choose a supported browser. CPU export can use SwiftShader. Jagged edges: inspect actual render size and negotiated samples. Increase pixelRatio only within the budget.++Blown highlights: lower exposure and bloom, check linear color values. Missing asset: inspect its unsupported-feature error and convert the asset to the supported subset. Memory error: reduce resolution, MSAA, textures or scene detail. Context loss: stop playback, dispose the renderer and recreate on restoration.++Release mismatch: compare VERSION and homepage release metadata.++Disconnect observers, cancel animation frames, release pointer state and call `dispose()` on page/component teardown. Dispose decoded assets after the renderer. Keep errors visible. Do not silently substitute a different asset.++## Models and AI agents++Give the agent this guide and [/llms.txt](/llms.txt). Start with a scene brief: focal subject, visual references, camera, output size, required interaction, GPU/CPU backend and memory budget. Read the matching scene recipe and run the smallest trial first.++Suggested prompt: “Use 67.js to build an interactive mechanical study. Reuse meshes, use a 256MiB render budget, provide orbit and keyboard controls, pause hidden playback, and capture a real wide and mobile preview. List unsupported features. Do not claim speed superiority without a comparable benchmark.”++Agent workflow: inspect the installed `VERSION` and supported exports. Create finite invertible transforms. Share geometry identities. Validate bounds.++Render and inspect edges/highlights. Exercise interactions. Run project tests. Export one deterministic frame.++Report actual dimensions and estimated memory separately from observed process metrics. Never infer visual quality from successful compilation.++Repository skills: `skills/build-67js-scene/SKILL.md` and `skills/render-67js-media/SKILL.md` contain the scene and media procedures. Copy or reference them in your agent's skill system. They are also included in the npm archive. A model can use the plain-text guide without a skill runtime.++## Addons and limits++Core exports are available from `67js`:++| Export | Purpose |+| --- | --- |+| VERSION | Build version from the package metadata |+| Renderer67 | WebGL2 rendering and owned GPU resources |+| box, cylinder, sphere, torus | Shared primitive geometry |+| exportGlb | Geometry and basic material export |+| RENDER_PRESETS | Dimensions, MSAA, FPS and budgets for media |+| planRenderSize | Plan dimensions against the estimated allocation budget |+| estimateFrameBytes | Estimate targets and staging for a frame |+| assemblyOffset | Compute section and small-detail displacement |+| cameraView, fitOrthographicHeight | Axis cameras and fitted bounds |+| EFFECT_PRESETS, resolveEffects | Named looks and validated effect settings |+| createAnimationClip, sampleAnimationClip, createAnimationPlayer | Validate tracks, sample time and bind part animation |++`planRenderSize` accepts width, height, pixelRatio, samples, memoryBudgetMiB, geometryBytes, textureBytes, hdr, bloom, shadowResolution and maximumSize. It returns actual dimensions, estimatedBytes and reduced status. `estimateFrameBytes(width, height, samples, shadowResolution, { hdr, bloom })` estimates target storage. Neither function measures total VRAM.++`67js/addons/model`: createModel. `67js/addons/nature`: createNatureWorld. `67js/addons/film`: deterministic film recipes. `67js/addons/motion`: createMotionScene.++`67js/addons/canvas2d`: 2D recipes. `67js/addons/gltf`: optional asset decoding. These are separate imports to keep the core smaller.++67.js currently targets WebGL2. There is no WebGPU backend, general physics engine, mesh editor, skeletal animation or Blender-style authoring UI. Adaptive quality, GPU timing and picking are roadmap work. See the homepage's release files for the installed version and the roadmap for planned behavior.diff --git a/docs/site-verification.md b/docs/site-verification.mdnew file mode 100644index 00000000..fb1d61c2--- /dev/null+++ b/docs/site-verification.md@@ -0,0 +1,26 @@+# Website and showcase verification++## 0.3.1++The site uses CodePawl's neutral light/dark surfaces, focus colors and rounded panels. The 67.js mark is a transparent outline block. Navigation icons are local SVGs.++The documentation interface reads `docs/guide.md`. Release preparation copies that source into the plain-text download. The site also serves `llms.txt` for models and agents. The package includes the guide and both scene/media skills.++Measured checks:++- 64 Node tests passed, including scene bounds, geometry winding, animation and render budget checks.+- The site check exercised nine routes at 1440, 390 and 320 pixels. No horizontal page overflow remained.+- Mobile object and nature controls stayed below their canvases. Titles stayed above the canvases.+- Documentation search, empty results and topic anchors worked.+- Object compositions, lighting, PNG export and assembly playback worked. Reduced motion used a static assembly toggle.+- Motion looks, portrait framing, deterministic seeking and PNG export worked.+- Nature lighting presets worked. Existing wind, viewpoints, detail, water ripples and keyboard controls passed regression checks.+- The object regression covered layer switching, exploded exports, resource reuse, context restoration and keyboard orbit.+- Landscape and portrait H.264 films each contain 288 frames over 12 seconds at 24fps. Export kept one pending frame.+- Seven gallery WebP previews total 297880 bytes. Their source PNGs remain available separately.++Interface review covered the changed homepage, documentation, object and nature studios, and the shared navigation in the motion studio. Generated bundles and binary media were excluded from source review. Rendered review found wrapping navigation, a swatch override and controls overlapping mobile content. These causes were corrected and checked again.++Layout and native keyboard/control semantics were checked. Screen-reader operation, RTL, 200% browser zoom and formal contrast measurement were not verified. Typography, writing and color were checked only within the edited sources and rendered states. This is not a full accessibility certification.++The motion film used hardware WebGL and NVENC on an RTX 3060. Reported graphics allocations are estimates. They do not measure total browser RSS or driver VRAM.diff --git a/film.html b/film.htmlindex 1b4fd89a..8a8e39a4 100644--- a/film.html+++ b/film.html@@ -6,6 +6,7 @@<meta name="theme-color" content="#080909" /><meta name="description" content="CRITICAL. An original 32-second cinematic short rendered in 3D by 67.js." /><title>CRITICAL · A 67.js short</title>+ <link rel="icon" href="/favicon.svg" /></head><body><main class="film-stage" aria-label="CRITICAL, an original 3D short film">@@ -21,7 +22,7 @@<nav aria-label="Explore 67.js"><a href="./nature.html">Nature</a><a href="./object.html">Object</a>- </nav>+ <a href="./docs.html">Docs</a><a href="./index.html#examples">Showcase</a></nav></header><section class="transport player-interface" aria-label="Film playback"><div class="transport-actions">diff --git a/getting-started.html b/getting-started.htmlindex f7c05333..3098d494 100644--- a/getting-started.html+++ b/getting-started.html@@ -6,20 +6,21 @@<meta name="theme-color" content="#191d22" /><meta name="description" content="Install the current 67.js release and draw a cube with Renderer67." /><title>Getting started · 67.js</title>+ <link rel="icon" href="/favicon.svg" /></head><body><a class="skip-link" href="#content">Skip to content</a><aside class="navigation"><a class="brand" href="./index.html" aria-label="67.js home">67<span>.js</span></a>- <p class="library-description">JavaScript graphics engine</p>+ <p class="library-description">Graphics toolkit by CodePawl</p><span class="version" data-release-version>Loading release</span><nav aria-label="Library"><a href="./index.html#examples">Examples</a>- <a href="./getting-started.html" aria-current="page">Getting started</a>+ <a href="./getting-started.html" aria-current="page">Getting started</a><a href="./docs.html">Documentation</a><a href="./index.html#downloads">Downloads</a><a data-release-tarball aria-disabled="true">Package source <span aria-hidden="true">↓</span></a></nav>- <p class="navigation-note">Built with WebGL2<br />Scenes made from geometry</p>+ <p class="navigation-note"><a href="https://codepawl.com">A CodePawl project ↗</a><br /><a href="./llms.txt">For models and agents</a></p></aside><main id="content" class="docs"><header class="introduction"><div><h1>Draw your first scene</h1><p>Install a release, create a part and give the renderer a camera</p></div></header>diff --git a/index.html b/index.htmlindex f8fc6deb..5deef04f 100644--- a/index.html+++ b/index.html@@ -6,48 +6,48 @@<meta name="theme-color" content="#191d22" /><meta name="description" content="67.js is a browser graphics engine for interactive scenes and cinematic media. Explore demos, install a release and start building." /><title>67.js · JavaScript graphics engine</title>+ <link rel="icon" href="/favicon.svg" /></head><body><a class="skip-link" href="#content">Skip to content</a><aside class="navigation"><a class="brand" href="./index.html" aria-label="67.js home">67<span>.js</span></a>- <p class="library-description">JavaScript graphics engine</p>+ <p class="library-description">Graphics toolkit by CodePawl</p><span class="version" data-release-version>Loading release</span><nav aria-label="Library"><a href="#examples" aria-current="page">Examples</a>- <a href="./getting-started.html">Getting started</a>+ <a href="./getting-started.html">Getting started</a><a href="./docs.html">Documentation</a><a href="#downloads">Downloads</a><a data-release-tarball aria-disabled="true">Package source <span aria-hidden="true">↓</span></a></nav>- <p class="navigation-note">Built with WebGL2<br />Scenes made from geometry</p>+ <p class="navigation-note"><a href="https://codepawl.com">A CodePawl project ↗</a><br /><a href="./llms.txt">For models and agents</a></p></aside><main id="content">- <header class="introduction">- <div><h1>Graphics for interactive worlds and films</h1><p>Create meshes, materials and cameras, then animate scenes and render media in one workflow. Shared geometry and explicit memory budgets guide the renderer.</p></div>- <a class="start-link" href="./getting-started.html">Build your first scene <span aria-hidden="true">↗</span></a>- </header>+ <header class="introduction"><div><h1>Your 3D scene,<br />from browser to film</h1><p>67.js brings browser 3D, animation and image/video export into one workflow. Create interactive experiences and export the same scene as images or video</p><div class="hero-actions"><a href="./object.html" data-icon="cube">Try the object studio</a><a href="./getting-started.html" data-icon="code">Build your first scene</a></div></div></header>+ <section class="feature-showcase" aria-label="67.js rendered animation showcase"><video controls playsinline preload="none" poster="./previews/motion.webp" width="960" height="540"><source src="./media/clockwork.mp4" type="video/mp4"/><p>Your browser cannot play this film. <a href="./motion.html">Open the interactive scene</a>.</p></video><div class="showcase-caption"><div><h2>Clockwork orbit</h2><p>A real 67.js render. Open the scene to scrub time and change the frame.</p></div><a href="./motion.html" data-icon="film">Explore the scene</a></div></section>+ <section class="workflow" aria-label="What you can build"><div><span data-icon="cube"></span><h3>Build and inspect</h3><p>Shared meshes, materials and cameras. Pull a machine apart, explore a world, or bring your own GLB.</p></div><div><span data-icon="film"></span><h3>Make it move</h3><p>Sample keyframes at any time. Give visitors controls and keep the same timeline for your film.</p></div><div><span data-icon="image"></span><h3>Export the result</h3><p>Produce images and videos on GPU or CPU with explicit render budgets and one capture frame at a time.</p></div></section><section class="install" aria-label="Install the current release"><div class="install-label"><svg class="npm-icon" viewBox="0 0 24 24" aria-hidden="true"><path d="M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113z"/></svg><span>Install with npm</span></div><div class="command-row"><code data-install-command>Loading the release command…</code><button data-copy-install disabled>Copy command</button></div><div class="release-feedback"><p data-release-status role="status">◷ Loading release information</p><button data-release-retry hidden>Retry</button></div></section><section id="examples" class="examples" aria-labelledby="examples-title">- <h2 id="examples-title">Examples</h2>+ <h2 id="examples-title">Try it yourself</h2><p>Each showcase is a working scene with controls you can explore.</p><div class="gallery">- <a class="example" href="./object.html"><img src="./previews/wall-e.png" alt="WALL·E model rendered in 67.js" width="1280" height="720" fetchpriority="high" /><div class="example-caption"><h3>WALL·E</h3><span>Object studio <span aria-hidden="true">↗</span></span></div><p>Explore the model, change its finish and export the geometry</p></a>- <a class="example" href="./nature.html"><img src="./previews/nature.png" alt="A winding stream through Silverwater valley" width="1280" height="720" /><div class="example-caption"><h3>Silverwater valley</h3><span>Nature <span aria-hidden="true">↗</span></span></div><p>Move through the landscape and change the light and wind</p></a>- <a class="example" href="./film.html"><img src="./previews/film-contact.png" alt="Scenes from CRITICAL, a procedural 3D short film" width="1280" height="720" loading="lazy" /><div class="example-caption"><h3>CRITICAL</h3><span>Short film <span aria-hidden="true">↗</span></span></div><p>Watch a deterministic film with an original synthesized score</p></a>- <a class="example" href="./object.html?explosion=1"><img src="./previews/wall-e-exploded.png" alt="WALL·E assemblies separated to reveal the internal mechanisms" width="1280" height="720" loading="lazy" /><div class="example-caption"><h3>Inside the machine</h3><span>Exploded assembly <span aria-hidden="true">↗</span></span></div><p>Separate the assemblies to inspect the electronics and mechanisms</p></a>- <a class="example" href="./motion.html"><img src="./previews/motion.png" alt="A luminous clockwork mechanism animated from keyframes" width="960" height="540" loading="lazy" /><div class="example-caption"><h3>Clockwork orbit</h3><span>Animation <span aria-hidden="true">↗</span></span></div><p>Scrub keyframes, switch compositions and render a short film</p></a>- <a class="example" href="./view2d.html"><img src="./previews/view2d.png" alt="A flat orbital poster rendered through an orthographic camera" width="960" height="540" loading="lazy" /><div class="example-caption"><h3>Orbital field</h3><span>2D and views <span aria-hidden="true">↗</span></span></div><p>Pan a vector scene or inspect a model from front, right and top</p></a>- <a class="example" href="./assets.html"><img src="./previews/assets.png" alt="An imported geometric study displayed in the asset viewer" width="960" height="540" loading="lazy" /><div class="example-caption"><h3>Your models</h3><span>GLB assets <span aria-hidden="true">↗</span></span></div><p>Open a GLB, inspect its materials and sample node animation</p></a>+ <a class="example" href="./object.html"><img src="./previews/wall-e.webp" alt="WALL·E model rendered in 67.js" width="1280" height="720" fetchpriority="high" /><div class="example-caption"><h3>WALL·E</h3><span>Object studio <span aria-hidden="true">↗</span></span></div><p>Separate 574 parts, inspect the shell and machinery, and save your composition</p></a>+ <a class="example" href="./nature.html"><img src="./previews/nature.webp" alt="A winding stream through Silverwater valley" width="1280" height="720" /><div class="example-caption"><h3>Silverwater valley</h3><span>Nature <span aria-hidden="true">↗</span></span></div><p>Move through the landscape and change the light and wind</p></a>+ <a class="example" href="./film.html"><img src="./previews/film-contact.webp" alt="Scenes from CRITICAL, a procedural 3D short film" width="1280" height="720" loading="lazy" /><div class="example-caption"><h3>CRITICAL</h3><span>Short film <span aria-hidden="true">↗</span></span></div><p>Watch a deterministic film with an original synthesized score</p></a>+ <a class="example" href="./object.html?explosion=1"><img src="./previews/wall-e-exploded.webp" alt="WALL·E assemblies separated to reveal the internal mechanisms" width="1280" height="720" loading="lazy" /><div class="example-caption"><h3>Inside the machine</h3><span>Exploded assembly <span aria-hidden="true">↗</span></span></div><p>Separate the assemblies to inspect the electronics and mechanisms</p></a>+ <a class="example" href="./motion.html"><img src="./previews/motion.webp" alt="A luminous clockwork mechanism animated from keyframes" width="960" height="540" loading="lazy" /><div class="example-caption"><h3>Clockwork orbit</h3><span>Animation <span aria-hidden="true">↗</span></span></div><p>Scrub keyframes, switch compositions and render a short film</p></a>+ <a class="example" href="./view2d.html"><img src="./previews/view2d.webp" alt="A flat orbital poster rendered through an orthographic camera" width="960" height="540" loading="lazy" /><div class="example-caption"><h3>Orbital field</h3><span>2D and views <span aria-hidden="true">↗</span></span></div><p>Pan a vector scene or inspect a model from front, right and top</p></a>+ <a class="example" href="./assets.html"><img src="./previews/assets.webp" alt="An imported geometric study displayed in the asset viewer" width="960" height="540" loading="lazy" /><div class="example-caption"><h3>Your models</h3><span>GLB assets <span aria-hidden="true">↗</span></span></div><p>Open a GLB, inspect its materials and sample node animation</p></a></div></section><section id="downloads" class="downloads" aria-labelledby="downloads-title"><div class="section-heading"><h2 id="downloads-title">Downloads</h2><span data-release-version>Loading release</span></div><p>Use the package archive with npm, or import the bundled module directly in your browser</p><div class="download-links"><a class="download" data-release-tarball aria-disabled="true"><strong>Package archive</strong><span>Install with npm <span aria-hidden="true">↓</span></span></a><a class="download" data-release-module aria-disabled="true"><strong>Browser module</strong><span>Bundled ES module <span aria-hidden="true">↓</span></span></a></div>- <div class="release-links"><a href="./changelog.md">Changelog</a><span data-release-commit>Release commit</span><a data-release-api aria-disabled="true">API reference ↗</a></div>+ <div class="release-links"><a href="./docs.html">Documentation</a><a href="./llms.txt">For AI agents</a><a href="./logo.svg" download>Logo SVG</a><a href="./changelog.md">Changelog</a><span data-release-commit>Release commit</span><a data-release-api aria-disabled="true">API reference ↗</a></div></section></main><script type="module" src="/src/home.js"></script>diff --git a/motion.html b/motion.htmlindex 1b96ee79..80dc4319 100644--- a/motion.html+++ b/motion.html@@ -6,12 +6,13 @@<meta name="theme-color" content="#171c20" /><meta name="description" content="A deterministic 67.js animation with keyframe tracks and landscape, portrait and square compositions." /><title>Clockwork orbit · 67.js</title>+ <link rel="icon" href="/favicon.svg" /></head><body><main><header class="interface motion-header"><a class="brand" href="./index.html" aria-label="67.js home">67<span>.js</span></a>- <nav aria-label="Scenes"><a href="./object.html">Object</a><a href="./nature.html">Nature</a><a href="./film.html">Film</a><a href="./motion.html" aria-current="page">Motion</a></nav>+ <nav aria-label="Scenes"><a href="./object.html">Object</a><a href="./nature.html">Nature</a><a href="./film.html">Film</a><a href="./motion.html" aria-current="page">Motion</a><a href="./docs.html">Docs</a><a href="./index.html#examples">Showcase</a></nav></header><section class="motion-stage" data-aspect="landscape" aria-label="Clockwork orbit animation"><canvas id="motion-canvas" tabindex="0" aria-label="Animated clockwork mechanism. Use Space to pause and arrow keys to move through the timeline."></canvas>@@ -19,6 +20,7 @@<section class="interface motion-controls" aria-label="Animation controls"><div class="description"><h1>Clockwork orbit</h1><p>A mechanism in motion, sampled from keyframes</p></div><div class="playback-controls"><button id="motion-play" aria-label="Play animation">▶ Play</button><button id="motion-replay">Replay</button><label for="motion-aspect">Frame <select id="motion-aspect"><option value="landscape">16:9 Landscape</option><option value="portrait">9:16 Portrait</option><option value="square">1:1 Square</option></select></label></div>+ <div class="motion-details"><label for="motion-look">Look <select id="motion-look"><option value="cinematic">Cinematic</option><option value="neutral">Neutral</option><option value="vivid">Vivid</option></select></label><button id="motion-save">Save this frame</button></div><label class="timeline-label" for="motion-time">Timeline <output id="motion-clock">0.0 / 12.0 s</output></label><input id="motion-time" type="range" min="0" max="12" step="0.01" value="0" /><div class="motion-details"><span id="motion-shot">Shot 1 of 3</span><span id="motion-stat"></span></div>diff --git a/nature.html b/nature.htmlindex f8ed33bd..8af371f9 100644--- a/nature.html+++ b/nature.html@@ -6,25 +6,26 @@<meta name="theme-color" content="#17231f" /><meta name="description" content="Explore a living alpine valley, built entirely from geometry in 67.js." /><title>67.js · Silverwater valley</title>- <link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='15' fill='%2317231f'/%3E%3Ctext x='7' y='45' font-family='sans-serif' font-weight='bold' font-size='38' fill='%23c9e4cc'%3E67%3C/text%3E%3C/svg%3E" />+ <link rel="icon" href="/favicon.svg" /></head><body><main>- <canvas id="viewport" tabindex="0" aria-label="Silverwater valley. Drag or use arrow keys to orbit; scroll or use plus and minus to zoom. Click the water to make a ripple."></canvas><header class="world-header"><a class="brand" href="./index.html" aria-label="67.js home">67<span>.js</span></a><nav aria-label="Scenes"><a href="./object.html">Object</a><a href="./nature.html" aria-current="page">Nature</a><a href="./film.html">Film</a>- </nav>+ <a href="./docs.html">Docs</a><a href="./index.html#examples">Showcase</a></nav><button id="save-image">Save PNG <span aria-hidden="true">↗</span></button></header><div class="landscape-title"><h1>Silverwater valley</h1>- <p>Take a breath. Stay a while.</p>+ <p>A living valley built from shared geometry</p></div>+ <canvas id="viewport" tabindex="0" aria-label="Silverwater valley. Drag or use arrow keys to orbit; scroll or use plus and minus to zoom. Click the water to make a ripple."></canvas><section class="landscape-controls" aria-label="Landscape controls">+ <div class="demo-presets" role="group" aria-label="Light presets"><button data-daylight="1">Day</button><button data-daylight="0.5">Golden hour</button><button data-daylight="0.08">Dusk</button></div><label class="view-control" for="viewpoint">View<select id="viewpoint"></select></label>diff --git a/object.html b/object.htmlindex 04473e11..a6ff4999 100644--- a/object.html+++ b/object.html@@ -6,14 +6,13 @@<meta name="theme-color" content="#25292d" /><meta name="description" content="Explore WALL·E inside and out. An explodable procedural 3D study rendered with 67.js." /><title>67.js · Object studio</title>- <link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='15' fill='%2325292d'/%3E%3Ctext x='7' y='45' font-family='sans-serif' font-weight='bold' font-size='38' fill='%23b7eddf'%3E67%3C/text%3E%3C/svg%3E" />+ <link rel="icon" href="/favicon.svg" /></head><body><main>- <canvas id="viewport" tabindex="0" aria-label="3D model. Drag or use arrow keys to orbit. Scroll or use plus and minus to zoom."></canvas><header class="toolbar"><a class="brand" href="./" aria-label="67.js home">67<span>.js</span></a>- <nav class="studio-nav" aria-label="Scenes"><a href="./object.html" aria-current="page">Object</a><a href="./nature.html">Nature</a><a href="./film.html">Film</a></nav>+ <nav class="studio-nav" aria-label="Scenes"><a href="./object.html" aria-current="page">Object</a><a href="./nature.html">Nature</a><a href="./film.html">Film</a><a href="./docs.html">Docs</a><a href="./index.html#examples">Showcase</a></nav><div class="toolbar-actions"><button id="reset" title="Reset camera (R)">Reset view</button><button id="export" class="primary">Export GLB <span aria-hidden="true">↗</span></button>@@ -24,6 +23,7 @@<p id="model-description">Pull apart the shell. Explore the machinery. <br />Slide back to bring him together.</p><div class="object-caption"><span class="status-dot" aria-hidden="true">●</span> <span id="model-name">WALL·E study</span><span class="caption-separator">/</span><span>Procedural geometry</span></div></section>+ <canvas id="viewport" tabindex="0" aria-label="3D model. Drag or use arrow keys to orbit. Scroll or use plus and minus to zoom."></canvas><aside class="controls" aria-label="Model appearance"><div class="assembly-control"><label for="assembly">Explode model <output id="assembly-value">0%</output></label>@@ -42,7 +42,7 @@</fieldset><label class="exposure-label" for="exposure">Exposure <output id="exposure-value">1.0</output></label><input id="exposure" type="range" min="0.5" max="1.8" step="0.1" value="1" />- <div class="view-actions">+ <div class="demo-presets" role="group" aria-label="Model composition"><button data-view="hero" aria-pressed="true">Hero</button><button data-view="face" aria-pressed="false">Face</button><button data-view="machine" aria-pressed="false">Machinery</button></div><label class="quality-label" for="look">Lighting<select id="look"><option value="studio">Soft studio</option><option value="warm">Warm key</option><option value="cool">Cool metal</option></select></label><div class="demo-presets"><button id="assembly-tour">Play assembly</button><button id="save-model">Save PNG</button></div><div class="view-actions"><button id="rotate" aria-pressed="false">↻ Auto orbit</button><button id="inspect" aria-pressed="false">Surface normals</button></div>diff --git a/package-lock.json b/package-lock.jsonindex d38e668f..f933cccb 100644--- a/package-lock.json+++ b/package-lock.json@@ -1,12 +1,12 @@{"name": "@codepawlhq/67js",- "version": "0.3.0",+ "version": "0.3.1","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "@codepawlhq/67js",- "version": "0.3.0",+ "version": "0.3.1","license": "MIT","devDependencies": {"gl-matrix": "3.4.4",diff --git a/package.json b/package.jsonindex fd8e04d5..7b4821b0 100644--- a/package.json+++ b/package.json@@ -1,6 +1,6 @@{"name": "@codepawlhq/67js",- "version": "0.3.0",+ "version": "0.3.1","private": false,"type": "module","description": "A browser graphics engine for interactive worlds, animation and cinematic media, with memory-aware CPU/GPU export",@@ -19,6 +19,7 @@"THIRD-PARTY-NOTICES.md","skills","docs/gltf.md",+ "docs/guide.md","docs/verification.md","docs/release-verification.md"],@@ -50,6 +51,7 @@"export:model": "node scripts/export-model.mjs","smoke:package": "node scripts/smoke-package.mjs","smoke:enhancements": "node scripts/smoke-enhancements.mjs",+ "smoke:site": "node scripts/smoke-site.mjs","publish:ci": "node scripts/publish-ci.mjs"},"devDependencies": {diff --git a/public/favicon.svg b/public/favicon.svgnew file mode 100644index 00000000..2acd7eaf--- /dev/null+++ b/public/favicon.svg@@ -0,0 +1 @@+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80" fill="none"><title>67.js outline block</title><g stroke="#777777" stroke-width="3" stroke-linejoin="round" stroke-linecap="round"><path d="m40 8 28 16v32L40 72 12 56V24L40 8Z"/><path d="m12 24 28 16 28-16M40 40v32"/></g></svg>diff --git a/public/llms.txt b/public/llms.txtnew file mode 100644index 00000000..ea84a48f--- /dev/null+++ b/public/llms.txt@@ -0,0 +1,23 @@+# 67.js++> A WebGL2 graphics toolkit for interactive scenes and deterministic image/video output. Build a scene once, use it on the web, and export its frames.++## Start here+- [Complete guide](https://67js.codepawl.com/guide.md): install, parts, materials, renderer options, cameras, effects, animation, memory, lifecycle, troubleshooting and agent workflow.+- [Release metadata](https://67js.codepawl.com/release.json): exact version, published status, package name, installation command and module URL.+- [Interactive documentation](https://67js.codepawl.com/docs.html): searchable reading interface.+- [GLB support](https://67js.codepawl.com/gltf.md): supported asset subset and explicit limitations.++## Recipes+- [Object studio](https://67js.codepawl.com/object.html): shared geometry, orbit, finishes and exploded assemblies.+- [Nature](https://67js.codepawl.com/nature.html): world lighting, wind and water interaction.+- [Animation](https://67js.codepawl.com/motion.html): keyframe playback and deterministic seeking.+- [2D](https://67js.codepawl.com/view2d.html): orthographic views and flat XY geometry.+- [Assets](https://67js.codepawl.com/assets.html): import an opaque GLB and sample rigid node animation.++## Agent contract+Install with npm install 67js@npm:@codepawlhq/67js. Core imports use '67js'. Compare VERSION with release metadata. Read the complete guide before generating renderer calls. Reuse geometry object identities, use finite invertible matrices and linear material RGB, set explicit render budgets, pause hidden playback, and dispose resources. Use deterministic timeline samples for offline media.++The package contains skills/build-67js-scene/SKILL.md and skills/render-67js-media/SKILL.md. The media CLI runs from a repository checkout, not the npm package. Capture and inspect real rendered output before reporting success. Report actual dimensions and estimated allocation separately from observed process memory.++Do not invent APIs, claim Three.js compatibility, claim universal speed superiority, or describe 67.js as a complete Blender editor. No WebGPU, skinning, morph targets or transparent material support in this release. Unsupported GLB features must produce visible errors.diff --git a/public/logo.svg b/public/logo.svgnew file mode 100644index 00000000..18fdf633--- /dev/null+++ b/public/logo.svg@@ -0,0 +1 @@+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80" fill="none"><title>67.js outline block</title><g stroke="#ECECEC" stroke-width="3" stroke-linejoin="round" stroke-linecap="round"><path d="m40 8 28 16v32L40 72 12 56V24L40 8Z"/><path d="m12 24 28 16 28-16M40 40v32"/></g></svg>diff --git a/public/media/clockwork-portrait.mp4 b/public/media/clockwork-portrait.mp4index bd6f5dbc..c88b9db2 100644Binary files a/public/media/clockwork-portrait.mp4 and b/public/media/clockwork-portrait.mp4 differdiff --git a/public/media/clockwork-portrait.mp4.json b/public/media/clockwork-portrait.mp4.jsonindex c4f8c34c..f84b2262 100644--- a/public/media/clockwork-portrait.mp4.json+++ b/public/media/clockwork-portrait.mp4.json@@ -14,15 +14,15 @@"height": 960,"reduced": false},- "fps": 12,+ "fps": 24,"duration": 12,"memoryBudgetMiB": 256,- "peakEstimatedRenderBytes": 43856404,- "peakNodeBytes": 211009536,- "peakBrowserHeap": 7310336,+ "peakEstimatedRenderBytes": 43872640,+ "peakNodeBytes": 213807104,+ "peakBrowserHeap": 7253352,"maximumPendingFrames": 1,- "firstFrameBytes": 481082,- "elapsedSeconds": 25.7497098,+ "firstFrameBytes": 485536,+ "elapsedSeconds": 53.407319199999996,"graphics": {"gpu": "ANGLE (NVIDIA, NVIDIA GeForce RTX 3060 (0x00002487) Direct3D11 vs_5_0 ps_5_0, D3D11)","samples": 2,diff --git a/public/media/clockwork.mp4 b/public/media/clockwork.mp4index f8da2331..88e38c72 100644Binary files a/public/media/clockwork.mp4 and b/public/media/clockwork.mp4 differdiff --git a/public/media/clockwork.mp4.json b/public/media/clockwork.mp4.jsonindex ca269162..794f0f54 100644--- a/public/media/clockwork.mp4.json+++ b/public/media/clockwork.mp4.json@@ -14,15 +14,15 @@"height": 540,"reduced": false},- "fps": 12,+ "fps": 24,"duration": 12,"memoryBudgetMiB": 256,- "peakEstimatedRenderBytes": 43856404,- "peakNodeBytes": 211288064,- "peakBrowserHeap": 7372700,+ "peakEstimatedRenderBytes": 43872640,+ "peakNodeBytes": 209313792,+ "peakBrowserHeap": 7255300,"maximumPendingFrames": 1,- "firstFrameBytes": 483420,- "elapsedSeconds": 25.766068999999998,+ "firstFrameBytes": 488960,+ "elapsedSeconds": 53.7601426,"graphics": {"gpu": "ANGLE (NVIDIA, NVIDIA GeForce RTX 3060 (0x00002487) Direct3D11 vs_5_0 ps_5_0, D3D11)","samples": 2,diff --git a/public/previews/assets.png b/public/previews/assets.pngindex b2a5dfe3..9b386967 100644Binary files a/public/previews/assets.png and b/public/previews/assets.png differdiff --git a/public/previews/assets.png.json b/public/previews/assets.png.jsonindex ad7e2dba..0724fc92 100644--- a/public/previews/assets.png.json+++ b/public/previews/assets.png.json@@ -2,35 +2,35 @@"scene": "assets","kind": "image","backend": "gpu",- "preset": "preview",+ "preset": "high","aspect": "landscape","start": 0,"encoder": null,"assembly": null,- "width": 960,- "height": 540,+ "width": 1920,+ "height": 1080,"actualRenderSize": {- "width": 960,- "height": 540,+ "width": 1920,+ "height": 1080,"reduced": false},"fps": 24,"duration": null,- "memoryBudgetMiB": 256,- "peakEstimatedRenderBytes": 43838004,- "peakNodeBytes": 126935040,+ "memoryBudgetMiB": 512,+ "peakEstimatedRenderBytes": 174509440,+ "peakNodeBytes": 141959168,"peakBrowserHeap": 0,"maximumPendingFrames": 0,- "firstFrameBytes": 37198,- "elapsedSeconds": 2.0140044,+ "firstFrameBytes": 163485,+ "elapsedSeconds": 1.6140099,"graphics": {"gpu": "ANGLE (NVIDIA, NVIDIA GeForce RTX 3060 (0x00002487) Direct3D11 vs_5_0 ps_5_0, D3D11)",- "samples": 2,+ "samples": 4,"capabilities": {"hdr": true,"hdrRequested": true,"hdrFallbackReason": null,- "samples": 2,+ "samples": 4,"maximumTextureSize": 16384},"glError": 0diff --git a/public/previews/assets.webp b/public/previews/assets.webpnew file mode 100644index 00000000..23165a30Binary files /dev/null and b/public/previews/assets.webp differdiff --git a/public/previews/film-contact.webp b/public/previews/film-contact.webpnew file mode 100644index 00000000..b98f3d04Binary files /dev/null and b/public/previews/film-contact.webp differdiff --git a/public/previews/motion.png b/public/previews/motion.pngindex b97043ee..2f083e90 100644Binary files a/public/previews/motion.png and b/public/previews/motion.png differdiff --git a/public/previews/motion.png.json b/public/previews/motion.png.jsonindex 7c57f9f2..86a987ee 100644--- a/public/previews/motion.png.json+++ b/public/previews/motion.png.json@@ -2,35 +2,35 @@"scene": "motion","kind": "image","backend": "gpu",- "preset": "preview",+ "preset": "high","aspect": "landscape","start": 0,"encoder": null,"assembly": null,- "width": 960,- "height": 540,+ "width": 1920,+ "height": 1080,"actualRenderSize": {- "width": 960,- "height": 540,+ "width": 1920,+ "height": 1080,"reduced": false},"fps": 24,"duration": null,- "memoryBudgetMiB": 256,- "peakEstimatedRenderBytes": 43856404,- "peakNodeBytes": 122605568,+ "memoryBudgetMiB": 512,+ "peakEstimatedRenderBytes": 174509440,+ "peakNodeBytes": 123269120,"peakBrowserHeap": 0,"maximumPendingFrames": 0,- "firstFrameBytes": 566093,- "elapsedSeconds": 1.5091984999999999,+ "firstFrameBytes": 1875851,+ "elapsedSeconds": 2.7473774000000004,"graphics": {"gpu": "ANGLE (NVIDIA, NVIDIA GeForce RTX 3060 (0x00002487) Direct3D11 vs_5_0 ps_5_0, D3D11)",- "samples": 2,+ "samples": 4,"capabilities": {"hdr": true,"hdrRequested": true,"hdrFallbackReason": null,- "samples": 2,+ "samples": 4,"maximumTextureSize": 16384},"glError": 0diff --git a/public/previews/motion.webp b/public/previews/motion.webpnew file mode 100644index 00000000..b35056e8Binary files /dev/null and b/public/previews/motion.webp differdiff --git a/public/previews/nature.png b/public/previews/nature.pngindex 905741c7..7c346953 100644Binary files a/public/previews/nature.png and b/public/previews/nature.png differdiff --git a/public/previews/nature.png.json b/public/previews/nature.png.jsonnew file mode 100644index 00000000..955f3c59--- /dev/null+++ b/public/previews/nature.png.json@@ -0,0 +1,40 @@+{+ "scene": "nature",+ "kind": "image",+ "backend": "gpu",+ "preset": "high",+ "aspect": "landscape",+ "start": 0,+ "encoder": null,+ "assembly": null,+ "width": 1920,+ "height": 1080,+ "actualRenderSize": {+ "width": 1920,+ "height": 1080,+ "reduced": false+ },+ "fps": 24,+ "duration": null,+ "memoryBudgetMiB": 512,+ "peakEstimatedRenderBytes": 176127760,+ "peakNodeBytes": 123863040,+ "peakBrowserHeap": 0,+ "maximumPendingFrames": 0,+ "firstFrameBytes": 1530328,+ "elapsedSeconds": 2.2022288,+ "graphics": {+ "gpu": "ANGLE (NVIDIA, NVIDIA GeForce RTX 3060 (0x00002487) Direct3D11 vs_5_0 ps_5_0, D3D11)",+ "samples": 4,+ "capabilities": {+ "hdr": true,+ "hdrRequested": true,+ "hdrFallbackReason": null,+ "samples": 4,+ "maximumTextureSize": 16384+ },+ "glError": 0+ },+ "output": "nature.png",+ "errors": []+}\ No newline at end of filediff --git a/public/previews/nature.webp b/public/previews/nature.webpnew file mode 100644index 00000000..9a7cbdafBinary files /dev/null and b/public/previews/nature.webp differdiff --git a/public/previews/view2d.png b/public/previews/view2d.pngindex 44565030..75b67e5c 100644Binary files a/public/previews/view2d.png and b/public/previews/view2d.png differdiff --git a/public/previews/view2d.png.json b/public/previews/view2d.png.jsonindex 22a5d446..f3ede389 100644--- a/public/previews/view2d.png.json+++ b/public/previews/view2d.png.json@@ -2,35 +2,35 @@"scene": "view2d","kind": "image","backend": "gpu",- "preset": "preview",+ "preset": "high","aspect": "landscape","start": 0,"encoder": null,"assembly": null,- "width": 960,- "height": 540,+ "width": 1920,+ "height": 1080,"actualRenderSize": {- "width": 960,- "height": 540,+ "width": 1920,+ "height": 1080,"reduced": false},"fps": 24,"duration": null,- "memoryBudgetMiB": 256,- "peakEstimatedRenderBytes": 36517120,- "peakNodeBytes": 124506112,+ "memoryBudgetMiB": 512,+ "peakEstimatedRenderBytes": 128792320,+ "peakNodeBytes": 144084992,"peakBrowserHeap": 0,"maximumPendingFrames": 0,- "firstFrameBytes": 36317,- "elapsedSeconds": 1.9533025,+ "firstFrameBytes": 99412,+ "elapsedSeconds": 1.5712955000000002,"graphics": {"gpu": "ANGLE (NVIDIA, NVIDIA GeForce RTX 3060 (0x00002487) Direct3D11 vs_5_0 ps_5_0, D3D11)",- "samples": 2,+ "samples": 4,"capabilities": {"hdr": false,"hdrRequested": false,"hdrFallbackReason": null,- "samples": 2,+ "samples": 4,"maximumTextureSize": 16384},"glError": 0diff --git a/public/previews/view2d.webp b/public/previews/view2d.webpnew file mode 100644index 00000000..bb484520Binary files /dev/null and b/public/previews/view2d.webp differdiff --git a/public/previews/wall-e-exploded.png b/public/previews/wall-e-exploded.pngindex 00807a2f..53ce4e8c 100644Binary files a/public/previews/wall-e-exploded.png and b/public/previews/wall-e-exploded.png differdiff --git a/public/previews/wall-e-exploded.png.json b/public/previews/wall-e-exploded.png.jsonnew file mode 100644index 00000000..a4496a03--- /dev/null+++ b/public/previews/wall-e-exploded.png.json@@ -0,0 +1,40 @@+{+ "scene": "object",+ "kind": "image",+ "backend": "gpu",+ "preset": "high",+ "aspect": "landscape",+ "start": 0,+ "encoder": null,+ "assembly": 1,+ "width": 1920,+ "height": 1080,+ "actualRenderSize": {+ "width": 1920,+ "height": 1080,+ "reduced": false+ },+ "fps": 24,+ "duration": null,+ "memoryBudgetMiB": 512,+ "peakEstimatedRenderBytes": 174964416,+ "peakNodeBytes": 131231744,+ "peakBrowserHeap": 0,+ "maximumPendingFrames": 0,+ "firstFrameBytes": 370215,+ "elapsedSeconds": 1.8863638,+ "graphics": {+ "gpu": "ANGLE (NVIDIA, NVIDIA GeForce RTX 3060 (0x00002487) Direct3D11 vs_5_0 ps_5_0, D3D11)",+ "samples": 4,+ "capabilities": {+ "hdr": true,+ "hdrRequested": true,+ "hdrFallbackReason": null,+ "samples": 4,+ "maximumTextureSize": 16384+ },+ "glError": 0+ },+ "output": "wall-e-exploded.png",+ "errors": []+}\ No newline at end of filediff --git a/public/previews/wall-e-exploded.webp b/public/previews/wall-e-exploded.webpnew file mode 100644index 00000000..a4774e1cBinary files /dev/null and b/public/previews/wall-e-exploded.webp differdiff --git a/public/previews/wall-e.png b/public/previews/wall-e.pngindex a25831f6..52a96dba 100644Binary files a/public/previews/wall-e.png and b/public/previews/wall-e.png differdiff --git a/public/previews/wall-e.png.json b/public/previews/wall-e.png.jsonnew file mode 100644index 00000000..da6752f8--- /dev/null+++ b/public/previews/wall-e.png.json@@ -0,0 +1,40 @@+{+ "scene": "object",+ "kind": "image",+ "backend": "gpu",+ "preset": "high",+ "aspect": "landscape",+ "start": 0,+ "encoder": null,+ "assembly": 0,+ "width": 1920,+ "height": 1080,+ "actualRenderSize": {+ "width": 1920,+ "height": 1080,+ "reduced": false+ },+ "fps": 24,+ "duration": null,+ "memoryBudgetMiB": 512,+ "peakEstimatedRenderBytes": 174964416,+ "peakNodeBytes": 123981824,+ "peakBrowserHeap": 0,+ "maximumPendingFrames": 0,+ "firstFrameBytes": 408843,+ "elapsedSeconds": 1.8482094999999998,+ "graphics": {+ "gpu": "ANGLE (NVIDIA, NVIDIA GeForce RTX 3060 (0x00002487) Direct3D11 vs_5_0 ps_5_0, D3D11)",+ "samples": 4,+ "capabilities": {+ "hdr": true,+ "hdrRequested": true,+ "hdrFallbackReason": null,+ "samples": 4,+ "maximumTextureSize": 16384+ },+ "glError": 0+ },+ "output": "wall-e.png",+ "errors": []+}\ No newline at end of filediff --git a/public/previews/wall-e.webp b/public/previews/wall-e.webpnew file mode 100644index 00000000..50a1cd17Binary files /dev/null and b/public/previews/wall-e.webp differdiff --git a/scripts/prepare-release.mjs b/scripts/prepare-release.mjsindex 42e85745..61b4d903 100644--- a/scripts/prepare-release.mjs+++ b/scripts/prepare-release.mjs@@ -33,6 +33,8 @@ await cp(resolve(root, 'build'), resolve(releases, metadata.version), { recursivrun(process.execPath, ['node_modules/vite/bin/vite.js', 'build', '--config', 'vite.browser.config.js']);await copyFile(resolve(root, 'build-browser/67.module.js'), resolve(releases, metadata.version, '67.module.js'));await copyFile(resolve(root, 'CHANGELOG.md'), resolve(root, 'public/changelog.md'));+await copyFile(resolve(root, 'docs/guide.md'), resolve(root, 'public/guide.md'));+await copyFile(resolve(root, 'docs/gltf.md'), resolve(root, 'public/gltf.md'));let registryVersion = null;let registryPublished = false;@@ -72,7 +74,7 @@ const release = {registryVersion,integrity,packageBytes: archive.length,- api: './getting-started.html#api',+ api: './docs.html#renderer-reference',changelog: '/changelog.md',};await writeFile(resolve(root, 'public/release.json'), `${JSON.stringify(release, null, 2)}\n`);diff --git a/scripts/smoke-scenes.mjs b/scripts/smoke-scenes.mjsindex 11284ee0..55020216 100644--- a/scripts/smoke-scenes.mjs+++ b/scripts/smoke-scenes.mjs@@ -30,7 +30,7 @@ try {assert.equal(await page.evaluate(() => window.__nature.state.wind), 0.75);await page.locator('#viewpoint').selectOption('1');await page.locator('#detail').selectOption('low');- await page.waitForFunction(() => window.__nature.world.parts.length === 1526);+ await page.waitForFunction(() => window.__nature.state.detail === 'low' && window.__nature.world.parts.length < 2000);await page.locator('#viewpoint').selectOption('0');await page.locator('#viewport').click({ position: { x: 720, y: 630 } });assert.ok(await page.evaluate(() => window.__nature.state.rippleTime >= 0));diff --git a/scripts/smoke-site.mjs b/scripts/smoke-site.mjsnew file mode 100644index 00000000..14382eff--- /dev/null+++ b/scripts/smoke-site.mjs@@ -0,0 +1,106 @@+import assert from 'node:assert/strict';+import { mkdir, writeFile } from 'node:fs/promises';+import { chromium } from 'playwright';++const origin = process.argv[2] ?? 'http://127.0.0.1:5173';+await mkdir('artifacts', { recursive: true });+const browser = await chromium.launch({ executablePath:'C:/Program Files/Google/Chrome/Application/chrome.exe', headless:true, args:['--enable-webgl','--ignore-gpu-blocklist'] });+const errors = [];+const report = { layouts: [], interactions: [] };+try {+ const page = await browser.newPage({ viewport:{ width:1440,height:1000 }, colorScheme:'dark', reducedMotion:'reduce' });+ page.on('pageerror', error => errors.push(error.message));+ for (const route of ['/', '/docs.html', '/getting-started.html', '/object.html', '/motion.html', '/nature.html', '/assets.html', '/view2d.html', '/film.html']) {+ await page.goto(origin + route);+ if (route.includes('object')) await page.waitForFunction(() => window.__studio?.renderer);+ if (route.includes('motion')) await page.waitForFunction(() => window.__motion?.renderer);+ if (route.includes('nature')) await page.waitForFunction(() => window.__nature?.renderer);+ if (route.includes('assets')) await page.waitForFunction(() => window.__assetViewer?.renderer);+ if (route.includes('film')) await page.waitForFunction(() => window.__filmReady);+ for (const width of [1440,390,320]) {+ await page.setViewportSize({ width,height:1000 });+ await page.waitForTimeout(150);+ if (route === '/') {+ await page.locator('img').evaluateAll(images => images.forEach(image => { image.loading = 'eager'; }));+ await page.waitForFunction(() => [...document.images].every(image => image.complete));+ }+ const overflow = await page.evaluate(() => document.documentElement.scrollWidth > innerWidth + 1);+ assert.equal(overflow,false,`${route} overflow at ${width}`);+ const clippedLinks = await page.locator('nav a').evaluateAll(links => links.filter(link => {+ const rectangle = link.getBoundingClientRect();+ return rectangle.width && (rectangle.left < -1 || rectangle.right > innerWidth + 1);+ }).map(link => link.textContent));+ assert.deepEqual(clippedLinks,[],`${route} clipped navigation at ${width}`);+ if (['/object.html','/nature.html'].includes(route) && width < 700) {+ const geometry = await page.evaluate(() => ({ canvas:document.querySelector('#viewport').getBoundingClientRect().toJSON(), controls:document.querySelector('.controls, .landscape-controls').getBoundingClientRect().toJSON(), title:document.querySelector('.object-info, .landscape-title').getBoundingClientRect().toJSON() }));+ assert.ok(geometry.canvas.bottom <= geometry.controls.top, 'Mobile controls overlap the model');+ assert.ok(geometry.title.bottom <= geometry.canvas.top, 'Mobile title overlaps the model');+ }+ await page.screenshot({ path:`artifacts/site-${route.replace(/[^a-z]/g,'') || 'home'}-${width}.png`, fullPage:true });+ report.layouts.push({ route,width,overflow });+ }+ await page.setViewportSize({ width:1440,height:1000 });+ if (route === '/docs.html') {+ assert.ok(await page.locator('#doc-article section').count() >= 10);+ await page.locator('#doc-search').fill('memory');+ assert.ok(await page.locator('#doc-article section:visible').count() > 0);+ await page.locator('#doc-search').fill('no-such-topic-1234');+ await assert.equal(await page.locator('#doc-article section:visible').count(),0);+ assert.match(await page.locator('#doc-results').textContent(),/No matching/);+ await page.locator('#doc-search').fill('');+ await page.locator('#doc-toc a[href="#models-and-ai-agents"]').click();+ assert.match(page.url(),/models-and-ai-agents/);+ report.interactions.push('Docs search, empty state and topic links');+ }+ if (route === '/object.html') {+ await page.locator('[data-view="face"]').click();+ assert.equal(await page.evaluate(() => window.__studio.state.targetHeight),2.55);+ await page.locator('#look').selectOption('warm');+ await page.locator('[data-view="machine"]').click();+ assert.equal(await page.evaluate(() => window.__studio.state.assembly),0.65);+ const download = page.waitForEvent('download');+ await page.locator('#save-model').click();+ assert.equal((await download).suggestedFilename(),'67js-wall-e.png');+ await page.locator('#assembly-tour').click();+ assert.equal(await page.evaluate(() => window.__studio.state.touring),false);+ const graphics = await page.evaluate(() => window.__studio.renderer.context.getError());+ assert.equal(graphics,0);+ report.interactions.push('Object viewpoints, lighting, PNG and reduced-motion assembly toggle');+ }+ if (route === '/motion.html') {+ await page.locator('#motion-look').selectOption('neutral');+ await page.locator('#motion-aspect').selectOption('portrait');+ await page.evaluate(() => window.__scene.renderAt(3));+ const download = page.waitForEvent('download');+ await page.locator('#motion-save').click();+ assert.equal((await download).suggestedFilename(),'67js-clockwork.png');+ assert.equal(await page.evaluate(() => window.__scene.renderer.context.getError()),0);+ report.interactions.push('Motion looks, portrait framing, deterministic seek and PNG');+ }+ if (route === '/nature.html') {+ await page.locator('[data-daylight="0.5"]').click();+ assert.equal(await page.evaluate(() => window.__nature.state.daylight),0.5);+ assert.equal(await page.evaluate(() => window.__nature.renderer.context.getError()),0);+ report.interactions.push('Nature golden-hour preset');+ }+ }+ await page.emulateMedia({colorScheme:'light'});+ await page.goto(origin);+ assert.equal(await page.evaluate(() => getComputedStyle(document.body).getPropertyValue('--window').trim()),'#fff');+ await page.screenshot({path:'artifacts/site-home-light.png',fullPage:true});+ await page.goto(`${origin}/object.html`);+ await page.waitForFunction(() => window.__studio?.renderer);+ await page.emulateMedia({reducedMotion:'no-preference'});+ await page.locator('#assembly-tour').click();+ await page.waitForFunction(() => window.__studio.state.assembly > 0.01);+ await page.locator('#assembly-tour').click();+ assert.equal(await page.evaluate(() => window.__studio.state.touring),false);+ report.interactions.push('Assembly playback and pause');+ for (const resource of ['/guide.md','/llms.txt','/gltf.md','/favicon.svg','/logo.svg']) {+ const response = await page.request.get(origin + resource);+ assert.equal(response.status(),200,resource);+ }+ assert.deepEqual(errors,[]);+ await writeFile('artifacts/site-checks.json',JSON.stringify(report,null,2));+ console.log(`Site passed: ${report.layouts.length} layouts, ${report.interactions.length} interaction groups, light/dark theme and agent resources.`);+} finally { await browser.close(); }diff --git a/src/asset-viewer.js b/src/asset-viewer.jsindex f4dd7cc0..6f3583fa 100644--- a/src/asset-viewer.js+++ b/src/asset-viewer.js@@ -1,8 +1,10 @@import './view2d.css';+import './brand.js';import './asset-viewer.css';-import { mat4, vec3 } from 'gl-matrix';-import { Renderer67, box, torus, exportGlb, cameraView, fitOrthographicHeight } from './index.js';+import { vec3 } from 'gl-matrix';+import { Renderer67, exportGlb, cameraView, fitOrthographicHeight } from './index.js';import { loadGltf, parseGltf } from './gltf.js';+import { createMotionScene } from './motion.js';const canvas = document.querySelector('#viewport');const parameters = new URLSearchParams(location.search);@@ -215,7 +217,6 @@ document.querySelector('#save').addEventListener('click', async () => {window.__assetViewer = { state, openFile, showAsset, get renderer() { return renderer; }, get asset() { return asset; }, renderAt };window.__scene = { get renderer() { return renderer; }, get duration() { return duration(); }, pause, renderAt };-const material = { tag: 'surface', color: [0.16, 0.48, 0.42], metallic: 0.55, roughness: 0.3, emission: 0 };-const ringMatrix = mat4.fromScaling(mat4.create(), [1.5, 1.5, 1.5]);-const demo = [{ name: 'Core', geometry: box(), matrix: mat4.create(), material }, { name: 'Ring', geometry: torus(0.08, 64, 16), matrix: ringMatrix, material }];-try { showAsset(await parseGltf(exportGlb(demo)), 'Machine study'); } catch (error) { notice(error.message, true); }+const demo = createMotionScene();+demo.sample(3);+try { showAsset(await parseGltf(exportGlb(demo.parts)), 'Clockwork GLB study'); } catch (error) { notice(error.message, true); }diff --git a/src/brand.css b/src/brand.cssnew file mode 100644index 00000000..02bab122--- /dev/null+++ b/src/brand.css@@ -0,0 +1,21 @@+:root { --window:#0b0b0b; --bg:#212121; --surface:#2f2f2f; --text:#ececec; --muted:#b4b4b4; --border:#404040; --focus:#a6c1ff; --radius:9px; --panel-radius:16px; }+.icon { width:18px; height:18px; display:inline-block; flex-shrink:0; vertical-align:middle; }+.brand { display:inline-flex; align-items:center; gap:0; flex-shrink:0; }+.brand .brand-mark { flex-shrink:0; width:34px; height:34px; margin-right:10px; }+button .icon, a .icon { margin-right:7px; }+body { font-family:ui-sans-serif,-apple-system,system-ui,"Segoe UI",Helvetica,Arial,sans-serif; }+:focus-visible { outline:2px solid var(--focus); outline-offset:4px; }+button, select { border-radius:var(--radius); }+button[aria-pressed=true] { background:#ffffff20; color:#fff; }+.controls button:not(.swatch)[aria-pressed=true], .layer-actions button[aria-pressed=true] { background:#ffffff20; color:#fff; }+.primary { background:#ececec; color:#171717; }+.primary:hover { background:#fff; }+input[type=range] { accent-color:#d7d7d7; }+.studio-nav a[aria-current], nav a[aria-current] { color:#ececec; }+.toolbar, .world-header { z-index:3; }+.controls, .landscape-controls { background:#171717e8; border:1px solid #ffffff1c; border-radius:var(--panel-radius); backdrop-filter:blur(16px); }+.demo-links { display:flex; gap:12px; font-size:12px; }+.demo-links a { color:#ddd; text-decoration:none; }+.demo-presets { display:flex; flex-wrap:wrap; gap:6px; margin:12px 0; }+.demo-presets button { padding:7px 10px; font-size:12px; }+@media (max-width:700px) { .studio-nav, .world-header nav { flex-wrap:wrap; } .brand .brand-mark { width:28px; height:28px; margin-right:8px; } }diff --git a/src/brand.js b/src/brand.jsnew file mode 100644index 00000000..b1f30044--- /dev/null+++ b/src/brand.js@@ -0,0 +1,39 @@+import './brand.css';++for (const brand of document.querySelectorAll('a.brand')) {+ const mark = document.createElement('img');+ mark.src = '/logo.svg';+ mark.alt = '';+ mark.width = mark.height = 34;+ mark.className = 'brand-mark';+ brand.prepend(mark);+}++// Local SVGs share one stroke style and never depend on a third-party icon CDN.+const paths = {+ cube:'M12 3 3 8v9l9 5 9-5V8l-9-5ZM3 8l9 5 9-5M12 13v9M7.5 5.5l9 5',+ book:'M4 4h6a3 3 0 0 1 3 3v14a4 4 0 0 0-4-2H4V4Zm9 3a3 3 0 0 1 3-3h5v15h-4a4 4 0 0 0-4 2',+ download:'M12 3v12m-5-5 5 5 5-5M4 17v4h16v-4',+ code:'m8 6-6 6 6 6m8-12 6 6-6 6m-3-15-2 18',+ film:'M3 4h18v16H3V4Zm4 0v16M17 4v16M3 9h4m-4 6h4m10-6h4m-4 6h4',+ leaf:'M20 3C8 2 2 8 5 15s15 6 15-12ZM4 21 15 10',+ image:'M3 3h18v18H3V3Zm0 14 6-6 5 5 3-3 4 4M16 8h.01',+};+const labels = { Examples:'cube', Showcase:'cube', Documentation:'book', 'Getting started':'book', Downloads:'download', 'Package source':'code', Object:'cube', Nature:'leaf', Film:'film', Animation:'film', 'Save PNG':'image', 'Export GLB':'download' };+for (const element of document.querySelectorAll('nav a, [data-icon], #save-image, #export')) {+ const name = element.dataset.icon ?? labels[element.textContent.trim().replace(/[↓↗]/g, '').trim()];+ if (!paths[name]) continue;+ const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');+ svg.setAttribute('viewBox','0 0 24 24');+ svg.setAttribute('aria-hidden','true');+ svg.setAttribute('class','icon');+ svg.setAttribute('fill','none');+ svg.setAttribute('stroke','currentColor');+ svg.setAttribute('stroke-width','1.6');+ svg.setAttribute('stroke-linecap','round');+ svg.setAttribute('stroke-linejoin','round');+ const path = document.createElementNS(svg.namespaceURI,'path');+ path.setAttribute('d',paths[name]);+ svg.append(path);+ element.prepend(svg);+}diff --git a/src/documentation.js b/src/documentation.jsnew file mode 100644index 00000000..1b0bd808--- /dev/null+++ b/src/documentation.js@@ -0,0 +1,62 @@+import './home.js';+import guide from '../docs/guide.md?raw';++const article = document.querySelector('#doc-article');+const toc = document.querySelector('#doc-toc');+const escape = value => value.replace(/[&<>"']/g, character => ({'&':'&','<':'<','>':'>','"':'"',"'":'''}[character]));+// The source is maintained in this repository, not user-supplied Markdown.+function inline(value) {+ return escape(value).replace(/`([^`]+)`/g, '<code>$1</code>').replace(/\[([^\]]+)\]\((\/[^)]+)\)/g,'<a href="$2">$1</a>');+}+const sections = guide.split(/^## /m).slice(1).map((text, index) => {+ const [title, ...lines] = text.split('\n');+ const id = title.toLowerCase().replace(/[^a-z0-9]+/g,'-').replace(/-$/,'');+ const section = document.createElement('section');+ section.id = id;+ section.innerHTML = `<h2>${escape(title)}</h2>`;+ const blocks = lines.join('\n').trim().split(/(```[^\n]*\n[\s\S]*?```)/g);+ for (const block of blocks) {+ if (block.startsWith('```')) {+ const pre = document.createElement('pre');+ const code = document.createElement('code');+ code.textContent = block.replace(/^```[^\n]*\n/, '').replace(/```$/, '').trimEnd();+ pre.append(code);+ const button = document.createElement('button');+ button.className = 'copy-code';+ button.textContent = 'Copy';+ button.setAttribute('aria-label', `Copy code from ${title}`);+ button.addEventListener('click', async () => {+ try { await navigator.clipboard.writeText(code.textContent); button.textContent = 'Copied'; }+ catch { button.textContent = 'Select and copy'; const selection = getSelection(); const range = document.createRange(); range.selectNodeContents(code); selection.removeAllRanges(); selection.addRange(range); }+ setTimeout(() => { button.textContent = 'Copy'; }, 2000);+ });+ pre.append(button);+ section.append(pre);+ } else {+ for (const paragraph of block.trim().split(/\n\s*\n/)) {+ if (!paragraph.trim()) continue;+ if (paragraph.startsWith('|')) {+ const table = document.createElement('table');+ const rows = paragraph.split('\n').filter(row => !/^\|[\s:|-]+\|$/.test(row));+ table.innerHTML = rows.map((row, rowIndex) => `<tr>${row.split('|').slice(1,-1).map(cell => `<${rowIndex ? 'td' : 'th'}>${inline(cell.trim())}</${rowIndex ? 'td' : 'th'}>`).join('')}</tr>`).join('');+ const scroll = document.createElement('div'); scroll.className = 'table-scroll'; scroll.append(table); section.append(scroll);+ } else {+ const p = document.createElement('p'); p.innerHTML = inline(paragraph); section.append(p);+ }+ }+ }+ }+ const link = document.createElement('a'); link.href = `#${id}`; link.textContent = title;+ toc.append(link); article.append(section);+ return { section, link, text: text.toLowerCase(), index };+});+document.querySelector('#doc-search').addEventListener('input', event => {+ const words = event.target.value.toLowerCase().trim().split(/\s+/).filter(Boolean);+ let count = 0;+ for (const item of sections) {+ const visible = words.every(word => item.text.includes(word));+ item.section.hidden = item.link.hidden = !visible;+ if (visible) count++;+ }+ document.querySelector('#doc-results').textContent = words.length ? count ? `${count} topics found` : 'No matching topics. Try “camera”, “memory” or “agents”.' : '';+});diff --git a/src/film-player.js b/src/film-player.jsindex 8b7c19d2..02b29a5d 100644--- a/src/film-player.js+++ b/src/film-player.js@@ -1,4 +1,5 @@import './film-style.css';+import './brand.js';import { Renderer67 } from './renderer.js';import { createFilmScenes, FILM_DURATION, sampleFilm } from './film.js';diff --git a/src/film-style.css b/src/film-style.cssindex ad57a8c9..988b253a 100644--- a/src/film-style.css+++ b/src/film-style.css@@ -49,6 +49,8 @@ button:hover { background: #ffffff1c; }.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }.export-mode .player-interface { display: none !important; }.export-mode .film-stage { min-height: 0; }+.film-header { flex-wrap:wrap; }+.film-header nav { flex-wrap:wrap; }@media (max-width: 600px) {.film-header { padding: 16px 20px 50px; gap: 16px; }.brand { font-size: 22px; }@@ -63,3 +65,4 @@ button:hover { background: #ffffff1c; }.film-title h1 { font-size: 42px; letter-spacing: .17em; padding-left: .17em; }.film-error { left: 20px; right: 20px; }}+@media (max-width:600px) { .film-header nav { flex-basis:100%; margin-left:0; gap:6px 18px; } }diff --git a/src/home.css b/src/home.cssindex 0fd4bfd1..a89f0d80 100644--- a/src/home.css+++ b/src/home.css@@ -89,3 +89,57 @@ code, pre { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }.api-list { padding-left: 22px; color: #b9c4cc; font-size: 14px; line-height: 1.9; }.api-list li { margin-bottom: 9px; }.docs p code, .docs li code { color: #c5e2d4; }++/* CodePawl's neutral surfaces, rounded panels and quiet dot field. */+:root { color:var(--text); background:var(--window); }+.navigation { background:var(--bg); border-right:1px solid var(--border); }+main { max-width:1440px; }+.library-description, p, .example-caption > span, .navigation-note { color:var(--muted); }+.version, .section-heading > span, .start-link, .release-links, nav a[aria-current], .command-row code, .docs pre, .docs p code, .docs li code { color:var(--text); }+.command-row, .docs pre { background:var(--bg); border:1px solid var(--border); border-radius:var(--panel-radius); }+button { background:var(--surface); }+button:hover { background:var(--border); }+.download { background:var(--bg); border-radius:var(--panel-radius); }+.download:hover { background:var(--surface); }+.example img { aspect-ratio:16/9; border-radius:var(--panel-radius); border:1px solid var(--border); }+.introduction { padding:20px 0 12px; }+.introduction h1 { max-width:780px; font-size:clamp(34px,4.6vw,62px); line-height:1.06; letter-spacing:-2px; font-weight:600; }+.feature-showcase h2 { margin:0; }+.introduction p { font-size:17px; max-width:620px; margin:20px 0; }+.hero-actions { display:flex; flex-wrap:wrap; gap:12px; align-items:center; }+.hero-actions a { padding:12px 18px; border-radius:var(--radius); background:var(--text); color:var(--window); font-size:14px; }+.hero-actions a+ a { background:var(--bg); color:var(--text); border:1px solid var(--border); }+.feature-showcase { margin:26px 0 42px; border-radius:var(--panel-radius); background:#171717; overflow:hidden; position:relative; }+.feature-showcase video { display:block; width:100%; aspect-ratio:16/9; background:#171717; }+.showcase-caption { display:flex; justify-content:space-between; flex-wrap:wrap; gap:16px; padding:22px 24px; color:#ececec; }+.showcase-caption p { margin:6px 0 0; color:#b4b4b4; }+.showcase-caption a { align-self:center; border-radius:9px; padding:12px 18px; background:#ececec; color:#171717; font-size:14px; }+.workflow { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:24px; margin-bottom:46px; }+.workflow h3 { margin:12px 0 8px; }+.workflow p { font-size:14px; margin:0; }+.workflow .icon { width:24px; height:24px; }+.docs-page { max-width:1450px; }+.docs-page header { max-width:740px; }+.docs-search { display:flex; flex-direction:column; gap:10px; font-size:14px; margin-top:28px; max-width:560px; }+.docs-search input { width:100%; padding:13px 15px; background:var(--bg); border:1px solid var(--border); color:var(--text); border-radius:var(--radius); font:inherit; }+.docs-layout { display:grid; grid-template-columns:190px minmax(0,780px); gap:36px; }+#doc-toc { position:sticky; top:24px; align-self:start; margin:16px 0; gap:2px; max-height:calc(100vh - 50px); overflow-y:auto; }+#doc-toc a { font-size:13px; padding:8px; margin:0; line-height:1.35; }+#doc-article { min-width:0; }+#doc-article section { scroll-margin-top:24px; margin-top:24px; margin-bottom:46px; }+#doc-article p { font-size:15px; line-height:1.85; }+#doc-article a { text-decoration:underline; }+.table-scroll { overflow-x:auto; }+table { border-collapse:collapse; width:100%; font-size:13px; line-height:1.6; margin:20px 0; }+td, th { text-align:left; padding:12px; border-bottom:1px solid var(--border); vertical-align:top; }+.docs pre { position:relative; padding-top:48px; }+.copy-code { position:absolute; top:8px; right:10px; font-size:12px; padding:5px 10px; }+@media (prefers-color-scheme:light) {+ body:has(.navigation) { --window:#fff; --bg:#f7f7f8; --surface:#f1f1f1; --text:#1f1f1f; --muted:#555; --border:#e5e5e5; --focus:#576b99; color-scheme:light; color:var(--text); background:var(--window); }+ .brand, .brand span { color:var(--text); }+ .brand .brand-mark { filter:invert(1); }+ nav a:hover, nav a[aria-current] { background:#17171708; }+ .release-feedback p, .download > span { color:var(--muted); }+}+@media (max-width:960px) { .docs-layout { grid-template-columns:1fr; gap:0; } #doc-toc { position:static; max-height:none; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); } }+@media (max-width:760px) { .workflow { grid-template-columns:1fr; gap:24px; } .introduction h1 { font-size:38px; letter-spacing:-1.3px; } .showcase-caption { padding:18px; } .navigation { border-right:0; border-bottom:1px solid var(--border); } .docs-page h1 { font-size:32px; } .docs-search input { font-size:16px; } }diff --git a/src/home.js b/src/home.jsindex 2929842b..b5c4f2b9 100644--- a/src/home.js+++ b/src/home.js@@ -1,4 +1,5 @@import './home.css';+import './brand.js';const state = { status: 'loading', release: null };diff --git a/src/main.js b/src/main.jsindex 47efc208..d491bc6d 100644--- a/src/main.js+++ b/src/main.js@@ -1,4 +1,5 @@import './style.css';+import './brand.js';import { Renderer67 } from './renderer.js';import { createModel } from './model.js';import { downloadGlb } from './export.js';@@ -13,6 +14,16 @@ const finishes = {graphite: { name: 'Graphite', color: [0.10, 0.14, 0.17], surface: [0.65, 0.4] },};const state = { azimuth: 0.48, elevation: 0.18, distance: 7.8, finish: 'yellow', exposure: 1, inspection: false, rotating: false, assembly: Math.max(0, Math.min(1, Number(new URLSearchParams(location.search).get('explosion')) || 0)), layer: 'all' };+state.look = 'studio';+state.targetHeight = 1.35;+state.touring = false;+const reducedMotion = matchMedia('(prefers-reduced-motion: reduce)');+const looks = {+ studio: { lightDirection: [-3, 6, 4], temperature: 0, contrast: 1.02 },+ warm: { lightDirection: [-5, 3, 2], temperature: 0.14, contrast: 1.06 },+ cool: { lightDirection: [4, 5, 3], temperature: -0.14, contrast: 1.05 },+};+let tourOrigin = 0;let renderer;let scheduledFrame = 0;let lastTime = 0;@@ -32,8 +43,8 @@ function notify(message, failure = false) {function camera() {const mobile = canvas.clientWidth <= 700;if (renderer) renderer.projection[8] = mobile || state.exporting ? 0 : -0.25 + state.assembly * 0.15;- const distance = state.distance * (mobile ? 0.78 : 1) + state.assembly * (mobile ? 8 : 10);- const target = [0, (mobile ? 1.5 : 1.35) + state.assembly * 0.35, 0];+ const distance = state.distance * (mobile ? 1.05 : 1) + state.assembly * (mobile ? 8 : 10);+ const target = [0, (mobile ? 1.5 : state.targetHeight) + state.assembly * 0.35, 0];return {target,eye: [Math.sin(state.azimuth) * Math.cos(state.elevation) * distance, target[1] + Math.sin(state.elevation) * distance, Math.cos(state.azimuth) * Math.cos(state.elevation) * distance],@@ -42,12 +53,20 @@ function camera() {exposure: state.exposure,inspection: state.inspection,assemblyAmount: state.assembly,+ environment: { lightDirection: looks[state.look].lightDirection },+ effects: { contrast: looks[state.look].contrast, temperature: looks[state.look].temperature, saturation: 1.02, vignette: 0.08, bloom: { strength: 0.12, threshold: 1.15, radius: 1 } },};}function draw(time) {scheduledFrame = 0;if (!renderer || document.hidden) return;+ if (state.touring) {+ const progress = Math.min(1, (time - tourOrigin) / 8000);+ state.assembly = Math.sin(progress * Math.PI) ** 2;+ syncAssembly();+ if (progress === 1) stopTour();+ }if (state.rotating && !dragging) state.azimuth += Math.min((time - lastTime) / 1000, 0.05) * 0.16;lastTime = time;renderer.render(camera());@@ -55,7 +74,7 @@ function draw(time) {frameCount++;document.querySelector('#cpu').textContent = `${(cpuTotal / frameCount).toFixed(2)} ms CPU`;if (frameCount > 60) { cpuTotal = renderer.cpuMilliseconds; frameCount = 1; }- if (state.rotating) invalidate();+ if (state.rotating || state.touring) invalidate();}function invalidate() {@@ -64,7 +83,7 @@ function invalidate() {function initialize() {const visibleParts = state.layer === 'all' ? parts : parts.filter((part) => part.assembly?.layer === state.layer);- renderer = new Renderer67(canvas, visibleParts, { samples: Number(renderParameters.get('samples') ?? 4), memoryBudgetMiB: Number(renderParameters.get('memory') ?? 256), pixelRatio: renderParameters.get('export') === '1' ? 1 : 1.5, shadowBounds: { extent: 6, eye: [-3, 7, 4], target: [0, 1.5, 0] } });+ renderer = new Renderer67(canvas, visibleParts, { hdr: true, samples: Number(renderParameters.get('samples') ?? 4), memoryBudgetMiB: Number(renderParameters.get('memory') ?? 256), pixelRatio: renderParameters.get('export') === '1' ? 1 : 1.5, shadowBounds: { extent: 6, eye: [-3, 7, 4], target: [0, 1.5, 0] } });document.querySelector('#parts').textContent = `${visibleParts.length} parts · ${Math.round(renderer.triangles / 1000)}k triangles`;document.querySelector('#calls').textContent = `${renderer.batches.length} geometry draws`;invalidate();@@ -78,11 +97,53 @@ document.querySelector('#assembly').setAttribute('aria-valuetext', state.assembltry { initialize(); } catch (error) { notify(error.message, true); }document.querySelector('#assembly').addEventListener('input', (event) => {+ stopTour();state.assembly = Number(event.target.value) / 100;document.querySelector('#assembly-value').textContent = `${event.target.value}%`;event.target.setAttribute('aria-valuetext', state.assembly === 0 ? 'Assembled' : state.assembly === 1 ? 'Fully exploded' : `${event.target.value}% exploded`);invalidate();});++function syncAssembly() {+ const percent = Math.round(state.assembly * 100);+ document.querySelector('#assembly').value = String(percent);+ document.querySelector('#assembly-value').textContent = `${percent}%`;+ document.querySelector('#assembly').setAttribute('aria-valuetext', `${percent}% exploded`);+}+function stopTour() {+ state.touring = false;+ document.querySelector('#assembly-tour').textContent = 'Play assembly';+}+document.querySelector('#assembly-tour').addEventListener('click', () => {+ if (state.touring) { stopTour(); return; }+ if (reducedMotion.matches) { state.assembly = state.assembly > 0.5 ? 0 : 1; syncAssembly(); invalidate(); return; }+ // A complete-model composition keeps all moving components in the frame.+ Object.assign(state, { distance: 7.8, targetHeight: 1.35, touring: true });+ tourOrigin = performance.now();+ document.querySelector('#assembly-tour').textContent = 'Pause assembly';+ invalidate();+});+document.querySelectorAll('[data-view]').forEach(button => button.addEventListener('click', () => {+ stopTour();+ const views = { hero: [0.48, 0.18, 7.8, 1.35, 0], face: [0.12, 0.12, 3.8, 2.55, 0], machine: [0.7, 0.34, 6.8, 1.35, 0.65] };+ const [azimuth, elevation, distance, targetHeight, assembly] = views[button.dataset.view];+ Object.assign(state, { azimuth, elevation, distance, targetHeight, assembly });+ document.querySelectorAll('[data-view]').forEach(control => control.setAttribute('aria-pressed', String(control === button)));+ syncAssembly(); invalidate();+}));+document.querySelector('#look').addEventListener('change', event => { state.look = event.target.value; invalidate(); });+document.querySelector('#save-model').addEventListener('click', () => {+ if (!renderer) return;+ renderer.render(camera());+ canvas.toBlob(blob => {+ if (!blob) { notify('Image capture failed. Try again.', true); return; }+ const url = URL.createObjectURL(blob);+ const link = document.createElement('a'); link.href = url; link.download = '67js-wall-e.png'; link.click();+ setTimeout(() => URL.revokeObjectURL(url), 1000);+ }, 'image/png');+});+document.addEventListener('visibilitychange', () => { if (document.hidden) stopTour(); });+reducedMotion.addEventListener('change', event => { if (event.matches) { stopTour(); state.rotating = false; document.querySelector('#rotate').setAttribute('aria-pressed', 'false'); } });document.querySelectorAll('[data-layer]').forEach((button) => button.addEventListener('click', () => {state.layer = button.dataset.layer;document.querySelectorAll('[data-layer]').forEach((control) => control.setAttribute('aria-pressed', String(control === button)));@@ -122,7 +183,8 @@ canvas.addEventListener('keydown', (event) => {if (event.key.toLowerCase() === 'r') document.querySelector('#reset').click();});document.querySelector('#reset').addEventListener('click', () => {- Object.assign(state, { azimuth: 0.48, elevation: 0.18, distance: 7.8 });+ stopTour();+ Object.assign(state, { azimuth: 0.48, elevation: 0.18, distance: 7.8, targetHeight: 1.35 });invalidate();});document.querySelectorAll('[data-finish]').forEach((button) => button.addEventListener('click', () => {diff --git a/src/motion-player.js b/src/motion-player.jsindex e477b95f..74e9599f 100644--- a/src/motion-player.js+++ b/src/motion-player.js@@ -1,6 +1,8 @@import './motion-style.css';+import './brand.js';import { Renderer67 } from './renderer.js';import { createMotionScene, MOTION_DURATION } from './motion.js';+import { EFFECT_PRESETS } from './effects.js';const query = new URLSearchParams(location.search);const exporting = query.get('export') === '1';@@ -40,7 +42,8 @@ function showError(error) {function renderAt(time) {const frame = scene.sample(time, state.aspect);renderer.updateParts(scene.parts, { shadows: true });- renderer.render({ ...frame.camera, time: frame.time, exposure: frame.exposure, effects: frame.effects });+ const look = document.querySelector('#motion-look').value;+ renderer.render({ ...frame.camera, time: frame.time, exposure: frame.exposure, effects: look === 'cinematic' ? frame.effects : EFFECT_PRESETS[look] });state.time = frame.time;slider.value = String(state.time);slider.setAttribute('aria-valuetext', `${state.time.toFixed(1)} of ${MOTION_DURATION} seconds`);@@ -82,6 +85,18 @@ function initializeRenderer() {}playButton.addEventListener('click', () => { if (renderer) setPlaying(!state.playing); });+document.querySelector('#motion-look').addEventListener('change', () => { if (renderer) renderAt(state.time); });+document.querySelector('#motion-save').addEventListener('click', () => {+ if (!renderer) return;+ setPlaying(false);+ renderAt(state.time);+ canvas.toBlob(blob => {+ if (!blob) { showError(new Error('Image capture failed')); return; }+ const url = URL.createObjectURL(blob);+ const link = document.createElement('a'); link.href = url; link.download = '67js-clockwork.png'; link.click();+ setTimeout(() => URL.revokeObjectURL(url), 1000);+ }, 'image/png');+});document.querySelector('#motion-replay').addEventListener('click', () => {if (!renderer) return;setPlaying(false);diff --git a/src/motion-style.css b/src/motion-style.cssindex 61f111e6..1ce9e680 100644--- a/src/motion-style.css+++ b/src/motion-style.css@@ -32,6 +32,8 @@ input[type='range'] { grid-column: 1 / -1; margin: -8px 0 0; width: 100%; accent.export-mode .interface { display: none !important; }.export-mode .motion-stage { position: fixed; inset: 0; max-height: none; margin: 0; border-radius: 0; }[hidden] { display: none !important; }+.motion-header { flex-wrap:wrap; }+.motion-header nav { flex-wrap:wrap; }@media (max-width: 700px) {main { padding: 18px 18px 28px; }.motion-header { gap: 16px; margin-bottom: 20px; }diff --git a/src/motion.js b/src/motion.jsindex cd9d2b3d..a2ece490 100644--- a/src/motion.js+++ b/src/motion.js@@ -83,6 +83,19 @@ export function createMotionScene() {}add('Lower spindle', 'collar', [0, -0.9, 0], [0.13, 0.75, 0.13], steel);add('Spindle tip', 'bead', [0, -1.31, 0], [0.18, 0.18, 0.18], gold);+ // Radial ribs, luminous collars and orbital markers make the assembly legible at close range.+ for (let rib = 0; rib < 24; rib++) {+ const angle = rib / 24 * Math.PI * 2;+ add(`Cooling rib ${rib}`, 'plate', [Math.cos(angle) * 0.57, 0, Math.sin(angle) * 0.57], [0.035, 1.05, 0.08], steel, [0, -angle * 180 / Math.PI, 0]);+ }+ for (const height of [-0.66, 0.66]) {+ add(`Light collar ${height}`, 'ring', [0, height, 0], [0.67, 0.67, 0.67], glow, [90, 0, 0]);+ }+ add('Orbital rail', 'ring', [0, -0.2, 0], [2.2, 2.2, 2.2], dark, [90, 0, 0]);+ for (let tick = 0; tick < 72; tick++) {+ const angle = tick / 72 * Math.PI * 2;+ add(`Orbital index ${tick}`, 'plate', [Math.cos(angle) * 2.2, -0.2, Math.sin(angle) * 2.2], [tick % 6 === 0 ? 0.13 : 0.05, 0.025, 0.025], tick % 6 === 0 ? gold : steel, [0, -angle * 180 / Math.PI, 0]);+ }const clip = createAnimationClip({ duration: MOTION_DURATION, tracks });const player = createAnimationPlayer(clip, parts);const cameras = [diff --git a/src/nature-style.css b/src/nature-style.cssindex 2326149e..455fbb98 100644--- a/src/nature-style.css+++ b/src/nature-style.css@@ -77,3 +77,19 @@ footer p { margin: 0; }.landscape-title { bottom: 138px; }}@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto; } }+.landscape-controls { flex-wrap:wrap; gap:16px 24px; }+.landscape-controls .demo-presets { margin:0; }+@media (max-width:760px) {+ main { height:auto; min-height:100svh; overflow:visible; background:#171717; }+ .world-header { position:relative; inset:auto; padding:18px 20px; flex-wrap:wrap; gap:14px; text-shadow:none; }+ .world-header nav { order:3; width:100%; flex-wrap:wrap; }+ #save-image { margin-left:auto; }+ .landscape-title { position:relative; inset:auto; margin:8px 22px 22px; text-shadow:none; }+ .landscape-title p { font-size:13px; }+ #viewport { position:relative; inset:auto; height:430px; width:100%; }+ .landscape-controls { position:relative; inset:auto; margin:16px; gap:18px; }+ .landscape-controls .demo-presets { grid-column:1 / -1; }+ .landscape-controls label[for=detail] { display:grid; gap:8px; }+ #detail { margin:0; width:100%; padding:10px; }+ footer { position:relative; inset:auto; margin:20px; text-shadow:none; }+}diff --git a/src/nature-viewer.js b/src/nature-viewer.jsindex f6ab8aae..65e8b4e4 100644--- a/src/nature-viewer.js+++ b/src/nature-viewer.js@@ -1,4 +1,5 @@import './nature-style.css';+import './brand.js';import { vec4 } from 'gl-matrix';import { Renderer67 } from './renderer.js';import { createNatureWorld } from './nature.js';@@ -63,7 +64,7 @@ function environment() {}function renderFrame() {- renderer?.render({ ...camera(), time: state.time, wind: state.wind, waterRipple: state.waterRipple, rippleTime: state.rippleTime, environment: environment() });+ renderer?.render({ ...camera(), time: state.time, wind: state.wind, waterRipple: state.waterRipple, rippleTime: state.rippleTime, environment: environment(), effects: { saturation: 1.06, contrast: 1.03, temperature: (1 - state.daylight) * 0.1, vignette: 0.07, bloom: { strength: 0.1, threshold: 1.2, radius: 1.3 } } });}function stopAnimation() {@@ -97,7 +98,7 @@ function updateStatistics() {function initializeRenderer() {renderer = new Renderer67(canvas, world.parts, {- world: true, ground: false, environment: world.environment,+ world: true, ground: false, hdr: true, environment: world.environment,pixelRatio: renderParameters.get('export') === '1' ? 1 : 1.25, memoryBudgetMiB: Number(renderParameters.get('memory') ?? 256), samples: Number(renderParameters.get('samples') ?? 4),});updateStatistics();@@ -166,6 +167,11 @@ document.querySelector('#wind').addEventListener('input', event => {document.querySelector('#wind-value').textContent = state.wind < 0.1 ? 'Still' : state.wind < 0.55 ? 'Gentle' : 'Breezy';invalidate();});+document.querySelectorAll('[data-daylight]').forEach(button => button.addEventListener('click', () => {+ const slider = document.querySelector('#daylight');+ slider.value = button.dataset.daylight;+ slider.dispatchEvent(new Event('input', { bubbles: true }));+}));motionButton.addEventListener('click', () => {state.paused = !state.paused;lastFrameTime = 0;diff --git a/src/nature.js b/src/nature.jsindex 25c019ce..14e76850 100644--- a/src/nature.js+++ b/src/nature.js@@ -1,5 +1,5 @@import { mat4, quat } from 'gl-matrix';-import { cylinder, sphere } from './geometry.js';+import { box, cylinder, sphere } from './geometry.js';const FULL_TURN = Math.PI * 2;const DETAIL_PRESETS = {@@ -360,6 +360,29 @@ export function createNatureWorld({ seed = 67, detail = 'balanced' } = {}) {add(`Wildflower ${index} blossom`, blossomMesh, [horizontal, ground + height, depth], [1, 1, 1], flowerColors[index % flowerColors.length], [0.1, random() * FULL_TURN, 0.12]);}+ const bridgeDepth = -2;+ const bridgeCenter = streamCenter(bridgeDepth);+ const bridgeLength = streamWidth(bridgeDepth) * 2 + 3.4;+ const timberMesh = box(0.045, 2);+ const fastenerMesh = cylinder(6, 0, 1);+ const warmWood = material('wood', [0.26, 0.13, 0.045], 0.66);+ const lightWood = material('wood', [0.34, 0.19, 0.065], 0.72);+ const iron = material('metal', [0.09, 0.1, 0.095], 0.38, 0.75);+ for (let plank = 0; plank < 36; plank++) {+ const x = bridgeCenter - bridgeLength / 2 + (plank + 0.5) * bridgeLength / 36;+ add(`Footbridge plank ${plank}`, timberMesh, [x, 1.2, bridgeDepth], [bridgeLength / 36 * 0.93, 0.14, 1.7], plank % 3 ? warmWood : lightWood);+ for (const side of [-1, 1]) add(`Footbridge nail ${plank} ${side}`, fastenerMesh, [x, 1.277, bridgeDepth + side * 0.58], [0.018, 0.018, 0.018], iron);+ }+ for (const side of [-1, 1]) {+ add(`Bridge support ${side}`, timberMesh, [bridgeCenter, 1.04, bridgeDepth + side * 0.6], [bridgeLength + 0.3, 0.26, 0.22], warmWood);+ add(`Bridge handrail ${side}`, timberMesh, [bridgeCenter, 2.26, bridgeDepth + side * 0.88], [bridgeLength + 0.3, 0.12, 0.13], lightWood);+ add(`Bridge lower rail ${side}`, timberMesh, [bridgeCenter, 1.73, bridgeDepth + side * 0.88], [bridgeLength, 0.08, 0.1], warmWood);+ for (let post = 0; post < 7; post++) {+ const x = bridgeCenter - bridgeLength / 2 + post * bridgeLength / 6;+ add(`Bridge post ${side} ${post}`, timberMesh, [x, 1.15, bridgeDepth + side * 0.88], [0.13, 2.24, 0.13], warmWood);+ add(`Bridge post cap ${side} ${post}`, timberMesh, [x, 2.3, bridgeDepth + side * 0.88], [0.21, 0.08, 0.21], iron);+ }+ }const camera = { eye: [15, 8, 23], target: [-2, 2, -12] };return {name: 'Silverwater valley',@@ -379,6 +402,7 @@ export function createNatureWorld({ seed = 67, detail = 'balanced' } = {}) {{ name: 'By the water', eye: [7, 2.4, 14], target: [-3, 1.5, -15] },{ name: 'Birch grove', eye: [-18, 4, 17], target: [-3, 3, -7] },{ name: 'Mountain air', eye: [23, 15, -4], target: [-5, 5, -50] },+ { name: 'Footbridge', eye: [bridgeCenter + 8, 3.4, 9], target: [bridgeCenter, 1.2, bridgeDepth] },],};}diff --git a/src/style.css b/src/style.cssindex 5ebab8d2..947fe9ab 100644--- a/src/style.css+++ b/src/style.css@@ -59,6 +59,7 @@ footer button { font-size: 12px; }h2 { font-weight: 500; font-size: 20px; margin: 0 0 15px; }#benchmark-summary { white-space: pre-line; line-height: 1.9; font-size: 14px; font-variant-numeric: tabular-nums; }.benchmark-note { font-size: 12px; line-height: 1.7; color: #a2afb5; }+.controls { max-height:calc(100svh - 160px); overflow-y:auto; }@media (max-width: 1100px) {.object-info { top: 19%; max-width: 250px; }h1 { font-size: 35px; }@@ -97,3 +98,14 @@ h2 { font-weight: 500; font-size: 20px; margin: 0 0 15px; }.benchmark-result { left: 20px; bottom: 85px; max-width: calc(100% - 40px); }}@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }+@media (max-width:700px) {+ main { height:auto; min-height:100svh; overflow:visible; }+ .toolbar { position:relative; inset:auto; padding:18px 20px; flex-wrap:wrap; gap:14px; }+ .studio-nav { position:static; order:3; width:100%; }+ #viewport { position:relative; top:auto; margin-top:0; height:380px; }+ .controls { position:relative; inset:auto; margin:16px 20px 24px; max-height:none; }+ footer { position:relative; inset:auto; padding:0 20px 24px; }+ .object-info { position:relative; top:auto; left:auto; margin:8px 24px 20px; }+ .controls > .quality-label { display:grid; grid-column:span 2; }+ .controls > .demo-presets, .controls > .quality-label { grid-column:span 2; margin-top:4px; }+}diff --git a/src/view2d.js b/src/view2d.jsindex a97775ec..e2c25313 100644--- a/src/view2d.js+++ b/src/view2d.js@@ -1,4 +1,5 @@import './view2d.css';+import './brand.js';import { vec3 } from 'gl-matrix';import { Renderer67 } from './renderer.js';import { createModel } from './model.js';diff --git a/view2d.html b/view2d.htmlindex 6d495c4e..a93ad8ef 100644--- a/view2d.html+++ b/view2d.html@@ -5,6 +5,7 @@<meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#1e2327"><title>2D & orthographic views · 67.js</title>+ <link rel="icon" href="/favicon.svg" /></head><body><main class="workspace">@@ -17,7 +18,7 @@<button data-view="top" aria-pressed="false">Top</button><button data-view="right" aria-pressed="false">Right</button><button data-view="perspective" aria-pressed="false">Perspective</button>- </nav>+ <a href="./docs.html">Docs</a><a href="./index.html#examples">Showcase</a></nav><div class="toolbar-actions"><button id="fit">Fit view</button><button id="download" class="primary">Save PNG <span aria-hidden="true">↗</span></button></div></header><section class="stage" aria-label="Interactive scene">diff --git a/vite.config.js b/vite.config.jsindex 206efdeb..2249eb6e 100644--- a/vite.config.js+++ b/vite.config.js@@ -8,5 +8,5 @@ const headers = {export default defineConfig({server: { headers },preview: { headers },- build: { rolldownOptions: { input: { home: 'index.html', object: 'object.html', nature: 'nature.html', film: 'film.html', motion: 'motion.html', view2d: 'view2d.html', assets: 'assets.html', guide: 'getting-started.html' } } },+ build: { rolldownOptions: { input: { home: 'index.html', object: 'object.html', nature: 'nature.html', film: 'film.html', motion: 'motion.html', view2d: 'view2d.html', assets: 'assets.html', guide: 'getting-started.html', docs: 'docs.html' } } },});