Files
hyperframes/registry/examples/path-traced-3d/index.html
T
James RussoandClaude Opus 5.5 d452a6fad4 feat(registry): add path-traced-3d example with raster preview and path-traced export (#7219)
* feat(registry): add path-traced-3d example with raster preview and path-traced export

An opt-in Three.js starter: previews with raster rendering and exports with
three-gpu-pathtracer, from one scene file. three 0.180.0, three-gpu-pathtracer
0.0.24 and three-mesh-bvh 0.9.5 ship as one local, pinned ES module with their
licences and a rebuild recipe, so renders make no network requests and 2D
projects never load the tracer.

Setup is one buildReady promise that awaits library readiness promises only
and ends with a throwaway frame and a one-pixel readback. Frames are drawn in
the hf-seek listener through waitUntil, each time from zero with a fixed
sample count. Math.random is seeded while the scene and tracer are built,
because object ids order light sampling and the tracer's noise textures come
from it.

Adds a skill reference and a docs guide for the setup and seek contract, the
frozen clock, why scheduler.yield() waits hang, and sample/bounce cost.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(registry): list path-traced-3d in CLI docs and tighten its notes

Add the example's section to the CLI examples doc, which docs.test.ts
requires for every registry example. Throw if the tracer reports compiling
but exposes no compile promise, instead of spinning renderSample(). Say that
three's object uuids set the tracer's sort order, that later-created objects
need the seed too, and that Date and performance.now read the current seek
time during a render rather than staying at 0.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-05 06:40:37 +00:00

58 lines
1.9 KiB
HTML
Vendored

<!doctype html>
<html
lang="en"
data-composition-variables='[{"id":"renderer","type":"enum","label":"Renderer","description":"raster draws each frame in milliseconds for previews. path traces light bounces for the final export and is much slower.","default":"raster","options":[{"value":"raster","label":"Raster (fast preview)"},{"value":"path","label":"Path tracing (export)"}]},{"id":"samples","type":"number","label":"Path samples per pixel","description":"Samples traced for every frame in path mode. More samples mean less noise and proportionally longer renders.","default":64,"min":1,"max":1024,"step":1},{"id":"bounces","type":"number","label":"Path light bounces","description":"How many times a ray may bounce in path mode. Reflections between objects need at least 2.","default":4,"min":1,"max":12,"step":1}]'
>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=1920, height=1080" />
<title>Path-traced 3D - HyperFrames</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html,
body {
width: 1920px;
height: 1080px;
overflow: hidden;
background: #0e1115;
}
#root {
position: relative;
width: 100%;
height: 100%;
}
#pt-canvas {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
display: block;
}
</style>
</head>
<body>
<div
id="root"
data-composition-id="main"
data-start="0"
data-duration="6"
data-width="1920"
data-height="1080"
data-no-timeline
>
<canvas
id="pt-canvas"
class="clip"
data-start="0"
data-duration="6"
data-track-index="1"
></canvas>
</div>
<script type="module" src="assets/render.js"></script>
</body>
</html>