./jerome{m}jack in

~/Notes/Vertex Animation Without Bones - ULodMesh.md · note · budding · 4 min · updated

Vertex Animation Without Bones: ULodMesh

// status: budding

Almost every 3D character you see today is driven by a skeleton: a hierarchy of bone matrices uploaded to a vertex shader, skinning a single static rest mesh on the GPU. Unreal Engine 1 shipped in 1998 — before programmable vertex shaders existed, and when CPU cache was measured in kilobytes. Neither Unreal nor Deus Ex uses skeletal skinning for characters.

Instead, every NPC, weapon, security bot, and pigeon in Deus Ex is a ULodMesh: pure per-frame vertex animation (a complete snapshot of every vertex stored for every keyframe), compressed into integer coordinates, posed on the CPU by ULodMesh::GetFrame, and simplified on the fly by a progressive edge-collapse table.

lodmesh · liveDrag to orbit the live animated ULodMesh. Scrub the progressive edge-collapse LOD slider and LODMorph, switch between standard UE1 32-bit 11-11-10 bit-packed vertices and Deus Ex's 64-bit int16 HIGH_PRECISION_MODELS format, and hover any vertex to inspect its live 32-bit bit layout.open ↗

Storing whole keyframes in 32 bits (and why Deus Ex doubled it)

Storing three 32-bit floats per vertex per frame across hundreds of animation frames would have blown past 1998 RAM budgets immediately. Standard Unreal Engine 1 solved this by packing an entire 3D vertex (X, Y, Z) into a single 32-bit FMeshVert word using signed 11-11-10 bitfields:

text
bits  0..10  (11 bits, signed): X in [-1024, +1023]
bits 11..21  (11 bits, signed): Y in [-1024, +1023]
bits 22..31  (10 bits, signed): Z in [ -512,  +511]

Unpacking takes three shifts and an arithmetic sign-extension, followed by multiplying by the mesh's per-axis Scale and shifting by Origin. That compression cuts vertex storage by 3× compared to float3, at a famous late-90s visual cost: vertex quantization wobble. Slow breathing or idle animations snap between discrete integer grid steps — especially along the 10-bit Z axis (half the resolution of X and Y!).

When Ion Storm Austin licensed Unreal Engine 1 for Deus Ex, close-up RPG conversations made 10-bit facial wobble unbearable. So Ion Storm compiled Engine.dll with HIGH_PRECISION_MODELS enabled: FMeshVert grew from 4 bytes (11-11-10) to 8 bytes — three signed 16-bit integers (i16, i16, i16) plus 2 bytes of padding ([-32768, +32767] on every axis, 32× finer on X/Y and 64× finer on Z). Toggle between UE1 11-11-10 (32-bit) and Deus Ex i16×3 (64-bit) in the viewer above — especially while zoomed in — and you can immediately see why Ion Storm spent the extra four bytes per vertex.

Posing without a skeleton: tweens and four additive layers

At draw time, ULodMesh::GetFrame (Engine.dll 0x10355360) turns integer keyframes into camera-space points in three steps:

  1. Keyframe interpolation: Given AnimFrame between frames k and k+1 with fraction t \in [0, 1), each vertex linearly interpolates a + (b - a) * t (all in PC 24 binary32 arithmetic inside the render pass!).
  2. Transition tweening: When an NPC switches from Walk to Salute, AnimFrame starts negative and counts toward zero. Instead of snapping, GetFrame pulls the previous pose out of GCache and interpolates from the cached pose toward frame 0 of the new sequence.
  3. Four additive blend slots: Deus Ex extended Unreal's base pose with four concurrent blend animations (e.g., breathing + head turn + injured limp + talking mouth). For each active blend slot, GetFrame computes (blend_pose - frame_0) in local space, transforms that delta vector, and adds it straight onto the posed vertices — layered animation with zero bone matrices.

Progressive edge collapse (CollapsePointThus)

Even after vertex compression, rendering a 600-triangle guard standing 100 metres away across Liberty Island wasted precious Pentium II transform cycles. Rather than authoring three separate static LOD meshes by hand, ULodMesh stores a continuous progressive mesh.

At import time, the mesh compiler sorts vertices in order of visual importance and records a single 16-bit array, CollapsePointThus[v], which names the surviving neighbour vertex that vertex v collapses into whenever the active vertex budget drops below v.

At runtime, URender::DrawLodMesh (Render.dll 0x10b0ea80) computes a requested vertex count N_{\text{req}} from the actor's distance, screen FOV (appTan), and LODStrength:

  • Every vertex with index v \ge N_{\text{req}} redirects repeatedly through v = CollapsePointThus[v] until v < N_{\text{req}}.
  • Any triangle whose three remapped corners end up with two identical vertices becomes degenerate and is simply skipped!
  • Even better, GetFrame only poses the first N_{\text{req}} vertices — saving CPU work before lighting and rasterization ever start.
  • Optional LODMorph smoothly slides vertices near the collapse frontier toward their target CollapsePointThus[v] so distant characters shrink seamlessly instead of visibly popping.

Notice the subtle engineering win: every vertex collapse shares the exact same keyframe array and animation code. Whether a guard is rendered at 100% detail up close or collapsed down to 25% of his triangles across the docks, he keeps walking, aiming, and blinking without a single extra asset.


Part of the Deus Ex in the Browser notes · see 80-bit Ghosts · BSP Occlusion & Span Buffers · Analytic Volumetric Fog · back to Notes.