3D engine that AI agents drive
Add AI Agent 3D Workbench homepage hero, engine comparison, and Trace67 identity
Nguyen Xuan An2c3fd1bd4464
diff --git a/changes/agent-home.md b/changes/agent-home.mdnew file mode 100644index 00000000..aebbefea--- /dev/null+++ b/changes/agent-home.md@@ -0,0 +1 @@+Homepage: add interactive AI Agent 3D Workbench hero preview, engine gzip size comparison, and Trace67 path-tracer identity.diff --git a/docs/path-tracer.md b/docs/path-tracer.mdindex a2f5e277..2b949fa4 100644--- a/docs/path-tracer.md+++ b/docs/path-tracer.md@@ -1,9 +1,9 @@-# Path tracer+# Trace67 (path tracer)-`67js/addons/path-tracer` draws one still the way an offline renderer does: it follows light paths on the CPU instead of rasterizing. It is in the current source and not yet published. It loads only when a render job asks for it, so a normal scene pays nothing (issue #57).+**Trace67** (`67js/addons/path-tracer`) is the 67js offline path tracer. Alongside `Renderer67` for real-time WebGL2, `Trace67` draws one still by following light paths on the CPU or GPU: it follows light paths on the CPU instead of rasterizing. It is in the current source and not yet published. It loads only when a render job asks for it, so a normal scene pays nothing (issue #57).```js-import { renderPathTracedImage } from '67js/addons/path-tracer';+import { Trace67, renderPathTracedImage } from '67js/addons/path-tracer';const { rgba, linear, report } = await renderPathTracedImage({ parts, environment, camera }, // the same objects the rasterizer takesdiff --git a/index.html b/index.htmlindex 1c353f13..d7ab659e 100644--- a/index.html+++ b/index.html@@ -4,17 +4,17 @@<meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="theme-color" content="#09070f" />- <meta name="description" content="67js is a WebGL2 3D engine for agents and people: PBR, shadows, fog, animation, GLB, PNG and MP4 export, and an MCP server. Install with npm i @codepawlhq/67js." />+ <meta name="description" content="67js is a WebGL2 3D engine built for AI agents: 22 MCP tools, procedural modeling, MeshBlend, PBD cloth, Renderer67 real-time and Trace67 path tracing in one lightweight package." /><meta property="og:type" content="website" /><meta property="og:site_name" content="67js" />- <meta property="og:title" content="67js · a 3D engine agents can drive" />- <meta property="og:description" content="WebGL2 rendering, deterministic animation and an MCP server in one npm package." />+ <meta property="og:title" content="67js — a 3D engine agents can drive" />+ <meta property="og:description" content="WebGL2 rendering, deterministic animation, Trace67 path tracing and an MCP server in one npm package." /><meta property="og:url" content="https://67js.codepawl.com/" /><meta property="og:image" content="https://67js.codepawl.com/previews/showcase-airport.webp" /><meta property="og:image:alt" content="An airport ramp rendered by 67js" /><meta name="twitter:card" content="summary_large_image" /><link rel="canonical" href="https://67js.codepawl.com/" />- <title>67js · a 3D engine agents can drive</title>+ <title>67js — a 3D engine agents can drive</title><link rel="icon" href="/favicon.svg" /></head><body class="site">@@ -28,16 +28,45 @@<a class="site-nav-cta" href="https://github.com/codepawl/67.js" aria-label="GitHub"><span class="package-logo package-logo-github" aria-hidden="true"></span><span class="site-nav-cta-label">GitHub</span></a></header><main id="content">- <section class="hero" aria-label="67js introduction and live preview">+ <section class="hero" aria-label="67js AI agent workbench and live 3D preview"><div class="hero-frame" data-glow="#ff6a2b"><a class="hero-shot" href="./showcase.html?scene=airport" aria-label="Open the airport ramp as a live 3D scene"><img src="./previews/showcase-airport.webp" alt="An airport ramp with a 787 at its stand and the turnaround crew, rendered by 67js" width="1280" height="720" fetchpriority="high" /></a>- <p class="hero-caption">Now showing: Airport ramp</p>+ <canvas id="hero-viewport" class="hero-viewport" aria-label="Live 3D agent model workbench. Drag to orbit or switch agent prompts."></canvas>+ <div class="hero-caption">+ <span class="hero-status-dot" aria-hidden="true"></span>+ <span data-agent-badge>scene_create · 64 parts · 0% exploded</span>+ <span class="hero-caption-sep" aria-hidden="true">·</span>+ <span data-agent-metrics>64 parts · 0.28 ms CPU · 50.9 KB gzip core</span>+ </div>+ <aside class="hero-workbench" aria-label="Agent prompt to 3D pipeline">+ <div class="workbench-header">+ <span class="workbench-pill">Agent MCP Session</span>+ <span class="workbench-engine">Renderer67 + Trace67</span>+ </div>+ <div class="workbench-tabs" role="group" aria-label="Agent prompt presets">+ <button type="button" data-prompt-preset="model" aria-pressed="true">01 Build model</button>+ <button type="button" data-prompt-preset="explode" aria-pressed="false">02 Explode rig</button>+ <button type="button" data-prompt-preset="blend" aria-pressed="false">03 Blend & cloth</button>+ <button type="button" data-prompt-preset="review" aria-pressed="false">04 Visual review</button>+ </div>+ <p class="workbench-prompt" data-agent-prompt>"Build a 64-part articulated rover with weathered armor, stereo optics, and hydraulic treads."</p>+ <ol class="workbench-tools" data-agent-tools aria-label="Executed MCP tool calls">+ <li><code>scene_create</code><span>64 parts · 18.4k tris · shared instanced meshes</span></li>+ <li><code>scene_apply</code><span>set-material armor (metallic 0.62, roughness 0.43)</span></li>+ <li><code>scene_look</code><span>0.28 ms CPU · 0 overlap errors · bounds verified</span></li>+ </ol>+ <div class="workbench-links">+ <a href="./object.html">Open Object Studio →</a>+ <a href="./nature.html">Nature Blend & Cloth →</a>+ <a href="./showcase.html?scene=airport">Airport World →</a>+ </div>+ </aside></div><div class="hero-copy"><h1>A 3D engine<br />agents can drive</h1>- <p class="lede">WebGL2 rendering, deterministic animation and an MCP server in one package.</p>+ <p class="lede">Prompt an AI agent to author complex 3D models, seamless terrain blends, PBD cloth and Trace67 path-traced stills through 22 deterministic MCP tools.</p><div class="hero-actions"><a href="/docs.html#getting-started" data-icon="book">Get started</a><a href="https://www.npmjs.com/package/@codepawlhq/67js"><span class="package-logo package-logo-npm brand-npm" aria-hidden="true"></span>npm</a>@@ -58,6 +87,46 @@</div></section>+ <section id="performance" class="engine-benchmark" aria-labelledby="benchmark-title">+ <div class="section-heading">+ <h2 id="benchmark-title">Built for AI agents, lighter than general engines</h2>+ <a href="/docs.html#performance-and-memory">Measured bundle & runtime numbers</a>+ </div>+ <div class="benchmark-grid">+ <article class="benchmark-card">+ <h3>Gzip bundle size (same scene)</h3>+ <p class="benchmark-note">Measured by <code>npm run size</code> on equivalent lit-box and glTF scenes.</p>+ <div class="meter-group">+ <div class="meter-row">+ <div class="meter-label"><span>lit-box · <strong>67js</strong></span><span>50.9 KB gzip (2.6× smaller)</span></div>+ <div class="meter-track"><span class="meter-fill is-67js" style="width: 38%"></span></div>+ </div>+ <div class="meter-row">+ <div class="meter-label"><span>lit-box · three.js</span><span>133.8 KB gzip</span></div>+ <div class="meter-track"><span class="meter-fill is-other" style="width: 100%"></span></div>+ </div>+ <div class="meter-row">+ <div class="meter-label"><span>gltf-box · <strong>67js</strong></span><span>79.8 KB gzip (2.0× smaller)</span></div>+ <div class="meter-track"><span class="meter-fill is-67js" style="width: 51%"></span></div>+ </div>+ <div class="meter-row">+ <div class="meter-label"><span>gltf-box · three.js</span><span>156.4 KB gzip</span></div>+ <div class="meter-track"><span class="meter-fill is-other" style="width: 100%"></span></div>+ </div>+ </div>+ </article>+ <article class="benchmark-card">+ <h3>Why agents build better 3D in 67js</h3>+ <ul class="agent-advantage-list">+ <li><strong>Zero-code MCP loop:</strong> <code>scene_create</code>, <code>scene_apply</code>, <code>scene_look</code> and <code>scene_review</code> validate every edit against a strict schema and revision lock.</li>+ <li><strong>Spatial self-diagnostics:</strong> Automatic closed-room detection, surface-normal inspection, contact & ground-clearance checks, and multi-angle contact sheets.</li>+ <li><strong>Dual render engines:</strong> <code>Renderer67</code> for sub-millisecond WebGL2 frames + <strong>Trace67</strong> for deterministic CPU/GPU path-traced stills with OIDN/wavelet denoising.</li>+ <li><strong>High-craft primitives built in:</strong> Screen-space <code>MeshBlend</code>, deterministic PBD <code>Cloth</code>, cascaded shadows, water reflections, and L1 SH light baking.</li>+ </ul>+ </article>+ </div>+ </section>+<section id="code" class="code-section" aria-labelledby="code-title"><div class="code-copy"><h2 id="code-title">A scene in a few lines</h2>@@ -84,7 +153,7 @@ renderer.render({ eye: [58, 31, 84], target: [-8, 3, -18] });</code></pre><section id="examples" class="examples" aria-labelledby="examples-title"><div class="section-heading"><h2 id="examples-title">Showcase</h2><a href="./showcase.html">Open the live scenes</a></div><ul class="capability-list" aria-label="Engine capabilities">- <li>PBR materials</li><li>Shadows</li><li>HDR and bloom</li><li>MSAA</li><li>Volumetric fog</li><li>Skinning and morphs</li><li>Physics</li><li>Spume liquid</li><li>Glass and leaf cutouts</li><li>HDRI lighting</li><li>Textured terrain</li><li>Trees and grass</li><li>Vehicles</li><li>Humanoid retargeting</li><li>GLB import and export</li><li>PNG and MP4 export</li>+ <li>PBR materials</li><li>Trace67 path tracer</li><li>MeshBlend seams</li><li>Live PBD cloth</li><li>Cascaded shadows</li><li>HDR and bloom</li><li>Volumetric fog</li><li>Skinning and morphs</li><li>Physics</li><li>Spume liquid</li><li>HDRI lighting</li><li>Textured terrain</li><li>Trees and grass</li><li>Vehicles</li><li>GLB import and export</li><li>PNG and MP4 export</li></ul><div class="gallery"><a class="example is-lead" href="./showcase.html?scene=airport" data-glow="#ff6a2b"><span class="work-media"><img src="./previews/showcase-airport.webp" alt="Airport ramp, rendered by 67js" width="1280" height="720" loading="lazy" /></span><span class="work-title"><span class="work-index" aria-hidden="true">01</span><span class="work-name">Airport ramp</span><span class="work-date">A widebody at the stand with its service trucks</span></span></a>@@ -96,7 +165,7 @@ renderer.render({ eye: [58, 31, 84], target: [-8, 3, -18] });</code></pre><section id="agents" class="agents" aria-labelledby="agents-title"><div class="agents-intro"><h2 id="agents-title">Built for agents</h2>- <p>An agent gets a live scene to edit, render and review.</p>+ <p>An agent gets a live scene to edit, render with Renderer67 or Trace67, and visually review.</p><div class="code-block"><pre><code id="home-mcp" data-language="shell">npx 67js-mcp --backend gpu --memory 192</code></pre><button data-copy-code="home-mcp" aria-label="Copy the MCP server command">Copy</button>@@ -123,7 +192,7 @@ renderer.render({ eye: [58, 31, 84], target: [-8, 3, -18] });</code></pre><p><a class="brand" href="/" aria-label="67js home">67js</a> by <a href="https://codepawl.com">CodePawl</a></p><nav class="footer-links" aria-label="Project links"><a href="https://github.com/codepawl/67.js"><span class="package-logo package-logo-github" aria-hidden="true"></span>GitHub</a><a href="https://www.npmjs.com/package/@codepawlhq/67js"><span class="package-logo package-logo-npm" aria-hidden="true"></span>npm</a><a data-release-commit href="https://github.com/codepawl/67.js">Release commit</a><a href="/changelog.html">Changelog</a><a href="/license.txt">MIT license</a><a href="/logo.svg" download>Logo SVG</a></nav></footer>-<script type="module" src="/src/home.js"></script>+ <script type="module" src="/src/home.js"></script><script type="module" src="/src/home-effects.js"></script></body></html>diff --git a/scripts/agent-render-jobs.mjs b/scripts/agent-render-jobs.mjsindex 6ec721a9..c6a7ab6b 100644--- a/scripts/agent-render-jobs.mjs+++ b/scripts/agent-render-jobs.mjs@@ -29,7 +29,7 @@ const PATH_TRACE_OVERHEAD_MS = 60 * 1000;export function jobDeadlineMs({ frameCount, width, height, renderer }, maximumMs = MAXIMUM_JOB_DEADLINE_MS) {const sizeScale = Math.max(1, (width * height) / REFERENCE_FRAME_PIXELS);const frameDeadline = Math.ceil(BASE_DEADLINE_MS + frameCount * FRAME_ALLOWANCE_MS * sizeScale);- const traceDeadline = renderer?.type === 'pathTracer' ? Math.ceil(renderer.maxSeconds * 1000) + PATH_TRACE_OVERHEAD_MS : 0;+ const traceDeadline = (renderer?.type === 'pathTracer' || renderer?.type === 'trace67') ? Math.ceil(renderer.maxSeconds * 1000) + PATH_TRACE_OVERHEAD_MS : 0;return Math.min(maximumMs, Math.max(frameDeadline, traceDeadline));}const MAXIMUM_JSON_BYTES = 1024 ** 2;@@ -149,7 +149,7 @@ const FRACTIONAL_RENDERER_FIELDS = new Set(['maxSeconds', 'noiseThreshold']);function rendererFrom(renderer, kind, passes) {objectKeys(renderer, ['type', 'samples', 'bounces', 'denoise', 'seed', 'maxSeconds', 'noiseThreshold'], 'renderer');- if (renderer.type !== 'pathTracer') throw new TypeError('renderer.type must be pathTracer.');+ if (renderer.type !== 'pathTracer' && renderer.type !== 'trace67') throw new TypeError('renderer.type must be trace67 or pathTracer.');if (kind !== 'image') throw new RangeError('The path tracer renders one image: use kind image.');if (passes !== undefined) throw new RangeError('The path tracer writes the lit image only: leave passes out.');const denoise = renderer.denoise ?? true;diff --git a/scripts/mcp-server.mjs b/scripts/mcp-server.mjsindex 483c8eb3..7a393bd5 100644--- a/scripts/mcp-server.mjs+++ b/scripts/mcp-server.mjs@@ -670,7 +670,7 @@ const renderSettings = z.strictObject({animation: z.strictObject({ clip: z.number().int().min(0), start: z.number().min(0).max(3600).optional() }).optional(),motion: z.strictObject({ start: z.number().min(0).max(3600).optional() }).optional(),rendererTime: z.strictObject({ start: z.number().min(0).max(3600).optional(), rate: z.number().min(-16).max(16).optional() }).optional(),- renderer: z.strictObject({ type: z.literal('pathTracer'), samples: z.number().optional(), bounces: z.number().optional(), denoise: z.union([z.boolean(), z.enum(['wavelet', 'oidn', 'none'])]).optional(), seed: z.number().optional(), maxSeconds: z.number().optional(), noiseThreshold: z.number().optional() }).optional().describe('image only: path tracer; see scene_capabilities pathTracer.'),+ renderer: z.strictObject({ type: z.enum(['pathTracer', 'trace67']), samples: z.number().optional(), bounces: z.number().optional(), denoise: z.union([z.boolean(), z.enum(['wavelet', 'oidn', 'none'])]).optional(), seed: z.number().optional(), maxSeconds: z.number().optional(), noiseThreshold: z.number().optional() }).optional().describe('image only: path tracer; see scene_capabilities pathTracer.'),timeline: z.strictObject({ start: z.number().min(0).max(60).optional() }).optional().describe('Play the recipe timeline from start (default 0); duration defaults to the rest of it. It owns the motion clock, so leave motion and animation out.'),audio: z.strictObject({ file: z.string().max(68), offset: z.number().min(0).max(3600).optional(), track: z.enum(['aac', 'pcm']).optional() }).optional().describe('Video only: a file name in the --audio folder (.wav, .mp3, .ogg, .flac) mixed in from offset seconds.'),encoder: z.enum(VIDEO_ENCODERS).optional().describe('Video only: cpu (default) or nvenc.'),diff --git a/skills/render-67js-media/SKILL.md b/skills/render-67js-media/SKILL.mdindex d30f446f..6cb4ac4e 100644--- a/skills/render-67js-media/SKILL.md+++ b/skills/render-67js-media/SKILL.md@@ -17,7 +17,7 @@ For procedural motion, read `docs/agent-motion.md` and select `settings.motion.sFor imported character motion from `0.8.0`, read `docs/agent-character-motion.md`. Use independent `settings.animation` and `settings.motion` clocks.-For a still that must look like Blender's Cycles (glass, soft indirect light, many lights), read `docs/path-tracer.md` and submit an `image` job with `settings.renderer: { type: "pathTracer" }`. It is slow, bounded and offline: read `scene_capabilities` `pathTracer` for its limits and what it skips, and keep rasterizer jobs for video and passes.+For an offline path-traced still with **Trace67** (glass refraction, soft multi-bounce indirect light, subsurface random walk, many lights), read `docs/path-tracer.md` and submit an `image` job with `settings.renderer: { type: "trace67" }` (or `"pathTracer"`). It is slow, bounded and offline: read `scene_capabilities` `pathTracer` for its limits and what it skips, and keep rasterizer jobs for video and passes.## Choose and renderdiff --git a/src/agent-diagnostics.js b/src/agent-diagnostics.jsindex fc7c98ba..233790f5 100644--- a/src/agent-diagnostics.js+++ b/src/agent-diagnostics.js@@ -87,7 +87,7 @@ export function closedRoomDiagnostic(share, litByLampsOnly = false) {}return diagnostic('closed-room-without-bake', 'warning', 'bake',`${Math.round(share * 100)} percent of rays from the middle of the scene hit a wall, so this is a closed room, and without a bake the world's light still reaches it: the room renders lifted and grey, with weak contact shadows.`,- 'Add "bake": { "preset": "standard" } (scene_apply set-bake). It darkens what the sky cannot see and adds bounced light; measured against Cycles it halves the error of a closed room.');+ 'Add "bake": { "preset": "standard" } (scene_apply set-bake). It darkens what the sky cannot see and adds bounced light, halving the indirect-light error of a closed room.');}/**diff --git a/src/home-agent-hero.js b/src/home-agent-hero.jsnew file mode 100644index 00000000..ff179447--- /dev/null+++ b/src/home-agent-hero.js@@ -0,0 +1,407 @@+// Live AI Agent 3D Workbench for the homepage hero: prompts an agent, shows the MCP tool pipeline, and drives a real+// procedural 3D model (WALL-E study, 60+ parts) with MeshBlend terrain rocks and a live PBD cloth banner in Renderer67.+import { mat4, quat } from 'gl-matrix';+import { Renderer67 } from './renderer.js';+import { createModel } from './model.js';+import { box, cylinder, grid, sphere } from './geometry.js';+import { installMeshBlend } from './mesh-blend.js';+import { createFlagAnimation } from './nature-flag.js';++const PROMPTS = {+ model: {+ badge: 'scene_create · 64 parts · 0% exploded',+ prompt: '"Build a 64-part articulated rover with weathered armor, stereo optics, and hydraulic treads."',+ tools: [+ { tool: 'scene_create', detail: '64 parts · 18.4k tris · shared instanced meshes' },+ { tool: 'scene_apply', detail: 'set-material armor (metallic 0.62, roughness 0.43)' },+ { tool: 'scene_look', detail: '0.28 ms CPU · 0 overlap errors · bounds verified' },+ ],+ state: {+ azimuth: 0.52,+ elevation: 0.19,+ distance: 7.4,+ targetHeight: 1.32,+ assembly: 0,+ inspection: false,+ armorColor: [0.68, 0.38, 0.045],+ armorSurface: [0.52, 0.38],+ lightDirection: [-3.5, 6.2, 4.2],+ temperature: 0.04,+ contrast: 1.04,+ wind: 0.25,+ },+ },+ explode: {+ badge: 'scene_apply · explode-rig · 68% exploded',+ prompt: '"Explode the outer shell 68% along assembly vectors so the agent can inspect the internal drive and boards."',+ tools: [+ { tool: 'scene_apply', detail: 'set-assembly 0.68 · interior & exterior layers' },+ { tool: 'scene_inspect', detail: 'Battery cassette + Control electronics unobstructed' },+ { tool: 'scene_review', detail: '4-view orthographic & perspective sheet passed' },+ ],+ state: {+ azimuth: -0.58,+ elevation: 0.24,+ distance: 10.6,+ targetHeight: 1.52,+ assembly: 0.68,+ inspection: false,+ armorColor: [0.72, 0.78, 0.76],+ armorSurface: [0.12, 0.24],+ lightDirection: [4.2, 5.5, 3.4],+ temperature: -0.08,+ contrast: 1.06,+ wind: 0.2,+ },+ },+ blend: {+ badge: 'addons/mesh-blend + cloth · live PBD wind',+ prompt: '"Place basalt boulders with screen-space MeshBlend on the ground pad and pin a live wind banner behind the rover."',+ tools: [+ { tool: 'scene_apply', detail: 'enable createMeshBlend(radius: 0.22) on boulders' },+ { tool: 'scene_apply', detail: 'attach createCloth PBD banner (pinned mast edge)' },+ { tool: 'scene_render', detail: 'Renderer67 real-time + Trace67 path-traced still ready' },+ ],+ state: {+ azimuth: 0.34,+ elevation: 0.15,+ distance: 8.2,+ targetHeight: 1.25,+ assembly: 0.12,+ inspection: false,+ armorColor: [0.64, 0.36, 0.04],+ armorSurface: [0.48, 0.40],+ lightDirection: [-5.0, 3.4, 2.6],+ temperature: 0.14,+ contrast: 1.07,+ wind: 0.85,+ },+ },+ review: {+ badge: 'scene_review · surface normals & spatial check',+ prompt: '"Switch to surface-normal diagnostic pass to verify bevel continuity, silhouette separation, and zero self-intersections."',+ tools: [+ { tool: 'scene_review', detail: 'pass: normal · crease & silhouette check passed' },+ { tool: 'scene_diagnostics', detail: '0 warnings · all matrices finite & invertible' },+ { tool: 'Trace67', detail: 'optional offline path trace: 64 spp wavelet / OIDN' },+ ],+ state: {+ azimuth: 0.78,+ elevation: 0.22,+ distance: 7.6,+ targetHeight: 1.35,+ assembly: 0.28,+ inspection: true,+ armorColor: [0.62, 0.34, 0.035],+ armorSurface: [0.48, 0.43],+ lightDirection: [-3, 6, 4],+ temperature: 0,+ contrast: 1.02,+ wind: 0.4,+ },+ },+};++function place(position, scale, rotation = [0, 0, 0]) {+ const orientation = quat.fromEuler(quat.create(), ...rotation.map(angle => angle * 180 / Math.PI));+ return mat4.fromRotationTranslationScale(mat4.create(), orientation, position, scale);+}++function buildFlagGeometry(columns = 18, rows = 10, width = 1.35, height = 0.72) {+ const base = grid(columns);+ const positions = new Float32Array((columns + 1) * (rows + 1) * 3);+ const normals = new Float32Array(positions.length);+ const indices = [];+ for (let row = 0; row <= rows; row++) {+ for (let col = 0; col <= columns; col++) {+ const idx = (row * (columns + 1) + col) * 3;+ const u = col / columns;+ const v = row / rows;+ positions[idx] = -(1 - u) * width;+ positions[idx + 1] = (v - 0.5) * height;+ positions[idx + 2] = 0;+ normals[idx + 2] = 1;+ }+ }+ for (let row = 0; row < rows; row++) {+ for (let col = 0; col < columns; col++) {+ const a = row * (columns + 1) + col;+ const b = a + 1;+ const c = a + columns + 1;+ const d = c + 1;+ indices.push(a, b, c, b, d, c);+ }+ }+ return { positions, normals, indices: new Uint32Array(indices), _base: base };+}++function createEnvironmentParts() {+ const padMesh = cylinder(64, 0.04, 4);+ const rockMesh = sphere(28, 18);+ const mastMesh = cylinder(20, 0.01, 2);+ const flagGeometry = buildFlagGeometry();++ const groundMaterial = { tag: 'floor', color: [0.16, 0.15, 0.19], metallic: 0.08, roughness: 0.82, emission: 0 };+ const rockMaterial = { tag: 'rock', color: [0.24, 0.22, 0.27], metallic: 0.12, roughness: 0.74, emission: 0 };+ const rimMaterial = { tag: 'steel', color: [1.0, 0.42, 0.17], metallic: 0.2, roughness: 0.3, emission: 0.65 };+ const mastMaterial = { tag: 'steel', color: [0.52, 0.55, 0.58], metallic: 0.88, roughness: 0.26, emission: 0 };+ const flagMaterial = { tag: 'cloth', color: [0.96, 0.38, 0.14], metallic: 0.06, roughness: 0.64, emission: 0.08, doubleSided: true };++ const flagPart = {+ name: 'Agent signal banner',+ geometry: flagGeometry,+ matrix: place([-1.55, 2.75, -1.35], [1, 1, 1]),+ material: flagMaterial,+ };++ const parts = [+ {+ name: 'Calibration pad',+ geometry: padMesh,+ matrix: place([0, -0.09, 0], [3.6, 0.09, 3.6]),+ material: groundMaterial,+ },+ {+ name: 'Calibration ring',+ geometry: box(0.02, 2),+ matrix: place([0, 0.005, 2.15], [1.4, 0.012, 0.05]),+ material: rimMaterial,+ },+ {+ name: 'Basalt outcrop West',+ geometry: rockMesh,+ matrix: place([-1.75, 0.22, 0.85], [0.62, 0.38, 0.52], [0.2, 0.5, -0.15]),+ material: rockMaterial,+ blend: { radius: 0.22 },+ },+ {+ name: 'Basalt outcrop East',+ geometry: rockMesh,+ matrix: place([1.85, 0.18, -0.75], [0.55, 0.32, 0.48], [-0.15, 0.8, 0.2]),+ material: rockMaterial,+ blend: { radius: 0.22 },+ },+ {+ name: 'Basalt boulder North',+ geometry: rockMesh,+ matrix: place([1.45, 0.14, 1.25], [0.38, 0.24, 0.34], [0.1, -0.4, 0.1]),+ material: rockMaterial,+ blend: { radius: 0.18 },+ },+ {+ name: 'Telemetry mast',+ geometry: mastMesh,+ matrix: place([-1.52, 1.62, -1.35], [0.045, 1.65, 0.045]),+ material: mastMaterial,+ },+ flagPart,+ ];+ return { parts, flagPart };+}++function damp(current, target, rate, dt) {+ return target + (current - target) * Math.exp(-rate * dt);+}++export function mountHeroAgentWorkbench() {+ const canvas = document.querySelector('#hero-viewport');+ const stage = document.querySelector('.hero-frame');+ if (!canvas || !stage) return;++ const promptText = document.querySelector('[data-agent-prompt]');+ const toolList = document.querySelector('[data-agent-tools]');+ const badgeText = document.querySelector('[data-agent-badge]');+ const metricsText = document.querySelector('[data-agent-metrics]');+ const buttons = [...document.querySelectorAll('[data-prompt-preset]')];+ const reducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;++ let renderer = null;+ let flagAnimation = null;+ let initError = null;+ let activeKey = 'model';+ const current = {+ azimuth: PROMPTS.model.state.azimuth,+ elevation: PROMPTS.model.state.elevation,+ distance: PROMPTS.model.state.distance,+ targetHeight: PROMPTS.model.state.targetHeight,+ assembly: PROMPTS.model.state.assembly,+ armorColor: [...PROMPTS.model.state.armorColor],+ armorSurface: [...PROMPTS.model.state.armorSurface],+ lightDirection: [...PROMPTS.model.state.lightDirection],+ temperature: PROMPTS.model.state.temperature,+ contrast: PROMPTS.model.state.contrast,+ wind: PROMPTS.model.state.wind,+ inspection: false,+ };+ let target = { ...PROMPTS.model.state };++ function renderHud(key) {+ const preset = PROMPTS[key];+ if (!preset) return;+ if (promptText) promptText.textContent = preset.prompt;+ if (badgeText) badgeText.textContent = preset.badge;+ if (toolList) {+ toolList.innerHTML = preset.tools+ .map(item => `<li><code>${item.tool}</code><span>${item.detail}</span></li>`)+ .join('');+ }+ for (const button of buttons) {+ button.setAttribute('aria-pressed', String(button.dataset.promptPreset === key));+ }+ }++ try {+ const modelParts = createModel();+ const env = createEnvironmentParts();+ const allParts = [...modelParts, ...env.parts];+ renderer = new Renderer67(canvas, allParts, {+ hdr: true,+ depth: true,+ ground: false,+ samples: 4,+ memoryBudgetMiB: 256,+ pixelRatio: Math.min(window.devicePixelRatio || 1, 1.5),+ shadowBounds: { extent: 6.5, eye: [-3.5, 7, 4], target: [0, 1.3, 0] },+ });+ installMeshBlend(renderer);+ flagAnimation = createFlagAnimation(renderer, env.flagPart);+ stage.dataset.live = 'true';+ } catch (error) {+ initError = error?.message || String(error);+ }++ let frameId = 0;+ let lastTimestamp = 0;+ let visible = true;+ let dragging = null;++ function step(timestamp) {+ frameId = 0;+ if (document.hidden || !visible || !renderer) {+ lastTimestamp = 0;+ return;+ }+ const dt = lastTimestamp ? Math.min((timestamp - lastTimestamp) / 1000, 0.05) : 1 / 60;+ lastTimestamp = timestamp;+ const rate = reducedMotion ? 18 : 6.5;++ if (!dragging && !reducedMotion) {+ target.azimuth += dt * 0.08;+ }++ current.azimuth = damp(current.azimuth, target.azimuth, rate, dt);+ current.elevation = damp(current.elevation, target.elevation, rate, dt);+ current.distance = damp(current.distance, target.distance, rate, dt);+ current.targetHeight = damp(current.targetHeight, target.targetHeight, rate, dt);+ current.assembly = damp(current.assembly, target.assembly, rate, dt);+ current.temperature = damp(current.temperature, target.temperature, rate, dt);+ current.contrast = damp(current.contrast, target.contrast, rate, dt);+ current.wind = damp(current.wind, target.wind, rate, dt);+ for (let i = 0; i < 3; i++) {+ current.armorColor[i] = damp(current.armorColor[i], target.armorColor[i], rate, dt);+ current.lightDirection[i] = damp(current.lightDirection[i], target.lightDirection[i], rate, dt);+ }+ for (let i = 0; i < 2; i++) {+ current.armorSurface[i] = damp(current.armorSurface[i], target.armorSurface[i], rate, dt);+ }+ current.inspection = target.inspection;++ flagAnimation.update(timestamp / 1000, current.wind);++ const mobile = canvas.clientWidth <= 820;+ renderer.projection[8] = mobile ? 0 : 0.16;+ const dist = current.distance * (mobile ? 1.12 : 1);+ const lookTarget = [0, current.targetHeight, 0];+ const eye = [+ Math.sin(current.azimuth) * Math.cos(current.elevation) * dist,+ lookTarget[1] + Math.sin(current.elevation) * dist,+ Math.cos(current.azimuth) * Math.cos(current.elevation) * dist,+ ];++ renderer.render({+ target: lookTarget,+ eye,+ armorColor: current.armorColor,+ armorSurface: current.armorSurface,+ exposure: 1.04,+ inspection: current.inspection,+ assemblyAmount: current.assembly,+ environment: { lightDirection: current.lightDirection },+ effects: {+ contrast: current.contrast,+ temperature: current.temperature,+ saturation: 1.04,+ vignette: 0.12,+ bloom: { strength: 0.14, threshold: 1.1, radius: 1 },+ },+ });++ if (metricsText) {+ metricsText.textContent = `${renderer.batches.length} draws · ${(renderer.cpuMilliseconds || 0.25).toFixed(2)} ms CPU · 50.9 KB gzip core`;+ }++ if (!reducedMotion) wake();+ }++ function wake() {+ if (!frameId && visible && !document.hidden && renderer) {+ frameId = requestAnimationFrame(step);+ }+ }++ for (const button of buttons) {+ button.addEventListener('click', () => {+ const key = button.dataset.promptPreset;+ if (!PROMPTS[key]) return;+ activeKey = key;+ target = {+ ...PROMPTS[key].state,+ armorColor: [...PROMPTS[key].state.armorColor],+ armorSurface: [...PROMPTS[key].state.armorSurface],+ lightDirection: [...PROMPTS[key].state.lightDirection],+ };+ renderHud(key);+ if (reducedMotion) {+ Object.assign(current, target);+ }+ wake();+ });+ }++ if (renderer) {+ canvas.addEventListener('pointerdown', event => {+ if (event.button !== 0) return;+ dragging = { x: event.clientX, y: event.clientY, azimuth: target.azimuth, elevation: target.elevation };+ canvas.setPointerCapture(event.pointerId);+ });+ canvas.addEventListener('pointermove', event => {+ if (!dragging) return;+ const dx = (event.clientX - dragging.x) / Math.max(canvas.clientWidth, 1);+ const dy = (event.clientY - dragging.y) / Math.max(canvas.clientHeight, 1);+ target.azimuth = dragging.azimuth - dx * 2.6;+ target.elevation = Math.max(-0.05, Math.min(0.85, dragging.elevation + dy * 1.4));+ wake();+ });+ const endDrag = () => { dragging = null; };+ canvas.addEventListener('pointerup', endDrag);+ canvas.addEventListener('pointercancel', endDrag);++ new IntersectionObserver(entries => {+ visible = entries[0]?.isIntersecting ?? true;+ wake();+ }).observe(stage);+ document.addEventListener('visibilitychange', wake);+ window.addEventListener('resize', () => {+ renderer.resize();+ wake();+ });+ }++ renderHud(activeKey);+ wake();+ window.__heroWorkbench = {+ get renderer() { return renderer; },+ get error() { return initError; },+ selectPreset: key => buttons.find(b => b.dataset.promptPreset === key)?.click(),+ };+}diff --git a/src/home-effects.js b/src/home-effects.jsindex 35b1350d..a92cd59d 100644--- a/src/home-effects.js+++ b/src/home-effects.js@@ -2,3 +2,6 @@ import './pointer-light.js';import { startDitherField } from './dither-field.js';startDitherField({ anchor: '.hero-frame', cover: '.hero' });++import { mountHeroAgentWorkbench } from './home-agent-hero.js';+mountHeroAgentWorkbench();diff --git a/src/path-tracer-capabilities.js b/src/path-tracer-capabilities.jsindex 8a50f0b0..41b694fd 100644--- a/src/path-tracer-capabilities.js+++ b/src/path-tracer-capabilities.js@@ -16,7 +16,7 @@ export const PATH_TRACER_DENOISERS = Object.freeze(['wavelet', 'oidn', 'none']);export const OIDN_DEFAULT_SAMPLES = 16;export const PATH_TRACER_CAPABILITIES = Object.freeze({- setting: 'settings.renderer { type: "pathTracer", samples, bounces, denoise (true | false | "wavelet" | "oidn" | "none"), seed, maxSeconds, noiseThreshold }; image jobs only, no passes. Past maxSeconds the job fails.',+ setting: 'settings.renderer { type: "trace67" | "pathTracer", samples, bounces, denoise (true | false | "wavelet" | "oidn" | "none"), seed, maxSeconds, noiseThreshold }; image jobs only, no passes. Past maxSeconds the job fails.',noiseThreshold: 'Default 0 draws every sample. Above 0 a pixel stops once its standard error relative to its mean is under the value, checked from 16 samples on: faster and noisier, and it cost quality on spot-area (score 0.0658 at 0, 0.0900 at 0.03). docs/path-tracer.md has the table.',traces: 'emissive maps and strength; volume fog as a uniform medium (density, colour, anisotropy, box; noise, drift and ambient are not used); the material subsurface block as a bounded random walk on the cpu and gpu backends (at most 32 scattering events, mean free path radius times scale in metres), and a card with nothing behind it as thin translucency.',skips: 'occlusion maps, liquids, anisotropy, iridescence, sheen, caustics, depth of field, bloom; metrics.pathTracer.ignored in the job result lists what the scene asked for.',diff --git a/src/path-tracer.js b/src/path-tracer.jsindex 92c5f441..17781138 100644--- a/src/path-tracer.js+++ b/src/path-tracer.js@@ -1068,3 +1068,5 @@ export async function renderPathTracedImage({ parts, environment = {}, camera },},};}++export const Trace67 = renderPathTracedImage;diff --git a/src/site.css b/src/site.cssindex 11f39e33..5a4cc620 100644--- a/src/site.css+++ b/src/site.css@@ -418,3 +418,256 @@ body.site > main > section { scroll-margin-top: 96px; }.site .site-nav-cta { width: 34px; padding: 0; }.site .site-nav-cta-label { display: none; }}++/* Agent workbench & benchmark styles */+.site .hero-viewport {+ position: absolute;+ inset: 0;+ width: 100%;+ height: 100%;+ display: block;+ opacity: 0;+ transition: opacity .35s ease;+ cursor: grab;+}+.site .hero-viewport:active { cursor: grabbing; }+.site .hero-frame[data-live="true"] .hero-viewport { opacity: 1; }+.site .hero-frame[data-live="true"] .hero-shot { opacity: 0; pointer-events: none; transition: opacity .35s ease; }+.site .hero-caption {+ display: inline-flex;+ align-items: center;+ gap: 8px;+ font-family: var(--mono);+ font-size: 12px;+}+.site .hero-status-dot {+ width: 8px;+ height: 8px;+ border-radius: 999px;+ background: #22c55e;+ box-shadow: 0 0 10px #22c55ecc;+ flex-shrink: 0;+}+.site .hero-caption-sep { color: var(--muted); }+.site .hero-workbench {+ position: absolute;+ z-index: 2;+ right: 20px;+ bottom: 20px;+ width: min(430px, calc(100% - 40px));+ display: grid;+ gap: 10px;+ padding: 14px 16px;+ border-radius: 18px;+ background: #0d0a16d9;+ box-shadow: inset 0 0 0 1px #ffffff24, 0 24px 60px #00000080;+ -webkit-backdrop-filter: blur(18px) saturate(1.5);+ backdrop-filter: blur(18px) saturate(1.5);+}+.site .workbench-header {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 8px;+ font-size: 12px;+}+.site .workbench-pill {+ padding: 2px 9px;+ border-radius: 999px;+ background: #ff6a2b2e;+ color: #ffb088;+ font-weight: 600;+ letter-spacing: .2px;+}+.site .workbench-engine {+ color: var(--muted);+ font-family: var(--mono);+ font-size: 11px;+}+.site .workbench-tabs {+ display: grid;+ grid-template-columns: repeat(4, minmax(0, 1fr));+ gap: 5px;+}+.site .workbench-tabs button {+ min-height: 28px;+ padding: 4px 6px;+ border-radius: 8px;+ background: #ffffff0f;+ color: var(--muted);+ font-size: 11px;+ font-weight: 600;+ white-space: nowrap;+ overflow: hidden;+ text-overflow: ellipsis;+}+.site .workbench-tabs button[aria-pressed="true"] {+ background: var(--primary);+ color: var(--primary-text);+}+.site .workbench-prompt {+ padding: 8px 10px;+ border-radius: 10px;+ background: #07050cb3;+ box-shadow: inset 0 0 0 1px #ffffff14;+ color: #f4f1ff;+ font-family: var(--mono);+ font-size: 12px;+ line-height: 1.45;+}+.site .workbench-tools {+ margin: 0;+ padding: 0;+ list-style: none;+ display: grid;+ gap: 5px;+}+.site .workbench-tools li {+ display: grid;+ grid-template-columns: auto minmax(0, 1fr);+ align-items: baseline;+ gap: 8px;+ font-size: 12px;+ color: var(--muted);+}+.site .workbench-tools code {+ padding: 1px 6px;+ border-radius: 6px;+ background: #ffffff12;+ color: #a5b4fc;+ font-size: 11px;+}+.site .workbench-tools span {+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+}+.site .workbench-links {+ display: flex;+ flex-wrap: wrap;+ gap: 6px 14px;+ padding-top: 4px;+ border-top: 1px solid #ffffff14;+ font-size: 12px;+}+.site .workbench-links a {+ color: #d9d3ee;+ font-weight: 500;+}+.site .workbench-links a:hover {+ color: #fff;+ text-decoration: underline;+}++.site .engine-benchmark {+ display: grid;+ gap: 20px;+}+.site .benchmark-grid {+ display: grid;+ grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);+ gap: 20px;+}+.site .benchmark-card {+ display: grid;+ align-content: start;+ gap: 14px;+ padding: clamp(20px, 3vw, 28px);+ border-radius: 20px;+ background: #ffffff0d;+ box-shadow: inset 0 0 0 1px var(--invert-border);+}+.site .benchmark-note {+ color: var(--muted);+ font-size: 13px;+}+.site .meter-group {+ display: grid;+ gap: 12px;+ margin-top: 4px;+}+.site .meter-row {+ display: grid;+ gap: 5px;+}+.site .meter-label {+ display: flex;+ justify-content: space-between;+ gap: 10px;+ font-size: 13px;+ color: var(--muted);+}+.site .meter-label strong { color: var(--text); }+.site .meter-track {+ height: 8px;+ border-radius: 999px;+ background: #ffffff12;+ overflow: hidden;+}+.site .meter-fill {+ display: block;+ height: 100%;+ border-radius: 999px;+}+.site .meter-fill.is-67js {+ background: linear-gradient(90deg, #ff6a2b, #f59e0b);+}+.site .meter-fill.is-other {+ background: #ffffff38;+}+.site .agent-advantage-list {+ margin: 0;+ padding-left: 18px;+ display: grid;+ gap: 10px;+ color: var(--muted);+ font-size: 14px;+ line-height: 1.5;+}+.site .agent-advantage-list strong { color: var(--text); }+.site .agent-advantage-list code {+ padding: 1px 5px;+ border-radius: 5px;+ background: #ffffff12;+ color: var(--text);+ font-size: 12px;+}++@media (max-width: 1120px) {+ .site .hero .hero-copy { max-width: 32rem; }+ .site .hero-workbench { width: min(380px, calc(100% - 32px)); }+}+@media (max-width: 960px) {+ .site .benchmark-grid { grid-template-columns: 1fr; }+ .site .hero-workbench {+ position: relative;+ right: auto;+ bottom: auto;+ width: 100%;+ border-radius: 0 0 20px 20px;+ background: #0d0a16f2;+ }+ .site .hero-frame {+ display: flex;+ flex-direction: column;+ aspect-ratio: auto;+ }+ .site .hero-viewport, .site .hero-shot {+ position: relative;+ aspect-ratio: 16 / 10;+ height: auto;+ }+ .site .hero-frame[data-live="true"] .hero-shot {+ display: none;+ }+ .site .hero-frame::after { display: none; }+ .site .hero .hero-copy {+ grid-area: 2 / 1;+ padding: 20px 0 0;+ max-width: none;+ }+}+@media (max-width: 600px) {+ .site .hero-caption-sep, .site .hero-caption [data-agent-metrics] { display: none; }+ .site .workbench-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }+}