Feature Library

Shot director: authored camera shows on a show clock (engine-free)

1.10 CPU ms
A still of the Shot director: authored camera shows on a show clock (engine-free) demo
Still
The live demo starts when it’s in view.Play, Hold and Cue · scrub the show · Screen: 16:9, 21:9, 32:9 · cut in from the panel

The HaTac engine’s camera director, lifted whole and engine-free.

The HaTac engine’s camera director, lifted whole and engine-free: shots as recipes (eye, target, field of view, roll, a lens shift and the subject’s bounds) that frame their subject beside a column of text measured in screen heights, so a 16:9 screen and a 32:9 wall show the same composition and the wall shows more world either side; moves compiled on the show clock (a critically damped sweep, a ride along a centripetal Catmull–Rom rail walked by distance with speed profiles and look-ahead, a fly-over, a track that follows a recording’s own clock, push-in, orbit, crane, drift and cuts), random access for scrubbing, and live operator actions (hold, which stops the beat clock while the eye drifts; cue, which carries on from where it was; go, a new move from the displayed pose and velocity) with no jump in position or velocity. A preflight check traces the full-motion path against boxes, spheres and the ground; at run time the eye is lifted clear. A small standalone director hands you the camera-relative view-projection with its lens shift, last frame’s view-projection rebased onto this eye for temporal effects, and a cut flag for every cut, seek and jump. No three.js, no dependencies, no GPU needed to run it.

What it costs a frame

1.10 ms
GPU
not used
CPU, median
1.10 ms
CPU, 95th pct
1.60 ms
Draw calls
0
Weight
Moderate

Measured 28 November 2026 on RTX 4060 Laptop, 13th Gen Intel(R) Core(TM) i9-13900H, Chrome 158, 1920×1080 at 1×. 600 frames × 3 rounds, median kept (rounds ranged CPU 1.07–1.19 ms). What ran: The director alone, playing the 60-second show from its start: one frame of the compiled cue list (sweep, ride, fly-over, track, crane) with the collision clamp against 13 solids and the ground, the rebased previous view-projection, and the plan drawn in Canvas 2D (contours cached). Phones: tiers are being measured next.

How steadily it runs on RTX 4060 Laptop · 13th Gen Intel(R) Core(TM) i9-13900H · reference

Typical frame ?
16.70 ms
1% low ?
55 fps
Varies by ?
±0.48 ms
All metricsRTX 4060 Laptop · 13th Gen Intel(R) Core(TM) i9-13900H · reference
p50p95p9916.02 ms18.37 ms +
How long each frame took. Most frames sit in the tall bars; a long tail to the right is hitching.

Frames run on a 60 Hz timer (a page demo), so most frames take about one tick, 16.7 ms: the spread around it is what matters.

Frames

Median (p50) ?
16.70 ms
p95 ?
17.73 ms
p99 ?
18.12 ms
Slowest ?
18.54 ms
Mean ?
16.77 ms
Standard deviation ?
0.48 ms
1% low ?
55 fps
0.1% low ?
54 fps
Hitches ?
0 of 600
Over budget ?
0 of 600

Main thread

Long tasks ?
0
Long frames ?
0
Event-loop delay ?
0.1 / 1.8 / 2.0 ms

Input

No input during this run.

Memory

JavaScript heap ?
34.3 → 31.3 MB
Growth ?
-3.03 MB

Browser

JavaScript a frame ?
1.04 ms
All tasks a frame ?
2.79 ms
Layout / style ?
0.71 / 0.19 ms
Main thread busy ?
17%

Garbage collection

Collections ?
24 (12 minor, 12 major)
Pauses ?
69.1 ms in all, longest 1.7

What it needs

Renders with
WebGPUNeeds WebGPU: current Chrome and Edge, Safari 26+, Firefox 141+ on Windows.
Your browser
Checking…Looking for WebGPU
Depends on
NothingNo other packages
With an agent
install("shot-director")Your coding agent reads its pitfalls and installs it through the library’s MCP server. Set it up

