Color legend plain property
Every tunable of the solver and of the sheet it builds.
A sealed class of properties, in the namespace BorrowedTorch.FabricSimulator.Simulation: new FabricSettings() gives every setting its default, except the grid and RestLength, which are 0 and every setup must set. A plain object you change in place: Update and Step apply it before every step, so a change takes effect at the next one. The sheet’s own settings, the grid, RestLength and SeedRipple, are read only by Rebuild, see AutoRebuild. Where the sheet hangs and what holds it are Fabric’s own. A setting that isn’t a finite number throws ArgumentException at the next upload, naming it, rather than reaching the GPU, where one NaN spreads through the whole sheet within a few steps. The settings page shows it in context, with code.
Names are colored by what they are: a property; values and fields keep the plain color.
Properties
AddedMassCoefficient →
float · With UseAerodynamicPressure only: how much of the air the sheet drags along counts as extra mass, 0 none and 1 the physical amount. 1 by default; below 0 counts as 0. It can only calm the cloth: the pressure model divides by the mass it adds rather than adding a force.
AirDensity →
float · The air’s density, in kilograms per cubic meter. 1.225 by default, air at sea level; 0 is a vacuum, with no drag at all, and below 0 counts as 0.
ArealDensity →
float · The cloth’s weight, in kilograms per square meter. 0.2 by default; light cotton is about 0.15, canvas 0.5, upholstery 1. Each point carries the patch of cloth it stands for, ParticleMass, so a sheet behaves the same at any resolution. Values under 10−7 count as 10−7.
AutoRebuild →
bool · Whether the sheet rebuilds by itself, at the next Update or Step, whenever something only Rebuild reads has changed: the grid, RestLength or SeedRipple, or the sheet’s Origin, Orientation, Rotation, PinMode or PinnedIndices. Exact comparisons, and a SeedRipple as it is clamped. false by default. A rebuild starts over, a fresh sheet with every tear mended and every SetPinned change dropped, so it suits a setup being edited, from a tuning panel say, not an Origin moved every frame. Handle Rebuilt to resize your buffers.
BendingIterations →
int · How many of the RelaxationIterations rounds also solve folds, spread evenly over them. EveryRound, the default, or any count from RelaxationIterations up, means every round; below 0 counts as EveryRound. Each round that solves folds adds a pass that solves every fold once. With ContactIterations, the knob to turn first on a large sheet, which wants 1 or 2.
BendingPlasticRate →
float · How fast a fold bent past BendingPlasticYieldDegrees sets as a crease: the share of the way its rest angle moves towards the fold. A fraction per 1/120 s, that is per step at the default SolverFrequencyHz, rescaled to any other step rate so the cloth behaves the same. 0 by default, a fold that always springs back; 0.01 to 0.1 for cloth that remembers its folds. Clamped to 0 to 1.
BendingPlasticYieldDegrees →
float · How far a fold must pass its rest shape, in degrees, before it starts to set as a crease at BendingPlasticRate. 30 by default. Clamped to 0 to 180.
BendingStiffness →
float · How hard folds are resisted. Keep it well under Stiffness: real cloth folds far more easily than it stretches, and a stiff fold turns it to cardboard. 0.5 by default. Clamped to 0 to 1.
ColliderFriction →
float · The grip of the sphere and the ground: 0 slides freely, 1 sticks. A fraction per 1/120 s, that is per step at the default SolverFrequencyHz, rescaled to any other step rate so the cloth behaves the same. Unscaled, it also sets the static friction that holds resting cloth on a slope or against a breeze, see UseRestHold: a setting of f holds a push along the surface up to f / (1 − f) times the push into it, so 0.35 holds a slope of about 28°, 0.5 one of 45° and 1 any slope, at any step rate. 0.35 by default. Clamped to 0 to 1.
CompressionSlack →
float · How short a thread may fold, as a fraction of its rest length, before it pushes back: between that and its rest length it is free, as cloth crumples easily. Lower crumples tighter. With self-collision on, keep it at least MinimumCompressionSlackForContacts, or crushed threads hold layers closer than the cloth is thick and a pile never settles. 0.375 by default, that minimum at the default thickness. Clamped to 0 to 1.
ContactIterations →
int · How many of the RelaxationIterations rounds also solve self-collision, spread evenly over them. EveryRound, or any count from RelaxationIterations up, means every round; below 0 counts as EveryRound. 4 by default. The partners are found once a step, so each extra round only tests them again, but on a large sheet it is still the first knob to turn down: large grids want 1 or 2.
Damping →
float · The share of the cloth’s motion damped away. A fraction per 1/120 s, that is per step at the default SolverFrequencyHz, rescaled to any other step rate so the cloth behaves the same. 0.02 by default; 0.01 to 0.05 suits cloth. Clamped to 0 to 1.
DragCoefficient →
float · How hard the air resists the sheet: scales the drag on each point’s patch of cloth, against its motion relative to Wind. 1.2 by default, about right for a flat sheet; 0 is no drag, and below 0 counts as 0.
Gravity →
Vector3 · The acceleration of gravity, in meters per second squared, in world space. (0, -9.81, 0) by default. The ground collider stays level, at GroundColliderHeight, whichever way it points.
GroundColliderHeight →
float · The ground’s height: the world Y of a level plane, whichever way Gravity points. 0 by default.
HeightInParticles →
int · Points from the first row to the last: along the height of a vertical sheet, the depth of one lying down. 0 by default: always set it, to at least 2. Read at Rebuild, which throws InvalidOperationException for less than 2; HeightInParticles reports the sheet as built.
MaxStepsPerFrame →
int · The most steps one frame may run to catch up. The backlog beyond is dropped, and IsSaturated says so, so one slow frame can’t snowball into slower ones. 4 by default; below 1 counts as 1.
MinimumCompressionSlackForContacts →
float · Read-only. The lowest CompressionSlack that doesn’t fight self-collision: half of SelfCollisionThicknessRatio, at least 0.05 of it, so 0.375 at the default. Below it, two crushed threads hold points two apart closer than the cloth is thick, and a pile re-fights the same contacts every round instead of settling.
ParticleMass →
float · Read-only. The mass one point carries, in kilograms: ArealDensity × RestLength², the patch of cloth it stands for, at least 10−7. From these settings’ RestLength, which the live sheet takes only at Rebuild.
RelaxationIterations →
int · The rounds of constraint solving per step: more rounds, less stretch, and proportionally more work. 10 by default; 8 to 14 suits cloth. Unlike BendingIterations and ContactIterations, 0 means none: no threads are solved, though one round still runs, so the colliders and the pins’ reach hold. Below 0 counts as 0.
RestDriveFraction →
float · Keeps gently falling points awake: a slow point moving along the force on it faster than this fraction of what one step’s push adds is falling, not resting, and without this it would freeze in mid-air. 0.5 by default, half a step’s push; near 1 keeps nothing awake. Clamped to 0 to 1.
RestHoldDelay →
float · How long a supported point must rest, in seconds, before UseRestHold holds it. 0.05 by default. Rounded to whole steps, at least 2, so a bounce’s apex is never held, and at most 8,191; below 0 counts as 0, and so as 2 steps.
RestHoldWakeFraction →
float · What it takes to move a held point. A pull, by a thread or a contact, frees it when it moves the point further in one step than this fraction of the rest distance at 120 Hz, RestSpeedThreshold ÷ 120: a wake distance of 0.25 mm at the defaults. A push, from the wind or down a slope past static friction, is ignored up to the same fraction of RestSpeedThreshold per 1/120 s: 3.6 m/s² at the defaults. Both hold at any step rate. Lower wakes sooner; higher lets more push go unanswered, and a collider sinks that far into held cloth before it yields. 0.5 by default. Clamped to 0 to 1.
RestLength →
float · The spacing between neighboring points, in meters. 0 by default: always set it; 0.03 to 0.06 is typical. Read at Rebuild, which throws InvalidOperationException for a spacing that isn’t finite and positive: the pins’ reach, the rest angles and the cuts are all measured in it, so the live sheet keeps the spacing it was built with, which RestLength reports. A FabricEffect driven without a Fabric takes it at every Apply.
RestSpeedThreshold →
float · The rest deadband, in meters per second: below this speed a point’s carried motion is discarded as solver noise. Unless it persists on a point touching nothing: motion whose average over the last 1/15 s is over a quarter of this is a slow swing, not noise, and is kept, while a point touching something is stopped, as friction would stop it. Higher settles sooner, but ignores gentler nudges. 0.06 by default; below 0 counts as 0. Needs UseRestThreshold.
SeedRipple →
float · A starting waviness, as a fraction of RestLength: it breaks the tie over which way a flat sheet buckles. Raise it for a sheet dropped flat. 0.05 by default. Clamped to 0 to MaxSeedRipple. The spacing in the sheet’s plane shrinks to pay for the wave’s steepest rise, so wavy cloth is narrower, not stretched: BuiltWidth and BuiltHeight give its size. Read at Rebuild, which throws InvalidOperationException for one that isn’t finite.
SelfCollisionFriction →
float · The grip between layers of cloth that touch, apart from ColliderFriction. A fraction per 1/120 s, that is per step at the default SolverFrequencyHz, rescaled to any other step rate so the cloth behaves the same. 0 lets heaps spread flatter than real cloth. Unscaled, it also sets the static friction that holds resting cloth on cloth, see UseRestHold: a coefficient of f / (1 − f) for a setting of f, as for ColliderFriction. 0.35 by default. Clamped to 0 to 1.
SelfCollisionStiffness →
float · The share of an overlap between two layers pushed apart per round. Lower helps a deep pile settle. 1 by default. Clamped to 0 to 1.
SelfCollisionThickness →
float · Read-only. SelfCollisionThicknessRatio in meters: the ratio, at least 0.05, × RestLength. From these settings’ RestLength, which can run ahead of the built sheet until the next Rebuild: the solver uses the spacing the sheet was built with, and so should Run.
SelfCollisionThicknessRatio →
float · The cloth’s thickness, as a fraction of RestLength: how close two layers may get. 0.75 by default; 0.05 to 0.9, and below 0.05 counts as 0.05. Heaps want about 0.85, and past 0.9 the sheet inflates itself. Raising it raises MinimumCompressionSlackForContacts: raise CompressionSlack with it, to half of it.
ShearingRestLength →
float · Read-only. The diagonal spacing, RestLength × √2: the rest length of the shearing threads.
SolverFrequencyHz →
float · Steps per second. Fixed, so the cloth behaves the same at any frame rate: higher is steadier and costlier. The rates per 1/120 s, and the motion carried from step to step, are rescaled to it, so changing it, even on a running sheet, changes the cost and the stability, not how the cloth moves. 120 by default; 120 to 240 is typical. The step it takes is held to 0.0001 to 0.25 s, see TimeStep. Throws ArgumentException at the next upload for one that isn’t finite and positive.
SphereColliderCenter →
Vector3 · The sphere’s center, in world space. (0, 0, 0) by default. Set it every frame to move the sphere: it is uploaded with the other settings.
SphereColliderRadius →
float · The sphere’s radius, in meters. 1 by default; below 0 counts as 0.
Stiffness →
float · The share of a thread’s stretch removed per round: 1 is crisp, lower is springy. 0.9 by default; 0.8 to 1 suits cloth. Clamped to 0 to 1.
TimeStep →
float · Read-only. The step the solver takes, in seconds: 1 ÷ SolverFrequencyHz, held to 0.0001 to 0.25 s, so the frequency is in effect held to 4 to 10,000 Hz.
UseAerodynamicPressure →
bool · Couples the whole sheet through the air it pushes, so sails and parachutes billow rather than only flutter: air under the middle of a sheet has further to escape than air at its rim, which drag on each point alone can’t see. Added mass, split into ever-coarser bands, see AddedMassCoefficient. Costs a few passes a step. false by default. Supports sheets up to 4,096 points along their longer side: Rebuild and Apply throw InvalidOperationException beyond that. The pressure doesn’t see holes: a torn sail catches as much air as a whole one.
UseBendingConstraints →
bool · Whether folding is resisted, not only stretching: each fold between two triangles keeps to its rest angle, softly, at BendingStiffness. Off, the cloth folds freely at every thread. true by default.
UseGroundCollider →
bool · A level floor, at GroundColliderHeight, for the cloth to land and pile on. true by default.
UseLongRangeAttachments →
bool · Holds every point within reach of its pin, measured along the weave, so a large, heavily loaded sheet doesn’t stretch like rubber below its pins: the relaxation rounds alone pass a pin’s hold down the sheet one thread at a time. No effect when nothing is pinned. true by default.
UseRestHold →
bool · Holds settled cloth exactly still, as friction does: without it, a pile creeps and twitches forever. A point that has rested for RestHoldDelay and is supported, touching the ground, the sphere or other cloth, or joined by a thread to a held point, is held: it ignores a push under RestHoldWakeFraction, and a move that small at the end of a step snaps back to where the step began. A resting point that something carries gets no push into its carrier, and static friction holds what lies within its cone, of coefficient f / (1 − f) for the carrier’s friction setting f; what is left past that drives the point, which then slides rather than creeps. A hanging sheet touches nothing and is never held. Needs UseRestThreshold. true by default. SampleHeldFraction says how much of the sheet is held.
UseRestThreshold →
bool · The rest deadband: lets nearly still cloth settle instead of jittering on solver noise, which Verlet integration would otherwise carry on as motion. See RestSpeedThreshold. true by default. UseRestHold needs it.
UseSelfCollision →
bool · Stops the cloth passing through itself: the points are filed in a spatial hash every step, each gathers its partners once, and the contact rounds push apart the ones closer than SelfCollisionThickness. The most expensive option. true by default.
UseShearingConstraints →
bool · Diagonal threads across every square, so the weave can’t shear out of square. true by default. The pins’ reach is measured through them too, so a change is followed by measuring it again before the next step.
UseSphereCollider →
bool · A sphere the cloth can’t pass through, at SphereColliderCenter with SphereColliderRadius. false by default.
WidthInParticles →
int · Points across. 0 by default: always set it, to at least 2. Read at Rebuild, which throws InvalidOperationException for less than 2; WidthInParticles reports the sheet as built.
Wind →
Vector3 · The air’s velocity, in meters per second, in world space: not a force, since drag acts on the cloth’s motion relative to it. Still air, (0, 0, 0), by default. Uploaded at every update, so set it every frame for gusts, from any formula you like. The same over the whole sheet, unless a FABRIC_WIND_AT wind function varies it in space, where it is in scope as Wind.
Fields
EveryRound →
int · Constant, 0. What BendingIterations and ContactIterations take to mean every round of RelaxationIterations; for RelaxationIterations itself, 0 means none. Named so a line of code says which it means.
MaxSeedRipple →
float · Constant, 0.5. The largest SeedRipple. At this much wave the flatter rows start up to 6 % short of their rest length, which costs nothing: threads only resist shortening past CompressionSlack.