nishi code wiki / research / deformables

Cloth and soft tissue: what is real-time, what is validatable

Published · lineage: forks off the biological-plausibility brief and completes the realism trilogy begun in perceptual oracles · context: a browser WebGL2 engine with integer-deterministic physics

Three findings reorder the work. (1) The industry is removing continuous collision detection, not adding it — the 2025 real-time intersection-free result wins precisely by deleting it. (2) Substepping cannot stop a skirt passing through a kicking leg; that is a closed-form limit, and every shipping system solves it with a constant-time containment trick instead. (3) For soft tissue, material realism is not the bottleneck — heterogeneous and homogeneous models land within a millimetre of each other, while boundary conditions dominate. Tuning material cards is the wrong lever.

1. The budget that decides everything

A 2025 measurement of cloth on the web platform is unambiguous: WebGL holds 60fps only to about 4,000 simulated nodes, degrades to 30–40fps at 10,000, and collapses to 3.6fps at 65,500 — because it has no compute shaders. That closes the GPU escape hatch on our platform empirically and sets the realistic budget at hundreds, not thousands, of simulated vertices per garment, consistent with the ~0.35 ms and <300-vertex figures reported for a shipping engine's optimised cloth. For comparison, a measured wool suit in a major engine costs 27–34 ms per frame — roughly three times an entire 90Hz VR frame, for one garment.

Sources: arXiv:2507.11794 (Real-Time Cloth Simulation Using WebGPU, 2025-07-15)

2. Do not build continuous collision detection

EvidenceWhat it says
The tutorial literatureThe canonical explainer's slide is titled "Use Sub-Stepping, not CCD"
Engine practiceEngine staff recommend disabling CCD for cloth and setting iterations to 1
The 2025 state of the artThe one genuine real-time intersection-free result wins by removing CCD, replacing its line search with per-vertex safe-displacement bounds
If you still want a netAdditive CCD is documented as >100× faster than the exact method, with no cubic solve, no radicals and no divisions. Its one documented weakness is floating-point rounding — which fixed-point arithmetic removes
An unusually clean fit for an integer engine. The reference CCD benchmark ships its queries as exact rationals encoded as integer pairs, with exact boolean ground truth, MIT-licensed. For an integer-deterministic engine that is a native oracle — no float conversion, no tolerance fudging. Its degenerate cases are where every algorithm dies (runtimes blow up ~2000×), so they belong in the test set deliberately.

3. Why skirts pass through legs — and the constant-time fix

The limit is closed-form: maximum safe velocity is v_max = r·n/Δt, where the particle radius r is capped by mesh edge length. Worked with realistic numbers this gives about 6 m/s — below a kicking limb. Substepping alone mathematically cannot cover it. Every shipping system therefore adds a constant-time containment layer rather than more collision: a skinning-anchored backstop sphere per vertex; a design-time bind of each particle to a bone with a per-depth looseness curve; or a "sync bone" that applies the leg's own delta to the skirt so it is pushed ahead of the leg and cannot tunnel by construction, at any speed. A between-the-legs plane test is one dot product and a compare — exact in integers.

Substepping is still worth it where it helps: measured, ~9% more cost bought two orders of magnitude less error, and the accompanying lever is to detect collisions once per frame and reuse the contact set across substeps. Note also that the standard single-precision warning about small position deltas vanishing into large coordinates does not apply to fixed-point — substep counts that silently stall a float solver are safe for us.

4. Soft tissue: gate on ratios and kinematics, never on material constants

Absolute moduli are not gateable. Published stiffness for the same tissue moves by 10× to 100× depending on pre-strain and measurement modality — one study attributes a tenfold disagreement with another purely to pre-compression strain hardening, and skin spans three orders of magnitude across methods (7 kPa to 5.5 MPa) because different probes engage different layers. Worse, two independent studies report identified parameter standard deviations exceeding their means: the inverse problems are ill-posed. Gate on the ratio structure — which is stable across every method — and on kinematic output, never on identified material parameters.
AxisThresholdWhy it is defensible
Shape-prior floorsurface error < 2.8 mman open statistical shape model reproduces unseen real anatomy at 0.17 mm generalisation and 2.8 mm specificity — a physics oracle above that is losing to a linear model
Damage boundpeak skin strain < 60%60% is the onset of collagen fibre fracture — a mechanism, not a convention. Measured unsupported running averages 46% (range 25–93%), falling to 28% with support
Landmark error≤ 5 mm good, > 10 mm faila published optimiser stop and a field-wide stated goal
Signal correlationISO/TS 18571 rating ≥ 0.80free command-line tool emits the single scalar directly

Sources: Weiherer et al., The Visual Computer (open 3D statistical shape model, CC BY) · Norris et al., BMJ Open Sport Exerc Med 6:e000770 (skin strain during running) · VIVA+ open human body model (LGPL-3.0) · Teixeira & Martins 2023 (tissue stiffness ratios, CC BY)

5. What this changes in our own build

Our chest-motion oracle already measures frequency, amplitude, torso stability, and phase lag against the drive, and currently reads 2.5 Hz / 3.2 cm / 0.0 cm / 7-tick lag at 0.89 coherence. The findings above add two things we did not have: a damage-bound sanity check (peak strain must stay under the fibre-fracture threshold, and our amplitude should sit nearer the supported than the unsupported band for clothed characters), and a ratio-based material check that is immune to the pre-strain trap. They also tell us what not to build: no continuous collision detection, no self-collision, no per-garment solver above a few hundred vertices.

UNVERIFIED / declared gaps