FABRIK inverse kinematics
Heuristic IK solver that moves joints along lines (backward from the target, forward from the root) instead of rotating angles, converging fast with natural motion.
Also known as Forward And Backward Reaching Inverse Kinematics
In the family Simulation & animation, inverse kinematics
Where it runs
Built inOfficial add-onPluginNone foundNot researched
| Engine | Support | How |
|---|---|---|
| three.js r187 | None found | |
| Babylon.js 9.38.0 | None found | |
| Godot 4.7 | Built in | Add FABRIK3D (IKModifier3D) under a Skeleton3D docs Legacy SkeletonIK3D also solves with FABRIK. |
| Unity | Official add-on | Package Manager > Animation Rigging > Chain IK Constraint docs Official Animation Rigging package. |
| Unreal 5.7 | Built in | Animation Blueprint > FABRIK node or Control Rig > Multi FABRIK (RigUnit_MultiFABRIK) docs |
| Blender 5.2 | None found | |
| WebGPU W3C | None found | |
| Metal | None found |
How it works
Treat the chain as points. The backward pass places the end effector on the target and, moving toward the root, positions each joint on the line from the next joint at its original bone-length distance. The forward pass then fixes the root back at its base and repeats outward. Iterating the two passes converges in a few iterations. If the target is unreachable the chain simply stretches in a line towards it. Joint limits are applied by clamping or re-projecting directions after each placement. Branched chains (fingers, spines with arms) are handled by solving sub-chains and averaging at the junction.
When to choose it
Reach for it when
- feet or hands need to reach a target naturally
- tentacles and tails should follow a moving point
- jacobian ik is unstable or too complex to implement
- procedural spider legs must plant on terrain
Choose it for foot placement, hands reaching, tentacles, tails and procedural spiders where robustness and simplicity beat exact joint control. Prefer analytic two-bone IK for arms and legs when you need exact elbow/knee control, Jacobian-based IK for tight constraints, and Motion matching or authored animation when the pose quality matters more than reaching accuracy.
Field marks
- Joint-limit handling is approximate and can oscillate
- No natural twist control: needs a pole/up vector added separately
- Ambiguous solutions flip between frames without a bias towards the previous pose
- Multi-chain solutions with end effectors in conflict converge unpredictably
Presets
FABRIK on a 5-joint chain: pose after 1 vs 6 backward/forward sweeps
{
"J": 5,
"ITER": 6,
"SEG": 0.2
}Show GLSL (40 lines)
// FABRIK on a 5-joint chain: orange = pose after 1 iteration, white = after 6; target moves with time.
const int J = 5;
const int ITER = 6;
const float SEG = 0.2;
float segd(vec2 p, vec2 a, vec2 b) {
vec2 pa = p - a, ba = b - a;
return length(pa - ba * clamp(dot(pa, ba) / dot(ba, ba), 0.0, 1.0));
}
void solve(inout vec2 p[J], vec2 base, vec2 tgt, int iters) {
for (int it = 0; it < ITER; it++) {
if (it >= iters) break;
p[J - 1] = tgt;
for (int i = J - 2; i >= 0; i--) p[i] = p[i + 1] + normalize(p[i] - p[i + 1]) * SEG;
p[0] = base;
for (int i = 1; i < J; i++) p[i] = p[i - 1] + normalize(p[i] - p[i - 1]) * SEG;
}
}
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = fragCoord / iResolution.xy;
vec2 base = vec2(0.5, 0.12);
vec2 tgt = vec2(0.5 + 0.34 * cos(iTime * 1.3), 0.45 + 0.25 * sin(iTime * 1.3 + 0.5));
vec2 a[J], b[J];
for (int i = 0; i < J; i++) { a[i] = base + vec2(0.04 * float(i), SEG * float(i)); b[i] = a[i]; }
solve(a, base, tgt, 1);
solve(b, base, tgt, ITER);
vec3 col = mix(vec3(0.05, 0.06, 0.09), vec3(0.1, 0.12, 0.17), uv.y);
float reach = SEG * float(J - 1);
col = mix(col, vec3(0.2, 0.25, 0.35), smoothstep(0.004, 0.0, abs(length(uv - base) - reach)) * 0.6);
float da = 1e9, db = 1e9, jd = 1e9;
for (int i = 0; i < J - 1; i++) { da = min(da, segd(uv, a[i], a[i + 1])); db = min(db, segd(uv, b[i], b[i + 1])); }
for (int i = 0; i < J; i++) jd = min(jd, length(uv - b[i]));
col = mix(col, vec3(1.0, 0.55, 0.2), smoothstep(0.008, 0.005, da) * 0.8);
col = mix(col, vec3(0.95), smoothstep(0.012, 0.009, db));
col = mix(col, vec3(0.2, 0.5, 1.0), smoothstep(0.02, 0.016, jd));
float tg = length(uv - tgt);
col = mix(col, vec3(0.3, 1.0, 0.4), smoothstep(0.004, 0.0, abs(tg - 0.025)) + smoothstep(0.01, 0.007, tg));
col = mix(col, vec3(1.0, 0.9, 0.3), smoothstep(0.022, 0.018, length(uv - base)));
fragColor = vec4(pow(col, vec3(0.8)), 1.0);
}
Attribution: written for this index
Measured GPU weight & timing
| Preset | GPU | Weight / p50 / p95 | Method |
|---|---|---|---|
| fabrik-ik-specimen | Tesla T4 1920x1080 | 11.0× baseline (moderate) · 0.362 ms / 0.369 ms | opengl-timer-query · 40 frames · GPU Weight Atlas · Colab T4 sweep |
| fabrik-ik-specimen | NVIDIA L4 1920x1080 | 8.73× baseline (moderate) · 0.139 ms / 0.142 ms · 2.6× faster on L4 | opengl-timer-query · Cross-architecture validation |
| fabrik-ik-specimen | NVIDIA A100-SXM4-40GB 1920x1080 | 7.58× baseline (moderate) · 0.218 ms / 0.218 ms · 1.7× faster on A100 | opengl-timer-query · Cross-architecture validation |
Sources
- primaryAndreas Aristidou, Joan Lasenby (2011). FABRIK: A fast, iterative solver for the Inverse Kinematics problem. Graphical Models.Verified via crossref · 2026-11-29doi:10.1016/j.gmod.2011.05.003
- tutorialAndreas Aristidou. FABRIK - Forward And Backward Reaching Inverse Kinematics. andreasaristidou.com.Verified via live page · 2026-11-29