Headless 3D and VFX engine for agents. Research preview.
std: "program":"std/<m>"; import std.<m>;
Procedural textures: import std.procedurals; signatures/examples: vork help std --all.
Programs: std/hair (curves), std/sky
(environment), std/bloom (compositor). Depth of field: std/camera use_dof; motion blur: render.motion_blur.
std/agx (default) and std/standard: Blender 5.2.1 display programs.
Inputs: exposure (stops), gamma, dither_intensity; AgX also look and lut.
Named display instances animate with material-input tracks; looks use STEP.
<!-- all -->
SHAPE REFERENCE
For vork std NAME JSON, name is optional and defaults to NAME; returned geometry and
buffers use that prefix (e.g. box, box_position, box_normal, box_TEXCOORD_0, box_indices).
SDK builders default the name likewise; pass undefined before required options. Shapes are centred;
round shapes use Y as axis. Cylinder has both caps; cone has a bottom cap; size = full extent; capsule height includes
caps; torus radius is to the tube centre. Radii and bevels clamp to fit without overlap, scaling unequal corners together; extrusion rims fit depth/2 and profile clearance. Negative or non-finite values are errors. Rounded box segments subdivide the bevel
(rounded up to an even count), preserving exact planar faces at every count. Box faces each span 0..1 UV; round shapes: u from +X toward
-Z around Y, v top to bottom.
<!-- generated-shapes:start -->
cylinder: {name?:string="cylinder",radius?:number=1,height?:number=2,segments?:number=32} → GeometryFragment
cone: {name?:string="cone",radius?:number=1,height?:number=2,segments?:number=32} → GeometryFragment
torus: {name?:string="torus",radius?:number=1,tube?:number=0.25,segments?:number=48,rings?:number=12} → GeometryFragment
capsule: {name?:string="capsule",radius?:number=0.5,height?:number=2,segments?:number=32,rings?:number=24} → GeometryFragment
rounded_box: {name?:string="rounded_box",size?:vec3=[1,1,1],radius?:number=0.1,segments?:number=8} → GeometryFragment
revolve: {name?:string="revolve",profile:vec2[],segments?:number=32} → GeometryFragment; profile:[radius,height][] around +Y; consecutive duplicates ignored; radius-0 ends close; other ends open; last=first closes loop; corners >30° sharp; u from +X toward -Z, v along profile
text: {name?:string="text",body:string,font:string,size?:number,extrude?:number,bevel_depth?:number,bevel_resolution?:number,align_x?:"left"|"center"|"right"|"justify"|"flush",align_y?:"center"|"top_baseline"|"top"|"bottom_baseline"|"bottom"} → GeometryFragment; font:TrueType/OpenType file; extrude:half-depth; bevel_depth:metres
extrude: {name?:string="extrude",outline:vec2[],holes?:vec2[][],depth?:number=1,bevel_depth?:number=0,bevel_resolution?:number=4} → GeometryFragment; XY outline/holes: either winding; depth:full Z thickness, centred; +Z front; bevel_depth:inward rim radius; bevel_resolution:1..32; wall corners >30° sharp; cap uv spans outline bounds (v down); wall u along contour, v front→back
<!-- generated-shapes:end -->
SHADER REFERENCE
std/hair: Principled Hair (Chiang); curves only; parametrization color|melanin|absorption, color,
melanin, melanin_redness, tint, absorption_coefficient, roughness, radial_roughness, coat, ior,
offset, random_roughness, random_color, random. Physical hair selects path transport with Chiang fibre scattering.
std/environment_image: Image image; optional Image lighting_weight; lat-long +Y up, longitude atan2(z,x)/2pi+0.5; lighting_weight.r weights lighting only (unbound = 1).
std/sky: Nishita scattering atmosphere; sun_elevation, sun_rotation, altitude, air_density, aerosol_density, ozone_density.
vork std sky: atmosphere plus declared solar light; sun_size is full angle, sun_intensity scales solar emission.
vork std environment: {file,output,name?,threshold?,color_space?,fps?}; weight EXR plus environment program and declared sun; threshold defaults to 10.
std/bloom: add prepare(original={channel:color}), named highlights, then combine(original={channel:color},source={node:highlights}) to render.compositor. stage is an input; adjust prepare threshold=1 and combine strength=1. Full JSON: vork help compositor.
Modules (import std.<m>):
std.texture: texture_footprint(uv,dx,dy,ctx); texture_sample(image,footprint,ctx).
texture_normal(image,footprint,ctx,factors,derived,out variance) and texture_tangent(image,footprint,ctx,factors,derived) return world-space vectors.
filtered_ggx_roughness(roughness,variance) accounts for filtered normal dispersion.
std.vector: bump(normal:float3, position_dx:float3, position_dy:float3, height_dx:float, height_dy:float,
strength=1, distance=.001, invert=false) → float3; supply position/height derivatives explicitly.
std.procedurals: noise, noise_color, voronoi, white_noise, gabor.
Slang signatures below: p is float3; scalar inputs float except dimensions:int and normalize:bool.
noise(p, scale=5, detail=2, roughness=.5, lacunarity=2, distortion=0, normalize=true,
type=NoiseType.FBM, dimensions=3, w=0, offset=0, gain=1) → float.
noise_color: same inputs → float3, independently seeded channels.
NoiseType: FBM|Multifractal|Hybrid_Multifractal|Ridged_Multifractal|Hetero_Terrain (case-sensitive).
FBM with normalize=true is centred on .5, range [0,1]; other modes/un-normalized values may exceed it.
Detail adds octaves beyond the base (0..15, fractional blends); dimensions 1..4; 1D uses w, 4D adds w.
voronoi(p, scale=5, randomness=1, feature=VoronoiFeature.F1, metric=DistanceMetric.Euclidean,
smoothness=1, exponent=.5, dimensions=3, w=0, detail=0, roughness=.5, lacunarity=2,
normalize=false) → {distance:float, color:float3, position:float3, w:float, radius:float}.
VoronoiFeature: F1|F2|Smooth_F1|Distance_To_Edge|N_Sphere_Radius.
DistanceMetric: Euclidean|Manhattan|Chebychev|Minkowski (exponent controls Minkowski).
Distances/radius use cell space; position/w locate features in input space; color identifies cells.
Smooth_F1 is a smooth minimum and can undershoot zero (including color). normalize divides
distance by weighted cell diagonal; not a clamp.
white_noise(p, dimensions=3, w=0) → {value:float, color:float3} in [0,1]; hashes coordinates, no cells.
gabor(p, scale=5, frequency=2, anisotropy=1, dimensions=2, orientation=.7853981634,
direction=float3(1.41421356237,1.41421356237,0)) → {value:float, phase:float, intensity:float}, [0,1].
Gabor uses 2D XY/orientation radians, otherwise 3D/direction; anisotropy 0=random, 1=aligned.
Example (inline surface program, no texture assets):
import vork; import std.procedurals;
struct Inputs {};
Closure surface(ShadingContext ctx, Inputs inputs) {
Closure c={}; c.base_color=lerp(float3(.65,.6,.5),float3(.05),noise(ctx.rest_position));
c.specular_roughness=.25; return c;
}
For soft bands use smoothstep(.45,.65,noise(p,3,4)); scale/rotate p to stretch bands.
std.color: color_ramp<N>(factor, RampStop[N], constant|linear|ease|cardinal|b_spline, rgb|hsv|hsl,
near|far|cw|ccw); blackbody(kelvin); wavelength(nm)
std.grid: sample_grid(FloatGrid|VectorGrid, position)
std.hair_bsdf: principled_hair, hair_melanin, hair_absorption, hair_evaluate, hair_sample
std.particles: Yu–Turk anisotropic particle-surface mathematics (ACM TOG 2013).
particle_moment(inout ParticleMoments, relative:float3, neighbourhood_radius:float):
accumulate weighted relative moments within compact support; initialize moments to zero.
particle_metric(moments, radius, neighbourhood_radius, minimum_neighbours:uint,
maximum_ratio, out support:float) → float3x3 world-to-kernel metric.
Positive radii and maximum_ratio >= 1 required; sparse neighbourhoods use a sphere.
Radius is the isotropic compact support; covariance normalization is scale invariant.
particle_kernel(relative:float3, metric:float3x3) → normalized 3D cubic density.
particle_cubic(q:float) → radial cubic shape, q >= 0, zero for q >= 1.
Fit from a retained particle generation, then evaluate from a separate dispatch.
Neighbour search must cover returned support plus any authored centre relocation.
Density normalization, surface isovalue and particle relocation belong to the caller.