---
id: "guilty-gear-xrd-shading"
title: "Guilty Gear Xrd anime-style 3D shading"
domain: "npr"
stage: "lighting"
realtime: "realtime"
platforms: [desktop-gpu, unreal]
year_introduced: 2014
inputs: [mesh, normals, texture]
outputs: [ldr-image]
style: "stylized"
dynamic: "dynamic"
cost: "cheap"
authority: "Motomura"
url: "https://texelatlas.vercel.app/t/guilty-gear-xrd-shading/"
sources_verified_at: "2026-11-29"
---
# Guilty Gear Xrd anime-style 3D shading (Motomura)

> A production recipe that makes 3D characters look hand-drawn through artist-edited normals and vertex data, a threshold texture on shading, and custom outlines, animated at a lowered frame rate.

## Reach for it when

- anime characters look flat in 3d toon shading
- shadow edges on toon faces look ugly and noisy
- make 3d model look like hand drawn 2d animation
- artist control over shadow shapes on cel shaded characters

## How it works

Characters are rendered with a simple toon shader whose light term is thresholded, but the key is how it is controlled: artists edit vertex normals so shadow terminators fall in drawn-looking shapes; a vertex-colour channel biases the threshold per area, and a texture channel adds ink-style lines inside the surface. Outlines combine inverted-hull shells with vertex-colour-driven thickness, plus separate strokes for interior lines. The characters are animated on limited key poses and with hand-adjusted camera angles to mimic 2D animation. The talk lays out these choices and the workflow around them.

## When to use it

