GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - webarkit/webarkit-studio: WebARKit Studio — node-based WebAR authoring tool (Rete.js + JsartoolkitNFT)

BranchesTags
Open more actions menu

Latest commit

 

History

102 Commits
102 Commits

Folders and files

NameName
Last commit message
Last commit date
.claude
.claude
 
 
.gemini
.gemini
 
 
.github
.github
 
 
docs
docs
 
 
packages/studio-plugin-api
packages/studio-plugin-api
 
 
plugins/jsartoolkit-nft
plugins/jsartoolkit-nft
 
 
public
public
 
 
scripts
scripts
 
 
src
src
 
 
tests
tests
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.mcp.json
.mcp.json
 
 
AGENTS.md
AGENTS.md
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CLAUDE.md
CLAUDE.md
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
index.html
index.html
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
player.html
player.html
 
 
playwright.config.ts
playwright.config.ts
 
 
tsconfig.json
tsconfig.json
 
 
vite.config.ts
vite.config.ts
 
 
vite.player.config.ts
vite.player.config.ts
 
 
vitest.config.ts
vitest.config.ts
 
 
webarkit-studio.config.ts
webarkit-studio.config.ts
 
 
webarkit-studio.node.config.ts
webarkit-studio.node.config.ts
 
 

Repository files navigation

WebARKit Studio

CI TypeScript License: LGPL v3

WebARKit Studio: the Two markers demo graph in the node editor, with the live preview tracking two markers (pinball and kuva)

A node-based authoring tool for WebAR experiences. Users wire nodes (camera → tracker → anchor → view) in a Rete.js editor; the result is a plain JSON graph that a lightweight player executes with JsartoolkitNFT and a 3D engine of choice (Three.js or Babylon.js). The graph can be exported as a standalone app.

Status: prototype. The architecture is being validated: the graph format may still change between versions (graphs since v0.1.0 upgrade when opened, see Known issues). Nothing is published to npm.

Quick start

npm install
npm run assets      # camera_para.dat, pinball + kuva NFT datasets, test photo
npm run dev         # studio at http://localhost:5173/, player at /player.html

Pick a demo from the Demos ▾ menu ("Pinball · Three.js", "Pinball · Babylon.js", or "Two markers" with pinball + kuva), click ▶ Run and point the camera at the printed markers. No camera? The "Image, no camera" demo tracks a photo of the marker (source.image; source.videoFile plays a recorded video the same way; if you fetched the assets before this demo existed, run npm run assets again for the photo). "Math and colour" animates a cube with math.time, math.sin and math.vector3 wired into the Mesh's Position, and fades it with color.rgba on its Color; "Expression" moves it the same way with a single math.expression (40 + 30 * sin(t * 180)); "Animated model" plays a model's clip on onFound and pauses it on onLost; "Math on a model" bobs and turns a glTF model with math nodes wired into its Position and Rotation; "Script" is the math demo in one Script node (see "Scripts"). ⟳ Reload restarts the preview (Stop + Run), applying every param change; params marked ⚡ apply live without it.

