Architecture
This page explains how Continuum works from the point of view of someone building scenes in Divooka: what a scene is made of, how its solvers are stepped and coupled, the conventions at the boundary with Divooka, and what you can rely on. The engine's internals are documented in its own repository; nothing here requires reading them.
1. Layers
| Layer | What it is |
|---|---|
| Your Divooka graph | dataflow or procedural |
| Functional nodes | ContinuumScene, ContinuumTriggers, ContinuumSimulation, ContinuumResults, ContinuumExport |
| Procedural nodes | SimulationSession |
| Scene runtime | turns a description into an engine scene; names, triggers, Divooka's axes |
| Continuum engine | rigid world, cloth, fluids, FEM, particles, ocean, CFD, robotics |
- Nodes are what you place in a graph. Dataflow nodes build and read immutable values; the session nodes drive a running scene.
- The runtime turns a scene description into an engine scene, keeps the name of everything in it, evaluates triggers, and converts every value between Divooka's axes and the engine's.
- The engine does the physics. It is a purely managed .NET library, compiled to native code with the rest of Divooka.
Both styles of graph go through the same runtime, which is why a session and Simulate agree bit for bit.
2. What a scene is made of
A scene has:
- One rigid world. Every rigid body lives here: the ground, crates, walls, debris, vehicles, a robot's links. It is the hub of the scene: every other solver collides with its bodies and pushes them.
- Any number of other solvers: cloth and soft bodies, liquids, smoke, finite element solids, granular media, particles, oceans, lattice Boltzmann flows. Each is the method best suited to its matter (see Domains).
- Shared fields: gravity, wind with gusts, and blasts. Every solver feels them on its own elements: a wind pushes cloth triangles, leaves and smoke alike.
- Triggers: conditions and actions evaluated during the run (see Events and triggers).
The solvers do not know about each other. They only know the rigid world through one small exchange, so any combination can share a scene.
3. One coupling step
The scene advances in coupling steps. NewScene's couplingRate sets how many there are per second (120 by default; 200 in the getting-started scene). Within one step:
- Fields and blasts advance. Due charges detonate, and breakable bodies the blast reaches shatter before anyone looks at them. A millisecond pulse is delivered as its exact impulse, whatever the step of the solver receiving it.
- One boundary snapshot. The rigid world publishes every collider once: shape, pose, velocity, mass and inertia. Every solver sees the same boundaries.
- Solvers step. Each sub-steps as often as its own stability needs (a stiff cloth more often, an ocean less), collides with the snapshot, and queues the impulses it applied to each body.
- The rigid world steps. It applies the queued reactions, buoyancy and blast loads, then solves its contacts and joints.
- Effects follow. Solvers that should see the final rigid state (VFX debris and spray) step after it.
- Triggers fire. Conditions are tested on the state of the step; actions run.
Choosing the coupling rate. It is the knob that trades cost for tightness. Light bodies in heavy fluids and stiff contacts want more coupling steps per second; a calm scene of heavy objects needs fewer. Each solver still chooses its own sub-steps, so a low coupling rate does not make cloth or water unstable; it only makes their exchange with the rigid bodies coarser.
4. Axes and units
Divooka is right-handed with +X forward (towards the viewer), +Y right and +Z up. The engine is +Y up internally. The runtime converts every value at the boundary with
Divooka (x, y, z) = Continuum (z, x, y)
which is a rotation, not a mirror: triangle winding, cross products and handedness survive, and positions round-trip exactly. You never see the engine's axes; gravity is (0, 0, −9.81) and the ground is z = 0.
Units are SI throughout: metres, kilograms, seconds, newtons, pascals, newton-seconds for impulses. Densities are kg/m³, cloth is kg/m², charges are kg of TNT. Geometry authored in millimetres comes in with unitScale 0.001.
The engine computes in single precision for bodies, particles and grids, and in double precision for finite elements, articulated robots and N-body gravity. Keep a scene within a few kilometres of the origin; a VFX shot is a controlled domain, so this is rarely a constraint.
5. Determinism
The same scene gives bit-identical results on any number of threads. Parallel work is split into chunks that depend only on the size of the problem, and sums are combined in a fixed order. In practice:
Simulateis a pure function, and Divooka may cache it.- The
threadsinput ofSimulateandStartis a performance setting; it cannot change the result. - A session stepped frame by frame records exactly what
Simulaterecords. - A random scatter (for example in
Spawn) comes from the scene'sseed, so it too is repeatable.
6. Values, ownership and memory
- Descriptions (
SceneDescription,BodyDescription,TriggerDescription…) and results (SimulationResult,SimulationFrame,SimulationEvent) are immutable. They can be shared between graphs and threads. Meshes passed in are copied; meshes returned are new. - A session owns a running engine scene until it is disposed. It is not thread-safe: one graph drives it.
- A result keeps every frame in memory. Rigid poses are small; water costs 12 bytes per particle per frame.
recordWater: falseleaves water out. - The engine's steady steps allocate nothing, so long runs are not paused by garbage collection. A procedural loop that only steps and reads poses allocates almost nothing; capturing frames allocates what you keep.
7. Backends: CPU and GPU
Continuum runs on the CPU, on all cores, with wide SIMD. A Vulkan compute back end is in development: a scene or a single solver opts in to a GPU, the lattice Boltzmann solver first, with an optional half-precision lattice for quick previews. One simulation runs on one backend at a time; the CPU path remains the reference.
In Divooka: the scene that
NewScenestarts runs on the CPU; a backend setting for it is planned. The real-time smoke, liquid, particle, ocean and shore nodes run on a graphics card through Vulkan (see the Physics toolbox).
8. Quality, cost and real time
Cost depends on resolution: particle spacing, grid cells and cloth cells. A rigid-body scene of hundreds of bodies runs in real time; SPH, FLIP, smoke and CFD scenes at offline resolution take from a few hundred milliseconds to seconds per frame on a laptop CPU. Use a session at low resolution to block out a shot, then Simulate at full resolution for the final frames. Each domain page gives typical costs.
See also
- Functional API and Procedural API
- Coupling: what each solver exchanges with the rigid world