Choose it when you want hand-controllable, anime-grade stills and animation from 3D, and can afford artist time. Prefer [Toon / cel shading with lighting ramps](https://texelatlas.vercel.app/t/toon-shading.md) with a standard ramp for generic stylization, and [Ligne-claire / Moebius-style shading](https://texelatlas.vercel.app/t/ligne-claire-moebius-shading.md) when you want a sparse, European comics look.

## Cost

cheap — Cheap shading, plus a hull outline pass; the real cost is authoring.
Measured GPU Weight: 35.41× baseline (heavy) — 1.1651 ms median / 1.2162 ms p95 on Tesla T4/PCIe/SSE2 @ 1920x1080 (opengl-timer-query).
Ada L4 scaling: 31.63× baseline (heavy) — 0.5029 ms median (2.32× faster on L4).
Ampere A100 scaling: 21.81× baseline (heavy) — 0.6281 ms median (1.85× faster on A100).

## Failure modes

- Depends on heavy manual normal and vertex-data authoring per character
- Looks break when lighting changes or the model is re-posed beyond tuned ranges
- Edited normals conflict with standard skinning or LOD pipelines
- Low-framerate animation can read as stutter in a smooth game engine

## Dataflow

- Inputs: mesh, normals, texture
- Outputs: ldr-image
- Platforms: desktop-gpu, unreal

## Presets

### Guilty Gear Xrd anime 3D shading — stepped cel threshold, ink contour outlines and stylized rim (glsl-fragment; rendered 2026-11-30)

```json
{
  "SHADOW_THRESH": 0.18,
  "OUTLINE_WIDTH": 0.032,
  "RIM_STRENGTH": 0.9,
  "SPEC_CUTOFF": 0.72
}
```

```glsl
const float SHADOW_THRESH = 0.18; // P
const float OUTLINE_WIDTH = 0.032; // P
const float RIM_STRENGTH = 0.9; // P
const float SPEC_CUTOFF = 0.72; // P

float sdBox(vec3 p, vec3 b) {
  vec3 q = abs(p) - b;
  return length(max(q, 0.0)) + min(max(q.x, max(q.y, q.z)), 0.0);
}

float sdCapsule(vec3 p, vec3 a, vec3 b, float r) {
  vec3 pa = p - a, ba = b - a;
  float h = clamp(dot(pa, ba) / dot(ba, ba), 0.0, 1.0);
  return length(pa - ba * h) - r;
}

// Stylized anime mecha-knight bust with angular armor plates, visor and crest
vec2 mapHero(vec3 p) {
  // Stepped 12 fps key-pose turntable (classic Xrd limited-framerate feel)
  float tStep = floor(iTime * 12.0) / 12.0;
  float yaw = 0.42 * sin(tStep * 0.9);
  if (iMouse.z > 0.5 || length(iMouse.xy) > 1.0) {
    yaw = (iMouse.x / iResolution.x - 0.5) * 2.6;
  }
  float cy = cos(yaw), sy = sin(yaw);
  p.xz = mat2(cy, -sy, sy, cy) * p.xz;

  // 1: crimson armor crown, 2: ivory faceplate, 3: glowing cyan visor, 4: gold V-fin crest
  vec3 q = p - vec3(0.0, 0.14, 0.0);
  float helm = length(q * vec3(1.05, 0.95, 0.98)) - 0.48;
  float cheek = sdBox(vec3(abs(q.x) - 0.28, q.y + 0.14, q.z - 0.06), vec3(0.14, 0.24, 0.26)) - 0.04;
  float pauldron = sdBox(vec3(abs(p.x) - 0.56, p.y + 0.48, p.z), vec3(0.28, 0.20, 0.28)) - 0.05;
  float chest = sdBox(p - vec3(0.0, -0.56, -0.02), vec3(0.36, 0.26, 0.24)) - 0.04;
  float dRed = min(min(helm, cheek), min(pauldron, chest));

  float face = sdBox(q - vec3(0.0, -0.14, 0.28), vec3(0.20, 0.22, 0.18)) - 0.05;
  float visor = sdBox(q - vec3(0.0, 0.02, 0.37), vec3(0.26, 0.075, 0.10)) - 0.015;

  vec3 vp = vec3(abs(q.x), q.y - 0.24, q.z - 0.34);
  float fin = sdCapsule(vp, vec3(0.0, -0.05, 0.05), vec3(0.46, 0.34, -0.06), 0.042);
  float gem = sdBox(q - vec3(0.0, 0.22, 0.42), vec3(0.055, 0.075, 0.05)) - 0.01;
  float dGold = min(fin, gem);

  vec2 res = vec2(dRed, 1.0);
  if (face < res.x) res = vec2(face, 2.0);
  if (visor < res.x) res = vec2(visor, 3.0);
  if (dGold < res.x) res = vec2(dGold, 4.0);
  return res;
}

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

void mainImage(out vec4 fragColor, in vec2 fragCoord) {
  vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;
  vec3 ro = vec3(0.0, -0.02, 2.55);
  vec3 rd = normalize(vec3(uv, -1.65));

  // Speedline anime backdrop
  float ang = atan(uv.y, uv.x);
  float rays = smoothstep(0.65, 0.95, sin(ang * 24.0 + iTime * 0.4) * 0.5 + 0.5);
  vec3 bg = mix(vec3(0.11, 0.13, 0.22), vec3(0.22, 0.28, 0.46), clamp(uv.y + 0.55, 0.0, 1.0));
  bg += vec3(0.07, 0.09, 0.16) * rays * smoothstep(0.15, 0.65, length(uv));

  float t = 0.2, minD = 1e5;
  vec2 hit = vec2(-1.0);
  for (int i = 0; i < 72; i++) {
    vec2 res = mapHero(ro + rd * t);
    minD = min(minD, res.x);
    if (res.x < 0.002) { hit = vec2(t, res.y); break; }
    t += res.x * 0.85;
    if (t > 6.5) break;
  }

  float outW = max(OUTLINE_WIDTH, 0.001);
  vec3 inkCol = vec3(0.05, 0.04, 0.09);
  vec3 col = bg;

  if (hit.x > 0.0) {
    vec3 p = ro + rd * hit.x;
    vec3 n = calcNormal(p);
    vec3 v = -rd;
    vec3 L = normalize(vec3(0.68, 0.62, 0.55));
    // Stylized edited-normal bias on the faceplate for clean 2D shadow shapes
    vec3 nShade = (hit.y > 1.5 && hit.y < 2.5) ? normalize(mix(n, normalize(vec3(p.x, 0.15, 0.85)), 0.55)) : n;
    float nl = dot(nShade, L);
    float thresh = clamp(SHADOW_THRESH, -0.6, 0.85);
    float litMask = smoothstep(thresh - 0.025, thresh + 0.025, nl);

    // Saturated anime base & cool-shifted shadow palettes (never desaturated grey)
    vec3 baseC, shadC;
    if (hit.y < 1.5) { baseC = vec3(0.92, 0.20, 0.24); shadC = vec3(0.36, 0.08, 0.24); }
    else if (hit.y < 2.5) { baseC = vec3(0.97, 0.94, 0.88); shadC = vec3(0.56, 0.58, 0.76); }
    else if (hit.y < 3.5) { baseC = vec3(0.20, 0.96, 1.00); shadC = vec3(0.06, 0.45, 0.72); }
    else { baseC = vec3(1.00, 0.80, 0.20); shadC = vec3(0.62, 0.32, 0.12); }

    col = mix(shadC, baseC, litMask);

    // Crisp stepped specular band
    vec3 H = normalize(L + v);
    float spec = smoothstep(SPEC_CUTOFF - 0.02, SPEC_CUTOFF + 0.02, dot(n, H)) * litMask;
    col = mix(col, vec3(1.0, 0.98, 0.92), spec * 0.82);

    // Lit-side stylized Fresnel rim highlight
    float ndv = max(dot(n, v), 0.0);
    float rim = smoothstep(0.56, 0.62, 1.0 - ndv) * smoothstep(-0.15, 0.15, nl);
    col += vec3(0.95, 0.92, 1.0) * rim * clamp(RIM_STRENGTH, 0.0, 1.5) * 0.55;

    // Subtle manga shadow hatch lines in deep shadow
    float hatch = smoothstep(0.65, 0.85, sin((fragCoord.x + fragCoord.y) * 0.55));
    col *= 1.0 - (1.0 - litMask) * smoothstep(thresh - 0.22, thresh - 0.35, nl) * hatch * 0.28;

    // Interior crease & silhouette ink lines via normal derivative
    float edgeN = length(fwidth(n)) * 1.45;
    float sil = smoothstep(0.28, 0.14, ndv) * step(0.005, outW);
    float innerInk = smoothstep(0.42, 0.65, edgeN);
    col = mix(col, inkCol, clamp(max(sil, innerInk), 0.0, 1.0));
  } else if (minD < outW) {
    // Crisp inverted-hull-style exterior ink outline
    float outMask = smoothstep(outW, outW * 0.65, minD);
    col = mix(bg, inkCol, outMask);
  }
  fragColor = vec4(clamp(col, 0.0, 1.0), 1.0);
}
```

Attribution: MIT — written for this index

## Lineage

- extends [Inverted-hull outlines](https://texelatlas.vercel.app/t/inverted-hull-outline.md)

## Combines with

- [Inverted-hull outlines](https://texelatlas.vercel.app/t/inverted-hull-outline.md): Vertex-colour-controlled hull gives the varying line weight of the hand-drawn look.

## Sources

1. [primary] Junya Motomura Guilty Gear Xrd's Art Style: The X Factor Between 2D and 3D. GDC 2015. https://www.gdcvault.com/play/1022031/GuiltyGearXrd-s-Art-Style-The (verified via http on 2026-11-29)

## Cite this entry

Texel. "Guilty Gear Xrd anime-style 3D shading." https://texelatlas.vercel.app/t/guilty-gear-xrd-shading/ (accessed 2026-12-01).
