Geometry VRAM: quantized vertex format (48 B to ~20 B) + 16-bit indices #573

Closed
opened 2026-10-09 00:13:08 +00:00 by sky_line · 0 comments
Owner

A user reported VRAM pressure on the latest build, with geometry as the largest category.

How geometry is stored today

  • Vertices are 48 B each: fp32 pos3, uv2, normal3, tangent4 (MirrorVertex / DrawVertex).
  • Indices are 32-bit (VK_INDEX_TYPE_UINT32).
  • All four LODs of every face stay resident.
  • Rigged weights add 16 B per vertex.
  • The same layout is kept as a CPU mirror in RAM.

Part 1: quantized vertex format (48 B to ~20 B)

  • Position: 16-bit unorm per axis, relative to a per-mesh/per-slot AABB. SL mesh assets are already 16-bit quantized within their bbox, so this is lossless for mesh.
  • UV: 16-bit per channel, with a per-slot range. Mesh assets are already stored 16-bit.
  • Normal and tangent: octahedral encoding, plus the handedness bit.
  • Decode: the shader unpacks using a per-slot scale/offset. Every consumer must be converted: draw, shadow, RT, pre-skin, pick, probe capture, etc.

Part 2: 16-bit indices

  • An SL face has at most 65,535 vertices, and draws already use a per-face vertexOffset, so every face-local index fits in u16. One index type keeps the single IBO bind.

Later (not in this ticket)

  • LOD residency streaming.
  • Prim dedupe.
  • 8 B rigged weights.
  • RT BLAS from lower LODs.

Measure

Compare the VRAM breakdown categories (geom, plus RT and pre-skin if affected) before and after, in the same busy scene.

A user reported VRAM pressure on the latest build, with geometry as the largest category. ## How geometry is stored today - Vertices are 48 B each: fp32 pos3, uv2, normal3, tangent4 (`MirrorVertex` / `DrawVertex`). - Indices are 32-bit (`VK_INDEX_TYPE_UINT32`). - All four LODs of every face stay resident. - Rigged weights add 16 B per vertex. - The same layout is kept as a CPU mirror in RAM. ## Part 1: quantized vertex format (48 B to ~20 B) - **Position:** 16-bit unorm per axis, relative to a per-mesh/per-slot AABB. SL mesh assets are already 16-bit quantized within their bbox, so this is lossless for mesh. - **UV:** 16-bit per channel, with a per-slot range. Mesh assets are already stored 16-bit. - **Normal and tangent:** octahedral encoding, plus the handedness bit. - **Decode:** the shader unpacks using a per-slot scale/offset. Every consumer must be converted: draw, shadow, RT, pre-skin, pick, probe capture, etc. ## Part 2: 16-bit indices - An SL face has at most 65,535 vertices, and draws already use a per-face vertexOffset, so every face-local index fits in u16. One index type keeps the single IBO bind. ## Later (not in this ticket) - LOD residency streaming. - Prim dedupe. - 8 B rigged weights. - RT BLAS from lower LODs. ## Measure Compare the VRAM breakdown categories (geom, plus RT and pre-skin if affected) before and after, in the same busy scene.
sky_line added this to the Slipstream project 2026-10-09 00:13:08 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sky_line/Slipstream#573
No description provided.