Editing:

  • Add a node: right-click the canvas and type to search (name, category or library), or filter the palette. Its groups open and close, and keep their state across reloads (math starts closed); the bar under the search field jumps to a group.
  • Undo / redo: ↶ / ↷, or Ctrl+Z / Ctrl+Shift+Z (Ctrl+Y). Param edits are undone too.
  • Select: click a node; Ctrl+click or Shift+click adds it, or removes it if it is selected; Shift+drag on the canvas draws a box that selects the nodes it touches (with Ctrl, adds them); Ctrl+A selects every node; Escape clears. A plain drag on the canvas pans; Ctrl+drag (or Shift+drag) on a selected node moves the whole selection.
  • Copy / cut / paste / duplicate: Ctrl+C, Ctrl+X / Ctrl+V (at the pointer, also between studio tabs) and Ctrl+D, or Duplicate in a node's right-click menu. Wires between the copied nodes are kept.
  • Delete: Delete or Backspace removes the selected nodes and their wires, and so does Delete in a selected node's menu. Each of these is one undo step. Keys typed in a field, a select or the log are never taken as shortcuts.
  • Macros (#140): fold nodes into one reusable node.
    • Create macro in a node's menu folds the selection into a macro node. The wires that crossed the selection's border become its ports, named after the inner node and port (select_pinball_pose, shown as "Select Marker Pose"). A selection that holds a macro node is refused (no macro inside a macro). On an input that takes several wires, such as the tracker's datasets, the order of its wires is kept; a selection that cannot keep it (a selected node's input wired from outside before it is wired from inside) is refused.
    • Dissolve macro puts its nodes back where it is, rewired, with the values set on the macro node. Dissolving a macro just made gives the same graph back.
    • Enter macro shows its inside, editable; the bar above the editor names it, and ← Graph goes back. An edit inside changes the definition, so every instance of it, and a running preview applies a live param in each. Inside, Promote next to a param in Properties sets it on the macro node, per instance; Unpromote takes it back. A script's code is never promoted.
    • Rename macro in its menu, or the name field in the bar inside it, renames the definition: every instance's title follows. A blank name is refused. A new macro is called "Macro", or "Macro 2", "Macro 3"… when that name is taken.
    • Create, Dissolve and Rename are one undo step each. Inside a macro, undo and redo reach only the edits made inside; back in the graph, all of them are one step, which one undo reverts.
    • The macro library (#141), the palette's Macros section, first in the palette:
      • Presets: Box, Sphere, Cylinder, Plane, Torus, Torus knot and Capsule, each a geometry node already wired into a Mesh, added expanded (its two nodes, not a macro node) as one undo step. Wire its scene, and the Mesh into an anchor. They ship with the studio and cannot be removed.
      • Export macro… in a macro node's menu saves its definition as a .wmacro file, with a description. It lists the project assets the macro uses, by node and param: the file keeps them as references, not the files.
      • Import macro… adds a .wmacro to the project's library. A file is checked as a graph is: an unknown node type or a missing plugin refuses it by name. It names the project assets it uses that this project does not have; those fail at Run, on the macro node, until you pick a file. A script inside asks before it runs, as any script from someone else does.
      • A library macro is added from the palette like any node, and its definition is copied into the graph: a graph never depends on the library to open. When the graph already uses that macro's id for another content, the studio asks: Keep both (the new one under another id), or Replace it (every instance follows, one undo step). A file's id is its macro's name, so two versions of one macro clash and two different macros do not. × removes a macro from the library; the graphs that use it keep their copy.
      • The library is saved in the browser beside the autosave, and in project files (library.json). A project without one opens with an empty library. Every library a project replaced is kept in localStorage, together (webarkit-studio:macro-library-replaced): one entry per macro, and another content under an id already there under a free id. A library.json this studio cannot read leaves the library as it was, and the rest of the project opens.
  • Arrange lays the graph out left to right; the minimap (bottom right) moves the view.
  • Properties (under the preview): every param of the selected node, including vectors and 4×4 matrices.

Multi NFT

ARControllerNFT tracks every NFT Dataset connected to its Datasets input (loadNFTMarkers). Its markers output is the tracking result of all of them; a Select Marker node picks one, by the dataset's name or by index, and gives its pose, found, onFound, onLost and markerInfo to an Anchor. Pose filters and found / lost state are kept per marker. Select Marker reads a tracker-agnostic trackingResult, so a future webarkit.nftTracker will plug into the same nodes.

Tests and benchmarks

npm test             # unit + integration (Vitest)
npm run test:e2e     # end-to-end (Playwright, Chromium); once: npx playwright install chromium
npm run bench        # benchmarks (tinybench); npm run bench -- runtime | math | tracker
npm run test:all     # typecheck + unit + integration + e2e
Level What Where
Unit graph validation and topological order, socket types, catalog consistency, runtime scheduler (order, live params, init failures, stop during init) with fake nodes, the mapping onto the tracker facade (filter, settings), the letterbox geometry, Select Marker, Inspector formatting, the trace format, trace diff and Trace Recorder buffering, export file selection and asset paths tests/unit
Integration the tracker session (NftSession on createNFTTracker, the code the controller runs over the facade's worker) against the Node build of JsartoolkitNFT on a photo holding both markers: marker sizes, two independent poses, found / lost once per marker, lostTimeout and AR2 settings, per-marker filtering, lens and projection, odd video sizes, per-dataset load errors; a golden run recorded with the former ARControllerNFT code (found and transitions exact; poses within the recorded range plus a margin, near the recorded mean, and near the recorded frame); traces: two recordings identical, a filter change reported, replay, live settings changes, the golden run's found / lost timing kept by the facade tests/integration
End-to-end the studio in Chromium with a fake camera: three demos tracking, onFound after loss, tracking a still image and a video file with no camera, multi NFT, live settings, Reload, init error on the failing node, incompatible wires rejected, a trace downloaded by the Trace Recorder; exported apps unzipped and run from a plain static server tests/e2e

The fake camera is a Y4M video generated in pure JS from the test photo (tests/e2e/fake-camera.ts): the markers are visible 4 s, then hidden 2 s, in a loop. It must be downscaled with a bicubic filter: a box filter softens the fine detail enough for KPM to miss the kuva marker.

Benchmarks (Node 22, CI-class container; compare runs, not absolutes):

runtime.tick(), no-op nodes before after (inputs resolved once)
20 nodes / 19 edges 8.7 µs 1.3 µs
80 nodes / 79 edges 79.7 µs 4.6 µs
320 nodes / 319 edges 789 µs 18.8 µs
NftSession.process() (tracker facade), 320×240, Node build mean
1 marker, tracked (AR2) 1.2 ms
2 markers, tracked (AR2) 2.3 ms
2 datasets, nothing visible (KPM every frame) 3.4 ms

The tracker table was measured on a Windows desktop, not on the container.

Tracking traces

A trace records what the tracker did, frame by frame, as JSON Lines: a header (format version, jsartoolkit-nft version, frame size, settings, filter, targets, where the frames came from), then one record per frame in the shape of the facade's FrameResult (per-target found, pose, error; found / lost transitions; time and process() duration), plus a record for each live settings change. The format is defined in src/runtime/trackers/trace.ts.

npm run trace:record -- --out a.jsonl                     # Node: the golden run's frames, deterministic
npm run trace:record -- --out b.jsonl --filter oneEuro    # same frames, another filter (none | native | oneEuro)
npm run trace:record -- --out c.jsonl --replay a.jsonl    # replay a trace's frames and settings with this build
npm run trace:record -- --out g.jsonl --golden            # the golden run (ArtkSession, jsartoolkit-nft 1.14.0)
npm run trace:diff -- a.jsonl b.jsonl                     # pose deltas, found / lost timing, jitter; exit 1 above thresholds

In Node the frames are the golden run's (the test photo, then blank frames, then the photo again, 33 ms apart, Date.now pinned), so two recordings of the same build are identical and trace:diff reports no difference. In the browser, wire a Trace Recorder (debug.trace) to the controller's trace output and turn Recording on: the trace downloads when it is turned off, when Max frames is reached or when the preview stops. Camera traces cannot be replayed, and two of them only compare frame by frame if they have the same frames; their jitter and timing are still useful.

trace:diff thresholds (--translation-mm 1 --rotation-deg 0.5 --transition-ms 0 --found-frames 0 --jitter-mm 0.5 --jitter-deg 0.25 by default) and --json are documented in scripts/trace-diff.mjs.

On devices, connect a Stats node to the controller's stats output and enable Overlay on view: the exported app then shows render fps, tracking fps, process() time and latency on the AR view.

CI (.github/workflows/ci.yml): typecheck, unit + integration, build, e2e on every push / PR; benchmarks on pushes to main, in the job summary.

Export

Export ▾ in the toolbar:

Format Content
Graph (.json) the node graph only; re-import it in the studio
Project (.zip) the graph and its uploaded assets; open it with Import…
Standalone app (.zip) player + graph + assets, runs on any static web server
GitHub Pages project (.zip) the standalone app in site/, a GitHub Actions workflow that deploys it, and a README with the steps
Source code (.zip) a small Vite project with the graph as readable code (Three.js): npm install, npm run dev; see "Source code" below (#64)

Each file is named after the graph: type its name in the Graph name field next to the studio's title (one undo step, kept by the autosave; a demo, a file or a project brings its own, and New is Untitled). My Graph exports as my-graph.json, my-graph.webarkit.zip, my-graph.zip, my-graph-pages.zip and my-graph-source.zip; with no name, webar-app. The folder inside a zip, the exported page's title and the Pages project's README use the graph's name too.

In Chromium browsers (Chrome, Edge) an export first asks where to save it, with that name suggested: the file can be renamed and put in any folder, and a cancel saves nothing. The chosen name names the file only: the folder inside the zip and the page title keep the graph's name. Elsewhere (Firefox, Safari) the file downloads under its default name, as the browser saves downloads. A graph the source code export cannot write is refused before the dialog opens, so no file is created. If an export fails after you picked a file, the file is left empty there: Chromium creates it, or empties an existing one, when it is picked, and the log says so (#118).

The standalone app is the prebuilt player (npm run build:player, run automatically by dev and build) plus graph.json and the files its nodes reference: params marked asset in the catalog (camera parameters, NFT datasets). Only the chunks the graph uses are included: a Three.js graph leaves out Babylon.js, a SIMD controller leaves out the standard build (manifest written by vite.player.config.ts). Asset URLs inside the studio keep their path; others are copied under data/_ext/ and the graph is rewritten. Uploaded assets are copied under data/assets/<id>/. File names there are ASCII (café#1.glb is cafe_1.glb), two remote files of the same name get name-2.glb and so on, and a query string or fragment is left out of the name (#88). glTF models must be .glb or self-contained .gltf files: the export refuses a .gltf that loads separate buffers or images.

pinball-nft-three-js/
  index.html  graph.json  README.txt
  assets/     player, three-adapter, jsartoolkit-nft plugin
  jsartoolkit-nft/1.16.0/  the tracker worker of the graph's build (SIMD here)
  data/       camera_para.dat, DataNFT/pinball.{iset,fset,fset3}

Serve it with npx serve . or python3 -m http.server. The host must answer 404 for missing files (see Known issues).

A controller on the Threaded build (or Auto, which picks it on an isolated page) needs a cross-origin isolated page (COOP / COEP). Its export adds coi-sw.js, a service worker that sets those headers where the host cannot (GitHub Pages; the page reloads once on the first visit, over HTTPS only), and _headers for Netlify and Cloudflare Pages. The studio's own page is not isolated: there, Threaded stops at once with a message, and Auto runs SIMD. The threaded build is experimental upstream.

Camera access requires a secure context: localhost works; on a phone use HTTPS or adb reverse tcp:5173 tcp:5173.

Below 900 px the studio shows one panel at a time, behind the Nodes, Graph, Properties and Preview tabs.

GitHub Pages

The GitHub Pages project publishes the app with no credential: the export carries a workflow, and you push it to a repository of your own. The studio makes no request to GitHub.

pinball-nft-three-js-pages/
  site/                                the standalone app
  .github/workflows/deploy-pages.yml   deploys site/ on each push
  README.md                            the steps
  .gitattributes                       commits every file byte for byte

Create a public repository, set Settings → Pages → Source to GitHub Actions, and push. The URL Pages gives is HTTPS, which a camera on a phone needs. The deploy leaves out names that start with a dot, so the export refuses a file named that way, by name. To publish the plain standalone app from a branch instead, it has a .nojekyll, without which Jekyll would drop data/_ext/.

Talking to the page

A graph and the page that holds it (the studio's preview, or the page of an exported app) talk through named events, in both directions:

  • Dispatch Event (action.dispatchEvent) tells the page each time its Trigger fires;
  • Page Event (page.event) fires its onEvent for each event of its name from the page, on the next frame, and keeps in number the last detail that was a number (or a number value in it), so a page can drive a value.

Rules, for both: a name needs a colon (shop:coupon, studio:next), so a graph can neither hear nor fake the browser's own events such as click. Only plain values cross: strings, finite numbers, booleans, null, and arrays and plain objects of those, four levels deep. Anything else, a DOM node or a function included, is dropped. Events follow the graph's frames: several in one frame fire Page Event's onEvent once, with the last detail, and a trigger that fires several times in one frame sends once.

In the same page (channel DOM). The graph's event is a CustomEvent that bubbles from the stage to window; its detail is { data, time }, the trigger's data and when it fired (Date.now(), in milliseconds). Found, with Select Marker's onFound on the Trigger:

window.addEventListener('shop:found', (e) => showCoupon(e.detail.data.name));

The page drives the graph with a CustomEvent on window; its detail is the event's data in the graph:

window.dispatchEvent(new CustomEvent('shop:next', { detail: { value: 2 } }));

A graph's own Dispatch Event reaches its Page Events of the same name too, with { data, time } as their detail: wiring one into the other repeats it every frame, so give each direction its own name.

From an iframe (channel postMessage), for an export embedded in another site. Each node names the other page's origin exactly; * is refused, so a graph neither sends to nor hears from any page that frames it. The graph sends { type, detail } to its parent, and hears messages of that shape:

// In the page that frames the app, served from https://shop.example.com.
const app = document.querySelector('iframe').contentWindow;
window.addEventListener('message', (e) => {
  if (e.origin === 'https://ar.example.com' && e.data?.type === 'shop:found') showCoupon(e.data.detail.data.name);
});
app.postMessage({ type: 'shop:next', detail: { value: 2 } }, 'https://ar.example.com');

Here the graph's Dispatch Event has the target origin https://shop.example.com, and its Page Event the origin https://shop.example.com.

UI controls

Five nodes give a graph a few controls: Button (ui.button, fires onClick), Switch (ui.toggle, a boolean), Slider (ui.slider, a number within min and max), Colour Picker (ui.colorPicker, a colour [r, g, b, a]) and Choice (ui.select, the index of an option). Each change sets value and fires onChange on the next frame; the value a control has when the graph starts is the first value, and fires nothing.

  • Drawn: with Element id empty, the node draws its control with its Label in a panel on the AR view, in the studio's preview and in an exported app. A tap on the panel does not reach the scene. Position (live) picks the panel: top-right (the default), top-left, bottom-left, bottom-right or bottom-center (controls in a row). Controls with the same position share a panel. Each position has its own part of the view, so panels never cover one another, nor the renderer badge, the FPS label, Debug Stats' overlay or Open URL's link. A panel takes at most its part of the view and scrolls beyond: a slider may wrap under its label on a phone held upright.
  • Bound: with Element id set, the node uses that element of the page that holds the app, a site's own control, and leaves it as it found it. It must be of the node's kind: a <button> or <input type="button">, an <input type="checkbox">, an <input type="range"> or type="number", an <input type="color">, a <select>. Anything else is refused by name when the graph starts, so a graph never reads what is typed in the page. An id that names nothing draws the control instead, and the node says so.

Scripts

Script (script.lite) runs JavaScript whose header comment declares the node's interface, after Sverchok's Script Node Lite. The "Script" demo is the math demo written that way:

/*
in  t       number  d=0
in  height  number  d=30 min=0 max=200
out position vector3
*/
position = [0, 0, 40 + height * Math.sin(t * Math.PI)];
  • The header, a block comment at the very start, one declaration per line:

    • in <name> <socket> [d=<default>] [min=…] [max=…] [step=…]: an input, a variable of the code;
    • out <name> <socket>: an output, set by assigning to that variable;
    • enum <name> <a> <b> …: a dropdown param, a string in the code;
    • run on-change: run only when an input or a param changed (the default, run every-frame, runs every frame).

    Sockets are values only: number, boolean, vector2, vector3, quaternion, color, matrix4, event. A script never touches a renderer, so it runs the same on both. A mistake in the header shows on the node with its line, and the node then has no ports.

  • Params: an in of a number, boolean, vector3 or color also gets a param with its default; while the input is wired it wins and the param is disabled. An enum is a param only.

  • The code gets its inputs, time and delta (seconds) and state (an object kept between runs). An output it does not assign keeps its last value; an event output fires when it is given a value (true, or the event's data), and an event input is true on the frame it fires. Outputs are checked against their socket (a colour is clamped to 0–1) and sent only when they change.

  • Errors never stop the graph: an exception shows on the node with its line, and the outputs keep their last values. A return (of anything) ends a run early: no outputs that run. A live edit that does not compile stays shown on the node while the last good script runs on, until a script compiles. An infinite loop, though, freezes the page: nothing can stop code that runs in it.

  • Editing: the node shows the script's file name, its ports and params, not its code. Edit opens a large code panel (Ctrl+Enter applies), Import reads a .js file or one of the examples. Applying a script whose ports changed rebuilds the node and drops the wires that no longer fit, as one undo step. An imported file is copied into the graph: edit it in VS Code or similar, then import it again. A live edit applies while the preview runs; one that changes the ports, or a default (d=), applies on ⟳ Reload. A script whose header has a mistake is not applied: the panel and the log say which line. Applying drops the values of params whose header line is gone or changed kind, in the same undo step.

Trust. A script runs in the page, with everything the page can do: your other graphs, your uploaded assets, the camera once allowed. So the studio asks before running scripts it did not get from you: opening a graph or a project with scripts, or restoring an autosave whose scripts were never allowed, shows which nodes have them, and Run, ⟳ Reload, Open in player and Export ask again until you allow them. The answer is remembered per script text (in this browser). Scripts you write, import or pick from the examples here, and the demos', are allowed. The player runs the scripts of an exported app's own graph and of the studio's Open in player, but refuses a graph with scripts named by a link (player.html?graph=…). An exported app compiles its scripts with new Function: a Content Security Policy on its host needs 'unsafe-eval'. The MCP server never runs a script (tracking_run refuses a graph with one). All of this applies to every node that runs code (Script, three.js Script and three.js Render Script), as its catalog definition marks it (runsCode), never by its name.

three.js Script

three.js Script (three.script) builds part of the scene with three.js. Wire its Object into a Marker Anchor's Children, like a Mesh: the studio keeps the camera, the marker pose, found / lost visibility and the export, and the script only creates and animates content. The "three.js script" demo is a knot and a ring of spheres made that way.

/*
in  height  number  d=30 min=0 max=200
*/
let cube;
function onInit({ THREE, group }) {
  cube = new THREE.Mesh(new THREE.BoxGeometry(40, 40, 40), new THREE.MeshStandardMaterial({ color: 0xff0055 }));
  group.add(cube);
}
function onFrame({ group, time, inputs }) {
  group.position.z = 40 + inputs.height * Math.sin(time * Math.PI);
  cube.rotation.z = time;
}
  • onInit({ THREE, group, inputs }) creates meshes, materials and lights in group, a THREE.Group in marker space (mm, +Z up); onFrame({ THREE, group, time, delta, inputs }) animates (seconds); onDispose() releases what onInit made. Each is optional. The geometries, materials and textures under group are disposed anyway.
  • The header declares value inputs and dropdowns as Script's does (in, enum, read in inputs); it has no out lines: what the script makes goes in its group.
  • A live code change runs onDispose, frees the old group and runs onInit on a fresh one; header params apply live. Errors show on the node with their line, and in the code panel and the log, and never stop the graph.
  • It needs the Three.js renderer: with Babylon.js it fails at start and says so.

three.js Render Script

three.js Render Script (three.renderScript) renders on its own, in place of Scene, Renderer, AR Camera, Marker Anchor and AR View: wire the camera's Video, the controller's Projection, and a Select Marker's Pose, Found and Marker info. The node makes a WebGLRenderer on its own canvas, laid over the video as AR View's is, a scene and a camera at the origin looking down −Z; each frame it puts the tracker's projection on the camera, runs onFrame and renders. "Render script" is its demo.

  • onInit({ THREE, canvas, renderer, scene, camera, helpers, inputs }) builds the scene; onFrame({ THREE, renderer, scene, camera, pose, found, projection, markerInfo, time, delta, helpers, inputs }) places and animates; onDispose() releases. The scene's geometries, materials and textures are disposed anyway.
  • helpers.placeOnMarker(object, pose, found, markerInfo) places an object as a Marker Anchor does (centred on the marker, hidden when lost); helpers.markerMatrix, helpers.markerOffset and helpers.applyArProjection are the same placement in parts. They are the studio's own, so a render script lines up with the standard pipeline.
  • The header declares value inputs and dropdowns; no out lines. A live code change rebuilds the scene. Errors show on the node and never stop the graph.
  • Import offers its own examples (a bobbing cube, a rainbow knot); the menu lists only examples the node accepts.
  • An AR View and a render script on one video share it: the later one stacks its canvas over the frame that holds the video.
  • It needs no renderer node: an exported app with only this node ships three.js without the studio's Three.js adapter.

Source code

Export ▾ → Source code (.zip) writes the graph as a small Vite project that depends on three.js, @webarkit/jsartoolkit-nft and @webarkit/camera-view (the exact versions the studio uses), and on nothing of the studio:

  • src/main.js, one file to read top to bottom: the setup, then the frame loop. Each part is one node of the graph, in the order the graph runs them, under a // <node id> (<node type>) comment; variable names come from the node ids;
  • index.html, vite.config.js, package.json and a README.md (npm install, npm run dev);
  • public/data/, the assets, collected as the standalone app does, and scripts/copy-jsartoolkit-nft.mjs, which copies the tracker's worker file from node_modules before dev and build.

The first version writes the nodes of "Pinball · Three.js" (camera, the jsartoolkitNFT camera parameters, dataset, settings and controller, the One Euro filter, Select Marker, Three.js renderer, scene, AR camera, light, mesh and geometry, anchor, AR view, Inspector and Tracking stats) and glTF models. A graph with any other node (math, logic, actions, scripts, page.*, ui.*, Babylon.js…) is refused, with the list of those nodes: export a Standalone app for it. The controller's Threaded and Auto builds are refused too, as they need a cross-origin isolated page. Plugins write their own nodes' code: see codeEmitters in docs/plugins.md.

MCP server

An MCP server lets an agent (Claude Code, Copilot in VS Code, Cursor, Gemini CLI…) author, check, run and export graphs without the UI. .mcp.json declares it; to start it by hand:

npm run mcp:studio   # stdio, from the repository root
Tool What it does
catalog_list node types with ports, params, defaults and live flags (core + plugins)
graph_validate the studio's validation, as a list of problems
graph_create / graph_edit build or change a graph with ops: add / remove nodes, connect, set params
tracking_run the graph's tracker on JPEG images in Node: per-frame poses and found / lost, as trace records
trackability_check rates an NFT dataset from its .fset3 and .fset: the report of npm run trackability -- <dataset> --json
export_bundle the standalone app .zip, from the studio build (npm run build, in dist/)

Try it

  1. Once: npm install, npm run assets (camera parameters, datasets and the test photo tests/fixtures/pinball-demo.jpg), and npm run build if you want export_bundle (it exports from dist/).

  2. Open your MCP client in the repository root. Claude Code picks up .mcp.json and asks to approve webarkit-studio; /mcp then shows it connected with its seven tools. Other clients: add a stdio server running node --import tsx src/mcp/main.ts from the repository root.

  3. Ask, for example:

    Using catalog_list, build a tracking graph for the pinball dataset, validate it, run it with tracking_run on tests/fixtures/pinball-demo.jpg for 10 frames then 12 blank frames, and tell me in which frames the marker is found and lost.

    The marker is found on the photo frames and lost about six blank frames later: the tracker's lostTimeout (200 ms) at 33 ms per frame. Then, for instance, "export public/graphs/pinball-three.json with export_bundle to out/app.zip", and serve the unzipped folder with npx serve.

Graphs are passed inline or as a path; the tools write nothing except export_bundle's zip. The tests (tests/unit/mcp-*.test.ts, tests/integration/mcp-*.test.ts, and tests/e2e/mcp-export.spec.ts on the real build) cover every tool, the stdio transport and this scenario. See src/mcp/AGENTS.md.

Assets

Upload… in the assets panel (under the palette) adds files to the project: images and videos, NFT datasets (select the .iset, .fset and .fset3 files together) and glTF models (.glb, or a self-contained .gltf). They are saved in the browser (IndexedDB) next to the autosaved graph, and Export → Project (.zip) carries them to another browser.

A param marked asset takes a URL or an upload of its kind: its field suggests the matching uploads, as asset://<id>/<name> references. The graph format is unchanged, but a graph with such references needs the project's assets (and a studio or player from this version on) to run. While the graph runs, uploads are served as blob: URLs; an uploaded NFT dataset is served to the tracker's worker under a virtual https://assets.webarkit.invalid/ prefix (with its files' blob: URLs in the query string), and the prefix appears in its tracking traces.

glTF Model (scene.gltf) stands models up on the marker with their front (glTF +Z) facing the marker's bottom edge (marker −Y); turn them with the Z of Rotation. Autoplay plays the model's first clip in a loop, on both renderers, and its status lists the clips. Compressed models (Draco, KTX2, meshopt) are not supported on Three.js; Babylon.js decodes them with decoders it downloads from its CDN, so prefer uncompressed models.

Before you upload a dataset made from a new image, check that it will track:

npm run trackability -- path/to/marker        # its .fset3 and .fset: detection points, coverage,
                                              # repetition, tracking points; exit 1 when poor
npm run example:marker                        # a generated marker image in generated/
npm run example:project -- generated/scribbles   # its dataset + a glTF model + a graph, for Import…

Creative tools sets up Blender, ComfyUI and Krita as MCP servers for markers and models, and walks through the example.

Architecture

            ┌──────────────── GraphDocument (JSON) ────────────────┐
            │  nodes: [{id, type, params, position}]               │
            │  edges: [{from:{node,port}, to:{node,port}}]          │
            └───────────────▲───────────────────────┬──────────────┘
          load / toDocument │                       │ loadGraphDocument + topologicalOrder
┌───────────────────────────┴─────┐   ┌─────────────▼──────────────────────────┐
│ Editor (Rete.js + lit-html)     │   │ Runtime / player (no Rete)             │
│ - StudioNode = view of catalog  │   │ - NODE_REGISTRY: type → factory        │
│ - typed sockets, validation     │   │ - init() once, update() every frame    │
└───────────────┬─────────────────┘   └─────────────┬──────────────────────────┘
                └──────── Node catalog (ports + params, no heavy deps) ┘

Key decisions:

  1. The JSON graph is the source of truth. The editor is a view over it, the player only reads it. The player bundle contains no Rete code.
  2. Catalog and implementation are split. src/nodes/catalog.ts describes ports and parameters (pure data, shared by editor and runtime). src/runtime/registry.ts maps each type to its implementation.
  3. The runtime has its own tiny scheduler (topological order, init then per-frame update) instead of rete-engine: AR needs a frame loop with async setup and stateful nodes, which the Rete dataflow engine does not model, and it would tie the player to Rete.
  4. Tracking runs in a Web Worker, one per controller node, as JsartoolkitNFT recommends: the facade's own (createNFTTrackerWorker). Frame preparation follows the upstream threejs_worker_ES6.js example; the facade's projectionFor() rescales the projection.
  5. Rendering with lit-html. Rete maintains renderers only for React, Vue, Angular and Svelte; src/editor/lit-render-plugin.ts (~200 lines) implements the same render contract with lit-html.
  6. Renderer → Scene → objects. A renderer node (three.renderer, babylon.renderer) is only the engine and its canvas. A Scene node, connected to it, is where Mesh, Geometry, Light and Marker Anchor create their objects (Babylon.js requires a scene at creation time). AR View draws a scene through an AR Camera fed by the tracker projection. Switching engine = rewiring one node. Each engine is loaded with a dynamic import. Creation context (scene input) and hierarchy (Anchor.children, AR View.objects) are separate wires, which keeps the graph acyclic.
  7. Slots on the controller. Optional filter and settings inputs. Their nodes output serialisable values that the controller forwards to its tracker; an empty slot means library defaults / raw poses.
  8. Live params. Params marked ⚡ (live in the catalog) reach the running graph without restarting; the others apply on the next Run. A live change on the Settings node becomes a new settings value, the controller sees it and calls its tracker's configure().
  9. Events are values. An event output carries {count, time, data} and a new object each time it fires, though a new object is not always a firing (Events says how to detect one). onFound / onLost come from the tracker's per-frame transitions (found on the first tracked frame, lost once after lostTimeout, 200 ms by default); a marker's found output is the raw per-frame tracking.
  10. Trackers are plugins. A plugin (#12) adds nodes, sockets, factories and export files through a typed manifest (StudioPlugin, src/plugin-api), without changes to the studio. jsartoolkitNFT is one (plugins/jsartoolkit-nft/), listed in webarkit-studio.config.ts: the studio loads every plugin, the player only those its graph lists in plugins. See Writing a plugin.

Naming

Node types are <namespace>.<name>, with the wrapped library as namespace: jsartoolkitNFT.controller, three.renderer, babylon.renderer. Built-ins use functional namespaces (scene.*, geometry.*, filter.*, tracking.*, debug.*, output.*, source.*, math.*, color.*, logic.*, action.*, page.*, ui.*). macro is reserved for the macro node, whose ports come from its definition in the graph (#140). webarkit.* is reserved for the webarkit/webarkit packages, so a future webarkit.nftTracker (@webarkit/nft-tracker) cannot be confused with the JsartoolkitNFT controller. Library-specific data has its own socket type, defined by its plugin and prefixed with the plugin id (jsartoolkitNFT.cameraParams, jsartoolkitNFT.dataset), so it cannot be wired into another library's node.

Renderer conventions

Every adapter follows the same conventions: millimetres, marker on the XY plane with +Z out of it, column-major 4x4 matrices, camera at the origin looking down −Z with the AR Camera projection. Babylon.js runs in right-handed mode so ARToolKit poses apply unchanged. Objects remember the scene that created them: wiring an object into a node of another scene (or engine) fails at init with a clear error. A graph that puts a node of one engine in a scene of the other (a babylon.* node in a Three.js scene, a three.* node in a Babylon.js scene, directly or through what it feeds) is refused before it runs, naming the node; a work in progress still opens.

Lights and spaces

The scene root is camera space (the camera is the origin; marker poses are relative to it). A Light left unconnected, or wired to AR View, stays there and lights the scene from the viewer. Wired to a Marker Anchor's children, it follows the marker and lights from above it (+Z of the marker). The adapters hide engine differences: Three.js derives a hemisphere light's direction from its world position, and Babylon.js ignores a hemispheric light's parent, so both are re-oriented from the parent each frame. Intensities and colours use the Three.js scale: the Babylon.js adapter renders on PBRMaterial, as Three.js on MeshStandardMaterial, and maps them so the same graph looks alike on both.

Execution model

  • init(inputs) runs once per node in topological order; inputs are the init-time outputs of upstream nodes (camera opened, WASM loaded, dataset parsed…).
  • update(inputs, frame) runs every requestAnimationFrame, in the same order. Nodes return only the ports that changed.
  • Inputs declared multiple receive an array (e.g. Anchor.children, AR View.objects).
  • onParamChange(key, value) runs when a live param is edited during the preview; it may return changed outputs.
  • Nodes can report text to the studio (ctx.report), shown inside the node: the Inspector uses it, and init errors are shown on the failing node.

Project layout

src/
  core/        graph.ts (format, validation, topo sort), sockets.ts (type system), plugins.ts (manifest checks)
  nodes/       catalog.ts — core node definitions (metadata only)
  plugin-api/  the types a plugin is written against (@webarkit/studio-plugin-api)
  plugins/     host.ts — installs plugins into the catalog, sockets and registry
  editor/      Rete setup, StudioNode, lit-html render plugin (nodes, context menu, minimap);
               node search, undo of param edits, clipboard, layered auto-arrange
  runtime/     GraphRuntime, registry, node implementations
    trackers/  trace.ts (trace format)
    filters/   the pose filter slot's config (applied by the tracker)
    renderers/ RendererAdapter + Three.js / Babylon.js adapters
  app/         studio.ts (editor + live preview), player.ts (standalone)
  export/      exporters (graph JSON, project, standalone app bundle, GitHub Pages project)
plugins/
  jsartoolkit-nft/  the jsartoolkitNFT plugin: catalog, factories, NftSession (the graph mapped onto
                    the tracker facade, shared by the browser and the tests), the tracker's
                    worker files (served by its Vite plugin, vite.ts) and virtual-fetch.ts
packages/
  studio-plugin-api/  the plugin API's types as a package, generated from src/plugin-api (not published)
webarkit-studio.config.ts  the plugins this build loads
public/graphs/ pinball-three.json, pinball-babylon.json, multi-three.json
scripts/       fetch-assets.mjs, trace-record.mjs / trace-diff.mjs (tracking traces), check-agent-docs.mjs
tests/         unit/, integration/, e2e/, bench/, helpers/
vite.player.config.ts   standalone player build (→ public/__player, + manifest)

Planned split once the format stabilises (npm workspaces): @webarkit/studio-graph (core + catalog), @webarkit/studio-runtime, @webarkit/studio-editor, apps/studio.

Nodes

Type Status Inputs → Outputs
source.camera ✅ → video
source.image ✅ → video (a still image: testing without a camera)
source.videoFile ✅ ⚡ → video (a video file, loop: testing without a camera)
page.event ✅ → onEvent, number (a named event from the page: DOM or postMessage; see "Talking to the page")
ui.button ✅ ⚡ → onClick (a button of the page, or drawn on the view; see "UI controls")
ui.toggle ✅ ⚡ → value (boolean), onChange (a checkbox)
ui.slider ✅ ⚡ → value (number, within min and max), onChange (a range or number input)
ui.colorPicker ✅ ⚡ → value (color), onChange (a colour input)
ui.select ✅ ⚡ → value (number: the option's index), onChange (a select; drawn with options)
script.lite ✅ ⚡ the inputs and outputs its script's header declares (JavaScript; asks before running a script from someone else; see "Scripts")
jsartoolkitNFT.cameraParams ✅ → camera params
jsartoolkitNFT.dataset ✅ → NFT dataset
jsartoolkitNFT.settings ✅ ⚡ → settings (continuous detection, detection interval, log level, near / far, lost after, AR2 tracking parameters)
jsartoolkitNFT.controller ✅ video, cameraParams, datasets[], settings?, filter? → markers, onFound, onLost, projection, cameraMatrix, stats, trace (build: SIMD, Standard, Threaded, Auto)
tracking.selectMarker ✅ ⚡ markers → pose, found, onFound, onLost, markerInfo
jsartoolkitNFT.nativeFilter ✅ → poseFilter (the tracker's 'native' filter)
filter.oneEuro ✅ → poseFilter (One Euro, @webarkit/oneeurofilter-ts inside the tracker)
three.renderer ✅ ⚡ → renderer, info (antialias, power preference, preserve drawing buffer, stencil recreate it; ⚡ max pixel ratio, tone mapping, exposure, output colour space)
babylon.renderer ✅ ⚡ → renderer, info (antialias, power preference, preserve drawing buffer, stencil recreate it; ⚡ max pixel ratio, tone mapping on / off, tone mapping type, exposure)
scene.scene ✅ renderer → scene
scene.arCamera ✅ projection → camera
scene.light ✅ ⚡ scene, color? → sceneObject (directional / hemisphere / ambient / point / spot; position, target, distance, spot angle and penumbra; point and spot intensity in candela at 1 m; directional and spot cast shadows, map size and bias)
scene.mesh ✅ ⚡ scene, geometry, position?, rotation?, scale?, color?, material? → sceneObject (rests on the marker; position, rotation, scale per axis, spin; a default PBR material, alpha below 1 is transparent; a connected material replaces it and sets the colour aside; casts and receives shadows; connected inputs override the params)
babylon.nodeMaterial ✅ scene → material (a Babylon.js Node Material from a .json saved by the Node Material Editor; Babylon.js only: refused in a Three.js scene; exposed inputs not mapped yet; a texture named by URL is refused)
scene.material ✅ ⚡ scene, color?, emissive?, map? → material (PBR: colour, metalness, roughness, emissive and its intensity, opacity, side front / back / double, unlit; shared by every mesh it reaches; connected colour and emissive override the params)
scene.texture ✅ ⚡ scene, video? → texture (an image URL or upload, or a connected video, which wins; sRGB, the same way up on both renderers; wrap clamp / repeat / mirror and repeat U, V live, the URL on the next Run)
geometry.box ✅ ⚡ scene → geometry (width X, depth Y, height Z, in mm)
geometry.sphere ✅ ⚡ scene → geometry (radius, detail; poles on Z)
geometry.cylinder ✅ ⚡ scene → geometry (top and bottom radius, height, detail; along Z; a top radius of 0 is a cone)
geometry.plane ✅ ⚡ scene → geometry (width X, depth Y; on the marker, facing +Z)
geometry.torus ✅ ⚡ scene → geometry (radius, tube, detail; the ring in XY)
geometry.torusKnot ✅ ⚡ scene → geometry (radius, tube, p, q, detail)
geometry.capsule ✅ ⚡ scene → geometry (radius, total height, detail; along Z)
three.script ✅ ⚡ scene, the inputs its script's header declares → sceneObject (a three.js script builds a group on the marker; Three.js only; asks before running a script from someone else; see "three.js Script")
three.renderScript ✅ ⚡ video, pose, found, projection, markerInfo, the inputs its script's header declares → — (a three.js script with its own renderer, scene and camera over the video; asks before running a script from someone else; see "three.js Render Script")
scene.gltf ✅ ⚡ scene, position?, rotation? → sceneObject (glTF / GLB model, URL or upload; scale, rotation, position; autoplay of its first clip; casts and receives shadows; connected position and rotation override the params)
scene.shadowCatcher ✅ ⚡ scene, markerInfo? → sceneObject (a plane on the marker showing only the shadows cast on it; width, depth, opacity; the marker's size when markerInfo is wired)
scene.environment ✅ ⚡ scene → sceneObject (image-based lighting and reflections, never drawn; neutral (a soft room made offline) or an uploaded .hdr; intensity and rotation; camera space, or following the marker when wired into a Marker Anchor; one per scene)
scene.anchor ✅ scene, pose, found?, markerInfo?, children[]? → sceneObject
scene.group ✅ ⚡ scene, children[]?, position?, rotation?, scale? → sceneObject (moves, turns, scales and hides its children together; position mm, rotation degrees X then Y then Z, scale per axis; connected inputs override the params; an object has one parent)
output.arView ✅ scene, camera, video, objects[]? →
math.expression ✅ ⚡ a?, b?, c?, d?, t? → number, color, vector3 (a formula, e.g. 40 + 30 * sin(t * 180): + - * / % ^, !, comparisons, && ||, ? :, functions in degrees; a–d override their params, t is its own clock unless wired; no eval. A whole formula of rgba(r, g, b, a) gives the colour, clamped to 0–1, and one of vec3(x, y, z) the vector; only the matching output gets a value)
math.number ✅ ⚡ → number
math.vector3 ✅ ⚡ x?, y?, z? → vector3 (connected inputs override the params)
math.splitVector3 ✅ vector3 → x, y, z
math.add / math.multiply ✅ ⚡ a?, b? → number
math.subtract / math.divide / math.min / math.max / math.mod ✅ ⚡ a?, b? → number (divide by 0: ±Infinity or NaN; mod is floored, with the sign of b: −30 mod 360 = 330)
math.negate / math.abs / math.sqrt / math.log / math.exp ✅ ⚡ x? → number (log is natural; outside its domain, NaN or −Infinity)
math.round / math.floor / math.ceil ✅ ⚡ x? → number (round: halves up)
math.clamp ✅ ⚡ x?, min?, max? → number (max wins if min is above it)
math.lerp ✅ ⚡ a?, b?, t? → a + (b − a) × t (not clamped)
math.remap ✅ ⚡ x?, inMin?, inMax?, outMin?, outMax? → number (not clamped)
math.pow ✅ ⚡ base?, exponent? → number
math.addVector3 / math.scaleVector3 ✅ ⚡ a?, b? → vector3 / vector?, factor? → vector3
math.vector2 / math.splitVector2 ✅ ⚡ x?, y? → vector2 / vector2 → x, y
math.length / math.normalize ✅ ⚡ vector? → number / vector3 (zero stays zero)
math.dot / math.cross / math.distance ✅ ⚡ a?, b? (vector3) → number / vector3 / number
math.matrix4 ✅ ⚡ position?, rotation? (degrees), scale? → matrix4 (T · R · S, column-major, as models are placed)
math.decomposeMatrix4 ✅ matrix4 → position, rotation (degrees), quaternion, scale (one uniform scale: a non-uniform scale or shear is lost)
math.matrixFromPose ✅ pose → matrix4, valid (identity and false without a pose)
math.matrixMultiply ✅ a?, b? (matrix4) → a · b (b first; unwired is the identity)
math.invert ✅ matrix4 → inverse, valid (identity and false for a singular matrix)
math.transformPoint ✅ ⚡ matrix4?, point? → point (divided by w)
math.sin / math.cos / math.tan ✅ ⚡ x? (degrees) → offset + amplitude × sin / cos / tan(x)
math.atan2 ✅ ⚡ y?, x? → angle in degrees (−180 to 180)
math.degToRad / math.radToDeg ✅ ⚡ x? → number
math.time ✅ ⚡ → seconds since start (× speed), delta (since the last frame, × speed)
color.rgba ✅ ⚡ r?, g?, b?, a? → color ([r, g, b, a], 0–1, sRGB)
color.split ✅ color → r, g, b, a
color.hex ✅ ⚡ → color (the picker's colour, opaque)
color.hsv ✅ ⚡ h? (degrees, wrapped), s?, v?, a? (0–1) → color
color.mix ✅ ⚡ a?, b? (colours), t? (0–1, clamped) → color (each channel and alpha, in sRGB)
color.brightness ✅ ⚡ color?, factor? → color (red, green and blue × factor, clamped; alpha kept)
color.invert ✅ ⚡ color? → color (1 − red, green and blue; alpha kept)
logic.and / logic.or ✅ a, b (boolean) → value
logic.not ✅ value → value
logic.toggle ✅ trigger, reset? (event) → value (flips on trigger; initial)
logic.timer ✅ ⚡ start, cancel? (event), duration? → onDone, running (duration in s, repeat)
logic.compare ✅ ⚡ a?, b? → value (==, !=, <, <=, >, >=, with a tolerance for == and !=)
logic.edge ✅ value → onRise, onFall
logic.branch ✅ trigger, condition? → onTrue, onFalse (if / else for events)
logic.switch ✅ ⚡ trigger, index? → case0–case3, onDefault
action.playAnimation ✅ ⚡ target, play?, pause?, stop? (events) → (a clip of a glTF model; loop, speed)
action.setVisible ✅ target, show?, hide?, toggle? (events) → (a model or a mesh)
action.playSound ✅ ⚡ play?, stop? (events) → (a sound file; volume, loop)
action.openUrl ✅ ⚡ show?, hide? (events) → (a link on the AR view; http and https only; label)
action.dispatchEvent ✅ trigger? (event) → (a named event to the page: DOM or postMessage; see "Talking to the page")
debug.inspector ✅ any → (value shown in the node)
debug.stats ✅ ⚡ stats? → (fps, process ms, latency; optional overlay on the AR view)
debug.trace ✅ ⚡ trace → (records while Recording is on, downloads a JSONL trace)
jsartoolkitNFT.datasetZft planned → NFT dataset (.zft)
webarkit.cvBackend planned → cvBackend (jsfeatNext / PureCV, @webarkit/cv-backend-spec)
webarkit.target planned → wnftTarget (.wnft)
webarkit.nftTracker planned video, cvBackend, target, filter? → pose, found, …
filter.ema, filter.kalman planned → poseFilter
scene.text, scene.video planned scene → sceneObject
AR Camera near / far override planned renderer-side override, for trackers that do not own their planes
playcanvas.renderer, aframe.renderer idea → renderer
debug.featurePoints planned → overlay

? = optional input, [] = accepts several connections, ⚡ = live params. Required inputs are checked before running.

Tracker facade API coverage

The controller node runs the jsartoolkitNFT tracker facade in the facade's own worker (createNFTTrackerWorker from @webarkit/jsartoolkit-nft/client, ≥ 1.16.0).

Tracker facade In the graph
createNFTTrackerWorker({ width, height, cameraParam }, { build, workerBase, signal }), process(frame, timestampMs) inside the controller node (one tracker, in its worker); build is the controller's Build, the start times out after 30 s
process() → { skipped: true } ignored: the controller sends a frame only when the previous one is done
addNFTTargets(sources) → TargetLoad[] the Datasets input, in order; a failed dataset is reported on the node, one line per dataset
configure({ continuousDetection, detectionInterval, logLevel, near, far, lostTimeout, ar2 }) Controller Settings (live)
filter: 'none' | 'native' | { type: 'oneEuro' } the filter slot: nothing, Native Filter, One Euro Filter
TargetInfo (widthPx, heightPx, dpi, widthMm, heightMm) markerInfo (via Select Marker)
cameraMatrix cameraMatrix output (raw), rebuilt live when near / far change
projectionFor(viewport, geometry) projection (letterbox undone), rebuilt with the lens
FrameResult.targets / transitions markers (pose, found, onFound, onLost per marker), controller onFound / onLost for any marker
addNFTTargets origin: 'center' not exposed: Marker Anchor's center does it in the scene

Known issues / notes

  • Hosting must return 404 for missing files: JsartoolkitNFT's tracker probes <marker>.zft before the other files and treats any HTTP 200 (such as an SPA index.html fallback) as a compressed dataset (upstream #676). The Vite config sets appType: 'mpa' for this reason.
  • Each tracker worker embeds its WASM (~716 kB); the page loads only the light client (a few kB, in the plugin's chunk) and the worker of the selected build (SIMD, standard or threaded). The worker files are served unchanged from jsartoolkit-nft/<version>/ next to the page, outside the Vite pipeline (the plugin's vite.ts), and exported apps get only their build's: the threaded build adds its pthread file (about 1.5 MB in all), and Auto needs the three builds (about 2.9 MB).
  • The Threaded build (td) needs a cross-origin isolated page, which the studio's is not (see "Export"), and upstream calls it experimental; on td, dispose() skips the native teardown (jsartoolkitNFT#695), and ending the worker frees the memory. It is also heavy on memory: upstream notes that each threaded module reserves 1 GB of shared memory, so keep to one Threaded or Auto controller per graph. Its poses match SIMD's within run-to-run noise, but it may report the first found a few frames later (it detects on a separate thread), which is expected for this opt-in build. Auto picks td on an isolated page, then SIMD, then standard; the facade does not report which one it picked, so the log says only which build was asked for and whether the page is isolated.
  • Lazy chunks: Three.js adapter ~530 kB, Babylon.js adapter ~790 kB (deep imports from @babylonjs/core; the barrel import would be ~5 MB).
  • The tracker's One Euro filter (@webarkit/oneeurofilter-ts) fixes dCutOff at 0.001, so the One Euro node exposes min cutoff, beta and warm-up only. The warm-up poses pass through unfiltered but are fed to the filter.
  • A graph may hold macro definitions (macros, #140): a macro node's ports and params are the inner ports and params its definition exposes. The studio checks and runs the flat graph, where each macro node is its inner nodes, named <macro node>/<inner node>; an inner node's report or error shows on its macro node. The .json, the autosave, the project and the app's graph.json keep the macros. In the editor, a macro is made from a selection, dissolved, entered, renamed, and its inner params promoted (see "Editing").
  • Graph format is webarkit-studio/graph v6. A v4 or v5 graph upgrades when it is opened, and the file itself is not touched. v2 and v3, prototype formats, are refused, and a newer document asks for a newer studio. An unfinished graph, with a required input not connected, reopens from an autosave or a file on Import… (a .json or a project, #86): Run and the standalone app export report what it lacks. An autosave that cannot be opened is kept in localStorage as webarkit-studio:autosave-set-aside, and the demo opens. Graphs saved by the prototype under its former name (webar-studio/graph) still load, and so does its last autosave.
  • JsartoolkitNFT ≥ 1.16.0 is required (the tracker facade and its light client). Since 1.16.0 the One Euro filter keeps poses rigid, so filtered poses differ slightly from 1.15.0. Its lens follows the planes from the start: the near 0.0001 init lens of 1.14.0 is gone.
  • The processing frame has integer sizes (letterbox(), which calls @webarkit/camera-view): the facade rejects a frame whose size differs from the tracker's.
  • Near / far are in marker units (mm). Controller Settings defaults to 10 mm / 10 m; without a settings node the library planes (0.1 / 1000) are used, so content farther than 1 m from the camera is clipped.
  • The data-oriented API proposal, jsartoolkitNFT#720 (docs/proposals/), is still open upstream; 1.15.0 ships its tracker facade, 1.16.0 the light client for its worker.

Roadmap

The source of truth for the roadmap is #1. This list follows it.

Phase 1 — Foundation (this prototype)

  • Graph format v1 + validation
  • Rete editor with typed sockets and a lit-html renderer
  • Runtime + standalone player
  • JsartoolkitNFT controller node (worker, SIMD/standard)
  • Provider-namespaced node types, webarkit.* reserved
  • Renderer abstraction: Three.js + Babylon.js
  • Pose filter slot: One Euro, ARToolKit native
  • Renderer / Scene / AR Camera split, Light node
  • Controller settings slot with live configure
  • markerInfo / cameraMatrix outputs, Inspector node
  • onFound / onLost events
  • Lights in camera or marker space
  • Reload button
  • Export: standalone app bundle (only the engines and builds the graph uses)
  • Multi NFT: several datasets per controller, Select Marker, per-marker filters and events
  • Tests (unit, integration with the Node build, e2e with a fake camera), benchmarks, CI
  • Stats node; runtime input plan (7–42× faster per frame)
  • jsartoolkit-nft 1.14.0: live near / far via recalculateCameraLens()
  • jsartoolkit-nft 1.15.0: the tracker facade (createNFTTracker) replaces the hand-written tracking code (#5)

Phase 2 — Authoring

  • Inspector panel for complex params (vector3, matrix4 param kinds)
  • Undo / redo (rete-history-plugin), including param edits
  • Context menu / search to add nodes, minimap, auto-arrange (a layered layout instead of elkjs), copy / paste
  • Asset manager: upload images and datasets, glTF models
  • First math nodes and a Primitive position driven by an input (#25)
  • Plugin API (#12): typed manifest, graph format v5 plugins, jsartoolkitNFT moved onto it
  • jsartoolkit-nft 1.16.0: the facade's own worker (createNFTTrackerWorker, light client) replaces ours (#14)
  • MCP server (#8): catalog, graph editing and validation, tracking on images in Node, app export

Phase 3 — Logic and publishing (released in v0.3.0; #3 has the full list)

  • glTF animations on both renderers (#58)
  • Logic nodes and the event model (#59)
  • Action nodes triggered by events (#60)
  • Math nodes: numbers, vectors, matrices, functions, renderer-independent (#24)
  • Script nodes: script.lite (#35), three.script (#36), three.renderScript (#37)
  • Graph format migrations: older versions upgrade on load (#61)
  • Deploy: an export with a GitHub Actions workflow, which you push to your own repository for GitHub Pages; the studio holds no credential (#62)
  • Threaded JsartoolkitNFT build, and cross-origin isolation in the export (#63)
  • Export: readable source code (Three.js first) (#64)

Phase 4 — Scene and editor (released in v0.4.0; #142 has the full list)

  • Node selection and macros in the editor
  • Scene nodes on both engines (geometry, mesh, materials, lights, shadows, environment), with a conformance suite

Phase 5 — Authoring tools and interaction (v0.5.0)

  • Near / far on AR Camera, a preview camera, scene helpers, fog, custom geometry
  • NFT dataset generation from an uploaded image
  • Touch and mouse interaction with meshes and markers

Unscheduled

  • WebARKit integration (#4): no phase and no version; it starts when webarkit/webarkit publishes @webarkit/nft-tracker
  • Not planned for a release yet: artoolkit5-ts as the first external plugin (#31)
  • Not planned for a release yet: loading plugins from a URL (#32)

History

WebARKit Studio is a rewrite, not a continuation of the existing code. It replaces WebAR-Studio, a fork of arStudio built on webglstudio.js, which stays available for reference. None of its code is reused here.

It is a separate project from AR.js Studio, which creates AR.js marker-based apps without a node editor.

Contributing

See CONTRIBUTING.md. Pull requests target dev; master is for releases.

License

LGPL-3.0-or-later. Copyright 2026 WebARKit.

About

WebARKit Studio — node-based WebAR authoring tool (Rete.js + JsartoolkitNFT)

Topics

augmented-realitybabylonjsjsartoolkitnftnode-editorthreejswebarwebarkit

Resources

Readme
LGPL-3.0 license

Code of conduct

Code of conduct

Contributing

Contributing
Activity
Custom properties

Stars

2 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.