---
id: "trellis"
title: "TRELLIS (Structured 3D Latents)"
aliases: [SLAT]
domain: "genai"
stage: "generation"
realtime: "interactive"
platforms: [cuda, python]
year_introduced: 2024
inputs: [text-prompt, ldr-image]
outputs: [gaussians, radiance-field, mesh]
style: "both"
dynamic: "static"
cost: "heavy"
authority: "Xiang et al., 2024"
url: "https://texelatlas.vercel.app/t/trellis/"
sources_verified_at: "2026-11-29"
---
# TRELLIS (Structured 3D Latents) (Xiang et al., 2024)

> Encodes an asset as features attached to active cells of a sparse voxel grid, then generates it with two rectified-flow transformers (structure, then features) and decodes to Gaussians, radiance fields or a mesh.

## Reach for it when

- generate high quality 3d assets from text or image
- need output in multiple formats like mesh or gaussians
- structured latent for 3d generation
- ai 3d models with good geometry and appearance

## How it works

A 3D asset is rendered from many views, features from a pretrained vision model are aggregated onto the voxels that intersect the surface, and a sparse VAE compresses them into a structured latent (SLAT): a list of occupied voxel positions plus a latent vector per voxel. Generation is two-stage. A first flow transformer predicts which voxels are occupied (the coarse structure); a second, sparse-aware transformer fills in the latent vector at each of those voxels. Separate decoders turn the same SLAT into 3D Gaussians, a radiance field or a mesh, so one model serves several output formats. Text or image conditioning enters through cross-attention.

## When to use it