What it’s for

  1. A live show or an exhibition wall travelling one 3D world from station to station, with text beside each subject from a 16:9 screen to a 32:9 LED wall
  2. A product or story page whose 3D hero frames each subject in the space beside its copy, without the camera turning away from it
  3. An attract loop or a cutscene authored as data (shot and rail recipes) and scrubbed on a timeline, the same frame whether played or sought
  4. An operator console: hold a moment, carry on, or cut in with a live move that leaves from where the camera is at the speed it had
  5. A tracking shot of a vehicle or a character from its recorded path, stops included, that stays right when scrubbed backwards
  6. Checking an authored camera path against the set before the show, and keeping the eye out of the ground and the props while it runs
  7. Temporal anti-aliasing, motion blur or any history effect under a directed camera: last frame’s view-projection rebased onto this eye, and a cut flag

Pitfalls, in brief

  1. The demo needs WebGPU to draw its island (one ray-marched pass and a temporal resolve).
  2. Build every matrix from the director’s view (shotView, or ShotFrame’s viewProjection and inverse): picking rays, sky rays, a depth pre-pass and shadow-cascade fitting included.
  3. Call frame(t) or seek(t) once per drawn frame, before you encode it.
  4. Drop every temporal history on cut (TAA, motion blur, ambient occlusion, clouds): it is true on cuts, on seeks, on a jump back in time and on the first frame.
  5. The previous view-projection takes positions relative to this frame’s eye (it is rebased already).
11 more in brief
  1. Keep a track’s position(seconds) deterministic and seekable: sample the recording on its own clock (the cue’s start plus the seconds given), never a live vehicle’s current position, or scrubbing back puts the camera where the vehicle is now.
  2. Start a track (or any move) from a pose it can join: a new move matches the displayed position and velocity over joinSeconds (0.4 s), so a track cued from a distant shot whips across in that time.
  3. A track stops dead at its duration: its position is sampled at min(1, elapsed ÷ duration), so with no cue after it the camera halts at once while the vehicle drives on (5 m/s to 0 in one frame in the lift’s test).
  4. With look-ahead, a ride’s look point sits on the rail ahead, so the eye-to-target distance shrinks to about the look-ahead: a follow focus built on it racks forward during the ride.
  5. Put a rail’s first point at the departing eye and its last at the arriving shot’s fitted eye.
  6. A text column is measured in output heights, so a narrow screen has no room for it: the engine throws (“Text column and inset leave no camera safe area”), and its stage adapter would throw on every frame of a portrait phone.
  7. Operator actions must come in show-time order.
  8. Treat the poses it returns as read-only: a settled sweep returns the compiled shot itself, and a track shares the start pose’s arrays.
  9. Check at a step fine enough for tight bends and ridges: proxies are tested along every sampled chord, but the ground only at chord ends (with the first crossing refined). check() traces the full-motion path even under reduced motion; at run time the eye is lifted straight up out of the ground and any solid it is inside (a stateless clamp, so scrubbing and playing agree).
  10. Reduced motion turns every travelling move into a cut to its destination and keeps holds still; recompile with setReducedMotion() when it flips, then seek so the frame is a cut.
  11. Include protrusions in a shot’s bounds (sails, masts, chimneys): the fit protects only the box it is given, through the rolled and shifted lens.
16 pitfalls in full, the hook-up guide, the module source and its tests come with the part.

Where it comes from

From HaTac. Adapted from published work, named below.

Hannes Andersson: The HaTac engine’s camera director, its recipe kinds, decisions, tests and measurements; the library’s standalone director and demo.

Edwin Catmull & Raphael Rom, A class of local interpolating splines (1974): The spline the rails run through their control points (camera/path.ts).

Cem Yuksel, Scott Schaefer & John Keyser, Parameterization and applications of Catmull–Rom curves (2011): The centripetal parameterisation (alpha 0.5) and Barry and Goldman’s pyramidal evaluation, in camera/path.ts.

Timothy L. Kay & James T. Kajiya, Ray tracing complex scenes (SIGGRAPH 1986): The slab test camera/collision.ts traces each chord of the path against a box with.

cameracinematicshotsshot listshow controlshow clockbeat clockcueholdoperatorlive cuescrubseektimelinedeterministicrandom accesssweepcritically dampedspringriderailcamera pathcatmull-romcentripetal

Near it in the frame