Skip to main content

Crate ultrafast_render

Crate ultrafast_render 

Source
Expand description

ultrafast renderer: compiles documents into fused GPU plans and executes them.

Per frame the renderer: (1) checks the document’s structure signature and recompiles the plan only if it changed, (2) packs params for every group into the frame’s param arena, (3) skips static groups whose inputs and params are unchanged, (4) dispatches one kernel per group, falling back to tier-0 kernels for groups whose fused kernel is still compiling.

Every texture a kernel reads is placed: a texture plus the frame position of its top-left texel. Frame-sized intermediates sit at the origin; rasterized paths and text get textures sized to their bounds, so their cost scales with what they cover, not with the frame.

Modules§

autofaces
Face tracks for clip_camera from the footage itself, when a document gives no faces: the clip is decoded at ten frames a second through the same decoder the video op uses, and ultrafast_framing::faces finds, tracks and scores the faces. Results are cached per file and range in the user cache (.../ultrafast/faces/), so a clip is analysed once.
blocks
Ready-made animated blocks: a title card, a lower third, a pull quote, a stat, a chapter marker and an end card, in one house style (masked rises on an expo ease, staggered; a masked exit). A block is one node in the document; it expands into a component of ordinary text, shape and path nodes measured and laid out for the frame, so give it a timing offset to place it in time, and ultrafast treats every part as editable.
builtins
Built-in components: common effects expressed as ultrafast graphs, available to every document by op name (a document’s own component of the same name wins). They expand like any component, so they fuse with the rest of the graph and stay fully editable when copied into a document.
captions
Animated captions from word timings: the karaoke, pop-on and reveal styles of social video, as ordinary text nodes.
code
code: source code set in a panel, syntax-highlighted, optionally typed on with a caret, with line numbers, highlighted lines and window chrome. It expands into a component of ordinary nodes: the code is one text node whose colors are inline spans, so it stays editable and sharp.
codegen
Slang code generation for fused kernels.
follow
clip_camera: a video framed on its speaker from face tracks (a face worker’s, or crate::faces run on the footage when none are given). The camera (subject choice, anchored easing, cuts, scope zoom, protect mode) comes from ultrafast-framing and is computed once per clip; the node expands into ordinary video nodes whose rect is keyed per frame, so everything downstream (effects, masks, motion blur, live edits of the rest of the document) treats it like any other footage.
fontfetch
Fonts by name from Google Fonts: a family a document names that is not installed is downloaded once (TrueType, every weight and style it has) into a per-user cache and used from there. ULTRAFAST_OFFLINE=1 turns downloading off; cached families still load.
geom
Vector geometry for the GPU rasterizer: paths (SVG data, presets, strokes, dashes, trims) and text (font lookup, shaping, layout).
images
Image resources: decoded off the render thread, uploaded once, converted to the working space once, then shared by every node that references them.
kernels
Kernel cache and background compiler.
layout
stack: lays its inputs out in a column or a row by their measured bounds, so agents compose blocks of type, artwork and shapes without computing positions. Each child is wrapped in a translation (absorbed by vector content, so it stays sharp), and the stack becomes their composite. Children keep their own animation, relative to the layout.
lottie
Lottie import: a Lottie (Bodymovin) animation becomes ordinary ultrafast nodes, so every shape, fill, stroke and keyframe of it is editable.
lru
A small bounded cache: when it grows past its capacity, the least recently used quarter is evicted.
markup
Inline styling inside a text param:
ops
Op registry: how each document op maps onto the Slang op library, which image ports it has, and how its params pack into the fixed-size float block the shader reads.
particles
Deterministic particle systems: every particle’s state is a closed-form function of (seed, index, time), so any frame renders in any order and scrubbing or editing never needs a simulation history.
plan
Graph -> render plan compiler.
pushdown
Transforms pushed down through composites, so a camera over a whole composition keeps type and vectors sharp.
raymarch
raymarch: 3D as a signed-distance scene marched per pixel. The agent writes only the scene — float2 map(float3 p) returning (distance, material id), and optionally material(...) — and the op supplies the rest: a camera, soft shadows, ambient occlusion, a traced reflection bounce, an environment, tone mapping and jittered antialiasing. Edges are resolved per sample, so it reads as rendered rather than rasterized.
review
ultrafast review: an automatic second pair of eyes for agents. Renders the film and reports what a viewer would trip over: text that never becomes readable, is on screen too briefly to read, runs off the frame or into the platform UI, collides with other text, or is too small; and flashing that risks photosensitive viewers.
scene3d
3D scenes: meshes (primitives, glTF), lights and cameras as graph nodes, rendered by a render3d node into an image like any other.
schema
Machine-readable op vocabulary: every op’s ports and params with types, defaults and meaning. Agents read it (ultrafast ops, the live ops request) and ultrafast check uses it to flag misspelled or mistyped params.
svg
SVG import: an SVG file becomes ordinary ultrafast nodes, one path per filled or stroked shape (gradients as masked gradients), composited in paint order. The result is a component, so every part of a logo or icon is an editable, animatable node, and everything stays vector: placement goes into each path’s own params, so it is sharp at any scale.
swarm
Swarms: particles that assemble into type or a path and scatter again. Each particle has a home inside the glyphs (sampled once, uniformly by area) and a scattered start; progress (0 scattered, 1 formed) moves every particle home along its own delayed, eased path. Closed form, like particles: any frame renders in any order.
tables
Big constant tables in agent shader code, read from the params instead.
transitions
transition: from one shot (a) to the next (b) over duration seconds starting at. Before it only a renders, after it only b (three windowed layers, so neither shot costs anything outside its time); during it one shader blends them by kind.

Structs§

Diagnostic
A problem tied to a node that does not stop rendering (bad shader code, missing image). Agents read these to fix their documents.
FrameOutput
The final image of a frame, handed to Renderer::submit_frame_with callbacks so they can consume it in the same command buffer.
FrameReport
What one frame cost and how it was produced.
GroupCost
What one render group cost on the GPU while profiling.
GroupShare
Picked
An element under a point of the frame (Renderer::pick).
ProfileReport
Where a document’s GPU time goes (Renderer::profile_frames).
Renderer
Visible
An element on screen (Renderer::visible).

Enums§

Mode
How the renderer treats kernels that are still compiling.
Readback
How Renderer::render_readback hands a frame back.
RenderError

Functions§

media_path
Where a document’s media reference points: URLs (https://..., decoded by ffmpeg straight from the network) and absolute paths as they are, relative paths under base.