Choose it for MIT-licensed image- or text-to-3D when you want Gaussian or mesh output with decent textures and can run a CUDA GPU with a large memory budget. Prefer [TRELLIS.2 (O-Voxel structured latents)](https://texelatlas.vercel.app/t/trellis-2.md) when you need PBR channels and arbitrary topology, [Hunyuan3D 2.1](https://texelatlas.vercel.app/t/hunyuan3d-2-1.md) for PBR-textured meshes, and [TripoSR](https://texelatlas.vercel.app/t/triposr.md) for the fastest throw-away result.

## Cost

heavy — Seconds to tens of seconds per asset on a datacentre GPU; consult the repo for hardware requirements.
Measured GPU Weight: 11.84× baseline (moderate) — 0.3896 ms median / 0.4209 ms p95 on Tesla T4/PCIe/SSE2 @ 1920x1080 (opengl-timer-query).
Ada L4 scaling: 9.57× baseline (moderate) — 0.1521 ms median (2.56× faster on L4).
Ampere A100 scaling: 7.38× baseline (moderate) — 0.2125 ms median (1.83× faster on A100).

## Failure modes

- Voxel-grid structure stage limits thin surfaces and sub-voxel detail
- Mesh decoding from the SLAT can show holes or bumpy surfaces on complex objects
- Texture is baked appearance without separate PBR maps
- Weak on scenes or multi-object layouts, which are outside the training distribution
- Heavy install: custom sparse-convolution and attention backends

## Dataflow

- Inputs: text-prompt, ldr-image
- Outputs: gaussians, radiance-field, mesh
- Platforms: cuda, python

## Presets

### TRELLIS image-to-3D, repo defaults (json-params; parameter preset)

```json
{
  "seed": 1,
  "sparse_structure_sampler_params": {
    "steps": 12,
    "cfg_strength": 7.5
  },
  "slat_sampler_params": {
    "steps": 12,
    "cfg_strength": 3
  },
  "glb_simplify": 0.95,
  "glb_texture_size": 1024
}
```

Attribution: Values taken from the example script in microsoft/TRELLIS (MIT licence).; basis: 2

### TRELLIS (SLAT) — sparse active surface voxel latents (left) vs decoded 3D asset (right) (glsl-fragment; rendered 2026-11-30)

```json
{
  "P_VOXEL_RES": 12,
  "P_LATENT_GLOW": 0.95,
  "P_ROT_SPEED": 0.58,
  "P_SPLIT": 0.48
}
```

```glsl
const float P_VOXEL_RES = 12.0; // P Sparse Grid Res [6.0, 20.0, 1.0]
const float P_LATENT_GLOW = 0.95; // P SLAT Feature Glow [0.1, 1.6, 0.05]
const float P_ROT_SPEED = 0.58; // P Orbit Speed [0.0, 2.2, 0.05]
const float P_SPLIT = 0.48; // P SLAT / Decoded [0.0, 1.0, 0.02]

mat2 rot2(float a) { float c = cos(a), s = sin(a); return mat2(c, -s, s, c); }

// Sculpted intertwined double-arch / knot object
float mapTarget(vec3 q) {
  float t1 = length(vec2(length(q.xz) - 0.46, q.y)) - 0.20;
  float t2 = length(vec2(length(q.xy) - 0.46, q.z)) - 0.18;
  float h = clamp(0.5 + 0.5 * (t2 - t1) / 0.14, 0.0, 1.0);
  return (mix(t2, t1, h) - 0.14 * h * (1.0 - h)) * 0.85;
}

vec3 calcNormal(vec3 q) {
  vec2 e = vec2(0.0025, 0.0);
  return normalize(vec3(
    mapTarget(q + e.xyy) - mapTarget(q - e.xyy),
    mapTarget(q + e.yxy) - mapTarget(q - e.yxy),
    mapTarget(q + e.yyx) - mapTarget(q - e.yyx)
  ));
}

// Sparse voxel box distance around active surface voxels (TRELLIS SLAT)
float mapSparseVoxels(vec3 q, float voxRes, out vec3 cellId) {
  float s = 1.0 / voxRes;
  cellId = floor(q * voxRes + 0.5);
  vec3 vc = cellId * s;
  float dCenter = mapTarget(vc);
  if (abs(dCenter) < s * 0.82) {
    vec3 local = abs(q - vc) - vec3(s * 0.44);
    return length(max(local, 0.0)) + min(max(local.x, max(local.y, local.z)), 0.0);
  }
  return max(abs(dCenter) - s * 0.72, s * 0.35);
}

vec3 aces(vec3 x) {
  x = max(x, 0.0);
  return (x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14);
}

void mainImage(out vec4 fragColor, in vec2 fragCoord) {
  vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;
  float screenX = fragCoord.x / max(iResolution.x, 1.0);
  float split = clamp(P_SPLIT, 0.0, 1.0);
  float voxRes = clamp(floor(P_VOXEL_RES + 0.5), 6.0, 22.0);
  float glow = clamp(P_LATENT_GLOW, 0.05, 1.8);
  float spin = iTime * max(P_ROT_SPEED, 0.0) * 0.52;

  vec3 ro = vec3(0.0, 0.16, 2.35);
  vec3 rd = normalize(vec3(uv - vec2(0.0, 0.03), -1.55));
  ro.xz = rot2(spin) * ro.xz;
  rd.xz = rot2(spin) * rd.xz;
  ro.yz = rot2(0.28) * ro.yz;
  rd.yz = rot2(0.28) * rd.yz;

  vec3 col = mix(vec3(0.020, 0.028, 0.048), vec3(0.056, 0.076, 0.124), smoothstep(-0.55, 0.55, uv.y));
  vec3 lDir = normalize(vec3(0.55, 0.82, 0.48));

  if (screenX < split) {
    // Left: Sparse active 3D voxel shell (SLAT) colored by latent feature embeddings
    float t = 0.0;
    bool hit = false;
    vec3 cid = vec3(0.0);
    for (int i = 0; i < 64; i++) {
      float d = mapSparseVoxels(ro + rd * t, voxRes, cid);
      if (d < 0.003) { hit = true; break; }
      t += max(d * 0.72, 0.008);
      if (t > 5.0) break;
    }
    if (hit) {
      vec3 p = ro + rd * t;
      vec3 vc = cid / voxRes;
      vec3 local = (p - vc) * voxRes;
      vec3 an = abs(local);
      vec3 fn = (an.x > an.y && an.x > an.z) ? vec3(sign(local.x), 0.0, 0.0)
              : (an.y > an.z ? vec3(0.0, sign(local.y), 0.0) : vec3(0.0, 0.0, sign(local.z)));
      float diff = max(dot(fn, lDir), 0.0);
      // Latent feature RGB vector attached to each active voxel
      vec3 featCol = 0.5 + 0.5 * sin(cid * vec3(0.55, 0.72, 0.48) + vec3(0.0, 2.1, 4.2));
      float edge = smoothstep(0.36, 0.43, max(an.x, max(an.y, an.z)));
      col = featCol * (0.32 + 0.75 * diff) * (0.75 + 0.35 * glow) + vec3(0.95) * edge * 0.28;
    }
  } else {
    // Right: Decoded high-resolution smooth 3D PBR asset
    float t = 0.0;
    bool hit = false;
    for (int i = 0; i < 56; i++) {
      float d = mapTarget(ro + rd * t);
      if (d < 0.0025) { hit = true; break; }
      t += d;
      if (t > 5.0) break;
    }
    if (hit) {
      vec3 p = ro + rd * t;
      vec3 n = calcNormal(p);
      float diff = max(dot(n, lDir), 0.0);
      float spec = pow(max(dot(n, normalize(lDir - rd)), 0.0), 48.0);
      float fres = pow(1.0 - max(dot(n, -rd), 0.0), 3.0);
      vec3 alb = mix(vec3(0.14, 0.68, 0.86), vec3(0.96, 0.48, 0.24), smoothstep(-0.45, 0.45, p.y));
      col = alb * (0.28 + 0.82 * diff) + vec3(1.0, 0.96, 0.90) * spec * 0.52 + vec3(0.28, 0.88, 0.98) * fres * 0.38;
    }
  }

  float sep = smoothstep(0.0035, 0.0008, abs(screenX - split));
  col = mix(col, vec3(0.95, 0.97, 1.0), sep);

  fragColor = vec4(pow(clamp(aces(col), 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);
}
```

Attribution: MIT — written for this index.

## Lineage

- extended by [TRELLIS.2 (O-Voxel structured latents)](https://texelatlas.vercel.app/t/trellis-2.md)

## Combines with

- [Hunyuan3D-Paint](https://texelatlas.vercel.app/t/hunyuan3d-paint.md): TRELLIS produces a mesh; a separate texturing model can re-paint it with PBR-ready maps.

## Sources

1. [primary] Jianfeng Xiang, Zelong Lv, Sicheng Xu, Yu Deng, Ruicheng Wang, Bowen Zhang, Dong Chen, Xin Tong, Jiaolong Yang (2024) Structured 3D Latents for Scalable and Versatile 3D Generation. arXiv preprint (cs.CV). https://arxiv.org/abs/2412.01506 (verified via arxiv on 2026-11-29)
2. [primary] Jianfeng Xiang, Zelong Lv, Sicheng Xu, Yu Deng, Ruicheng Wang, Bowen Zhang, Dong Chen, Xin Tong, Jiaolong Yang (2025) Structured 3D Latents for Scalable and Versatile 3D Generation. 2025 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). https://doi.org/10.1109/cvpr52734.2025.02000 (verified via crossref on 2026-11-29)
3. [implementation] microsoft (2024) microsoft/TRELLIS. https://github.com/microsoft/TRELLIS License: MIT. (verified via github on 2026-11-29)

## Cite this entry

Texel. "TRELLIS (Structured 3D Latents)." https://texelatlas.vercel.app/t/trellis/ (accessed 2026-12-01).
