---
id: "matcap-shading"
title: "MatCap (lit sphere) shading"
aliases: [material capture, lit sphere, litsphere, MatCap]
domain: "npr"
stage: "material"
realtime: "realtime"
platforms: [webgl2, webgpu, desktop-gpu, mobile-gpu, blender, unity, godot]
year_introduced: 2001
inputs: [normals, texture]
outputs: [ldr-image]
style: "stylized"
dynamic: "both"
cost: "cheap"
authority: "Foundation"
url: "https://texelatlas.vercel.app/t/matcap-shading/"
sources_verified_at: "2026-11-29"
---
# MatCap (lit sphere) shading (Foundation)

> Colour each pixel by looking up the view-space normal in a single image of a lit sphere. Material, lighting and reflections are baked into the image, so shading is one texture fetch with no lights.

## Reach for it when

- want shading without any lights in the scene
- need a quick clay or sculpt viewport look
- artist wants to paint the lighting on a sphere
- cheap stylized material for mobile with one texture fetch

## How it works

The lit-sphere idea is that a picture of a sphere with the desired material under the desired lighting encodes a shading function of the normal. For a pixel with view-space normal `n`, take `uv = n.xy * 0.5 + 0.5` and fetch the picture; the sphere's centre corresponds to normals facing the camera and its rim to grazing normals.

Because the lookup uses view-space normals, the light follows the camera and the object appears to be lit the same way as it rotates, which is exactly what sculpting tools want. Artists can paint any material by painting a sphere, from clay and chrome to toon ramps and painted metal, and get a complete shader.

Normal maps and displacement work naturally because only the normal is used. Fixes people apply include correcting UVs near the rim to avoid texel stretching, using a per-vertex view-space normal rotated by the camera roll, and combining the matcap with an albedo texture by multiply or overlay.

## When to use it

Choose it for sculpting viewports, stylised previews, prototypes and non-photoreal looks where artists paint the lighting, and for cheap shading on mobile.

Prefer [toon-shading](toon-shading) or [gooch-shading](gooch-shading) when the look must respond to scene lights and cast shadows. Prefer [split-sum-ibl](split-sum-ibl) or full [cook-torrance-brdf](cook-torrance-brdf) lighting for physically consistent materials. Prefer [environment-mapping-cubemaps](environment-mapping-cubemaps) when reflections should depend on the view direction and the world, not just the camera space.

## Cost

cheap — A normal transform and one texture fetch per pixel; no lights, no shadows.
Measured GPU Weight: 1.3× baseline (feather) — 0.0427 ms median / 0.043 ms p95 on Tesla T4/PCIe/SSE2 @ 1920x1080 (opengl-timer-query).
Ada L4 scaling: 1.12× baseline (feather) — 0.0178 ms median (2.4× faster on L4).
Ampere A100 scaling: 1× baseline (feather) — 0.0288 ms median (1.48× faster on A100).

## Failure modes

- Lighting is locked to the camera; rotating the view changes nothing about the highlight position, which breaks the illusion in scenes with several objects
- No shadows, no occlusion and no inter-object reflection, so objects look pasted together
- Texel stretching and pinching near the sphere's rim where the normal is almost perpendicular to the view
- View-space normals under strong perspective give different shading for the same surface orientation across the frame
- Hard to match two matcaps for continuity between meshes, since the sphere image is the entire lighting model
- Backfacing or flipped normals fetch from the wrong side of the sphere and shade as dark blobs

## Engine support

- blender: builtin — `Viewport Shading (Workbench) > Lighting = MatCap` (evidence: https://docs.blender.org/manual/en/5.2/render/workbench/lighting.html, checked 2026-12-01)
- threejs: builtin — `new THREE.MeshMatcapMaterial({ matcap })` (evidence: https://github.com/mrdoob/three.js/blob/r187/src/materials/MeshMatcapMaterial.js, checked 2026-12-01)

## Dataflow

- Inputs: normals, texture
- Outputs: ldr-image
- Platforms: webgl2, webgpu, desktop-gpu, mobile-gpu, blender, unity, godot

## Presets

### Procedural matcap on a wobbling blob (glsl-fragment; rendered 2026-11-29)

```json
{
  "key_light": [
    -0.4,
    0.5,
    0.8
  ],
  "rim_strength": 0.4
}
```

```glsl
// MatCap: shading is a pure function of the view-space normal; here the "lit sphere image" is procedural.
vec3 matcap(vec2 n) {
  float d = length(n);
  vec3 base = mix(vec3(0.18, 0.2, 0.3), vec3(0.85, 0.62, 0.5), 0.5 + 0.5 * n.y);
  base *= 0.35 + 0.65 * clamp(dot(vec3(n, sqrt(max(1.0 - d * d, 0.0))), normalize(vec3(-0.4, 0.5, 0.8))), 0.0, 1.0);
  float spec = exp(-dot(n - vec2(-0.3, 0.4), n - vec2(-0.3, 0.4)) * 25.0);
  float rim = pow(d, 4.0) * 0.4;
  return base + vec3(spec) * 0.9 + vec3(0.4, 0.55, 0.9) * rim;
}
float h(vec2 p) { return sin(p.x * 6.0 + iTime) * sin(p.y * 5.0 - iTime * 0.7) * 0.06 + sin(p.x * 17.0) * sin(p.y * 13.0) * 0.012; }
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
  vec2 p = (fragCoord - 0.5 * iResolution.xy) / (0.42 * iResolution.y);
  float r2 = dot(p, p);
  vec3 col = vec3(0.1);
  if (r2 < 1.0) {
    vec3 n = vec3(p, sqrt(1.0 - r2));
    vec2 e = vec2(0.002, 0.0);
    vec3 b = vec3(-(h(p + e.xy) - h(p - e.xy)) / (2.0 * e.x), -(h(p + e.yx) - h(p - e.yx)) / (2.0 * e.x), 0.0);
    n = normalize(n + b * 1.5);
    col = matcap(n.xy);
  }
  fragColor = vec4(pow(col, vec3(1.0 / 2.2)), 1.0);
}

```

Attribution: written for this index

## Combines with

- [Normal mapping with MikkTSpace](https://texelatlas.vercel.app/t/normal-mapping-mikktspace.md): Tangent-space normal maps perturb the view-space normal before the matcap lookup, adding surface detail without lights.
- [Depth/normal Sobel edge outlines](https://texelatlas.vercel.app/t/screen-space-edge-outline.md): Outline pass adds contour lines the matcap lacks, giving a complete sculpt-viewport look.
- [Toon / cel shading with lighting ramps](https://texelatlas.vercel.app/t/toon-shading.md): A banded matcap image is a cheap view-locked toon ramp.

## Sources

1. [primary] Blender Foundation Blender Workbench lighting: MatCap. docs.blender.org. https://docs.blender.org/manual/en/latest/render/workbench/lighting.html (verified via http on 2026-11-29)
2. [implementation] three.js contributors three.js MeshMatcapMaterial example. threejs.org. https://threejs.org/examples/webgl_materials_matcap.html (verified via http on 2026-11-29)

## Cite this entry

Texel. "MatCap (lit sphere) shading." https://texelatlas.vercel.app/t/matcap-shading/ (accessed 2026-12-01).
