---
id: "pre-integrated-skin-shading"
title: "Pre-integrated skin shading"
aliases: [pre-integrated subsurface scattering, curvature-based skin LUT]
domain: "materials"
stage: "material"
realtime: "realtime"
platforms: [webgl2, webgpu, desktop-gpu, mobile-gpu, unity, unreal, godot]
year_introduced: 2011
inputs: [normals, gbuffer, texture]
outputs: [radiance]
style: "photoreal"
dynamic: "both"
cost: "cheap"
authority: "Penner"
url: "https://texelatlas.vercel.app/t/pre-integrated-skin-shading/"
sources_verified_at: "2026-11-29"
---
# Pre-integrated skin shading (Penner)

> Fakes skin subsurface scattering with a lookup texture of diffuse profiles integrated over a ring, indexed by N.L and surface curvature, so the soft terminator and red bleed appear in a single pass without screen-space blur.

## Reach for it when

- skin looks waxy or hard-edged at the terminator
- need cheap subsurface scattering for characters on mobile
- red bleed on shadow edge of faces
- cannot afford screen space blur for skin
- soft diffuse falloff depending on surface curvature

## How it works

Skin light bleeds across the terminator because light entering in the lit area scatters and leaves in the shadowed area. Penner precomputes this: for a sphere of radius r (curvature 1/r), integrate the lit diffuse falloff convolved with a skin diffusion profile around the ring, and store the result in a 2D LUT with N.L on one axis and curvature on the other. At runtime curvature comes from derivatives of the world normal over derivatives of position, or a baked map, and the LUT fetch replaces the Lambert term, giving red-tinted soft transitions on cheeks and noses. A second trick pre-integrates the shadow edge penumbra for skin in a 1D LUT. For normals, a blurred normal map is used for the diffuse and the sharp one for specular, with per-channel blurs simulating different scattering lengths (red wider than blue). Specular still uses a standard BRDF.

## When to use it

Choose it when characters need believable skin on mobile or at scale and a full-screen blur is unaffordable. Prefer [Separable subsurface scattering](https://texelatlas.vercel.app/t/separable-sss.md) when the budget allows screen-space blur and transmission (ears, thin regions). Prefer [Christensen-Burley diffusion profile](https://texelatlas.vercel.app/t/christensen-burley-sss.md) for offline or path-traced subsurface. For general materials with less critical bleeding, [Oren-Nayar rough diffuse](https://texelatlas.vercel.app/t/oren-nayar.md) or wrap lighting suffices.

## Cost

cheap — One extra LUT sample plus a curvature computation per light; no extra passes.
Measured GPU Weight: 48.19× baseline (heavy) — 1.5854 ms median / 1.6191 ms p95 on Tesla T4/PCIe/SSE2 @ 1920x1080 (opengl-timer-query).
Ada L4 scaling: 38.55× baseline (heavy) — 0.613 ms median (2.59× faster on L4).
Ampere A100 scaling: 30.84× baseline (heavy) — 0.8881 ms median (1.79× faster on A100).

## Failure modes

- Curvature from screen-space derivatives is noisy and flickers on low-poly or normal-mapped skin
- Not shadow aware: light bleeding across shadow-map edges needs the separate shadow LUT
- Fixed profile and LUT cannot represent thin transmission such as ears or nostrils
- Sphere assumption makes flat regions with high-frequency normal detail look incorrectly soft
- Hard to tune per skin tone, as the LUT must be regenerated for each profile

## Engine support

- unreal: builtin — `Material > Shading Model = Preintegrated Skin` (evidence: https://dev.epicgames.com/documentation/en-us/unreal-engine/shading-models-in-unreal-engine, checked 2026-12-01)

## Dataflow

- Inputs: normals, gbuffer, texture
- Outputs: radiance
- Platforms: webgl2, webgpu, desktop-gpu, mobile-gpu, unity, unreal, godot

## Presets

### Pre-integrated skin shading — curvature-driven RGB diffusion ring integral across the terminator (glsl-fragment; rendered 2026-11-30)

```json
{
  "CURVATURE": 1.15,
  "SSS_STRENGTH": 0.9,
  "SPECULAR": 0.45,
  "ROUGHNESS": 0.36
}
```

```glsl
const float CURVATURE = 1.15; // P
const float SSS_STRENGTH = 0.9; // P
const float SPECULAR = 0.45; // P
const float ROUGHNESS = 0.36; // P

float smin(float a, float b, float k) {
  float h = clamp(0.5 + 0.5 * (b - a) / k, 0.0, 1.0);
  return mix(b, a, h) - k * h * (1.0 - h);
}

// Sculptural organic form with broad low-curvature domes and tight high-curvature ridges
float mapOrganic(vec3 p) {
  float a = iTime * 0.32;
  mat2 r = mat2(cos(a), -sin(a), sin(a), cos(a));
  p.xz = r * p.xz;
  // Core cranial dome + sculpted cheek/nose/brow ridges for rich curvature variation
  float head = length(p * vec3(1.08, 0.92, 1.02)) - 0.68;
  float ridge1 = length(p - vec3(0.0, 0.02, 0.56)) - 0.16;
  float ridge2 = length((p - vec3(0.0, 0.28, 0.46)) * vec3(0.65, 1.6, 1.2)) - 0.22;
  float cheekL = length(p - vec3(-0.32, -0.08, 0.42)) - 0.24;
  float cheekR = length(p - vec3( 0.32, -0.08, 0.42)) - 0.24;
  float earL = length((p - vec3(-0.62, 0.02, -0.02)) * vec3(1.9, 0.72, 1.25)) - 0.19;
  float earR = length((p - vec3( 0.62, 0.02, -0.02)) * vec3(1.9, 0.72, 1.25)) - 0.19;
  float neck = length(vec2(length(p.xz - vec2(0.0, -0.08)) - 0.28, max(abs(p.y + 0.78) - 0.32, 0.0))) - 0.04;
  float d = smin(head, ridge1, 0.14);
  d = smin(d, ridge2, 0.16);
  d = smin(d, min(cheekL, cheekR), 0.18);
  d = smin(d, min(earL, earR), 0.10);
  d = smin(d, neck, 0.18);
  // Subtle pore-like micro-undulation
  d += 0.004 * sin(p.x * 26.0) * sin(p.y * 26.0) * sin(p.z * 26.0);
  return d;
}

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

// Penner (SIGGRAPH 2011) pre-integrated skin ring convolution evaluated directly in RGB
vec3 preIntegratedSkinLUT(float nl, float curv) {
  float theta = acos(clamp(nl, -1.0, 1.0));
  float r = 1.0 / max(curv, 0.08);
  // Multi-Gaussian skin diffusion profile (wider red radius than green/blue)
  vec3 acc = vec3(0.0);
  vec3 wSum = vec3(0.0);
  const int N = 16;
  for (int i = -N; i <= N; i++) {
    float dTheta = float(i) * (1.85 / float(N));
    float s = 2.0 * r * sin(abs(dTheta) * 0.5);
    float s2 = s * s;
    vec3 prof = vec3(
      0.233 * exp(-s2 / 0.0128) + 0.455 * exp(-s2 / 0.22) + 0.312 * exp(-s2 / 1.45),
      0.455 * exp(-s2 / 0.0128) + 0.410 * exp(-s2 / 0.09) + 0.135 * exp(-s2 / 0.36),
      0.649 * exp(-s2 / 0.0128) + 0.280 * exp(-s2 / 0.04) + 0.071 * exp(-s2 / 0.15)
    );
    float lit = max(cos(theta + dTheta), 0.0);
    acc += prof * lit;
    wSum += prof;
  }
  return acc / max(wSum, vec3(1e-4));
}

float D_GGX(float nh, float a) {
  float a2 = a * a;
  float d = nh * nh * (a2 - 1.0) + 1.0;
  return a2 / (3.14159265 * d * d + 1e-5);
}

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;
  vec3 ro = vec3(0.0, 0.02, 2.35);
  vec3 rd = normalize(vec3(uv, -1.55));

  float t = 0.2;
  bool hit = false;
  for (int i = 0; i < 64; i++) {
    float d = mapOrganic(ro + rd * t);
    if (d < 0.002) { hit = true; break; }
    t += d * 0.85;
    if (t > 6.0) break;
  }

  vec3 bg = mix(vec3(0.04, 0.05, 0.075), vec3(0.11, 0.12, 0.16), clamp(uv.y + 0.5, 0.0, 1.0));
  if (!hit) {
    fragColor = vec4(pow(clamp(aces(bg), 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);
    return;
  }

  vec3 p = ro + rd * t;
  vec3 n = calcNormal(p);
  // Screen-space geometric curvature |dN| / |dP| as in Penner 2011
  float curv = clamp(length(fwidth(n)) / max(length(fwidth(p)), 1e-4), 0.25, 4.5) * max(CURVATURE, 0.05);

  float lAng = 0.72 + 0.45 * sin(iTime * 0.5);
  if (iMouse.z > 0.5 || length(iMouse.xy) > 1.0) {
    lAng = (iMouse.x / iResolution.x - 0.5) * 3.14159;
  }
  vec3 L = normalize(vec3(sin(lAng), 0.38, cos(lAng)));
  vec3 V = -rd;
  float nl = dot(n, L);

  vec3 lambert = vec3(max(nl, 0.0));
  vec3 sssDiff = preIntegratedSkinLUT(nl, curv);
  vec3 diffTerm = mix(lambert, sssDiff, clamp(SSS_STRENGTH, 0.0, 1.5));

  vec3 skinAlbedo = vec3(0.84, 0.58, 0.46);
  vec3 H = normalize(L + V);
  float nh = max(dot(n, H), 0.0);
  float ndv = max(dot(n, V), 0.01);
  float fres = 0.028 + 0.972 * pow(1.0 - max(dot(V, H), 0.0), 5.0);
  float r1 = clamp(ROUGHNESS, 0.08, 0.95);
  // Dual-lobe oily skin specular
  float spec = (0.75 * D_GGX(nh, r1 * r1) + 0.25 * D_GGX(nh, r1 * r1 * 0.22)) * fres * max(SPECULAR, 0.0) * max(nl, 0.0);

  // Soft cool rim bounce + warm subsurface backlight
  float backScatter = pow(clamp(dot(-L, V), 0.0, 1.0), 3.0) * pow(1.0 - ndv, 2.0) * clamp(curv * 0.4, 0.0, 1.0);
  vec3 col = skinAlbedo * (diffTerm * vec3(1.65, 1.52, 1.38) + vec3(0.06, 0.08, 0.13)) + vec3(spec) * vec3(1.0, 0.95, 0.90) + vec3(0.85, 0.16, 0.06) * backScatter * SSS_STRENGTH;
  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 [Separable subsurface scattering](https://texelatlas.vercel.app/t/separable-sss.md)

## Combines with

- [Curvature map generation for edge wear and masking](https://texelatlas.vercel.app/t/curvature-map-baking.md): A baked curvature map replaces noisy derivative-based curvature as the LUT's second axis.

## Sources

1. [primary] Eric Penner Pre-Integrated Skin Shading. advances.realtimerendering.com. https://advances.realtimerendering.com/s2011/Penner%20-%20Pre-Integrated%20Skin%20Rendering%20(Siggraph%202011%20Advances%20in%20Real-Time%20Rendering%20Course).pptx (verified via http on 2026-11-29)
2. [secondary] Eugene d'Eon, David Luebke Chapter 14. Advanced Techniques for Realistic Real-Time Skin Rendering. developer.nvidia.com. https://developer.nvidia.com/gpugems/gpugems3/part-iii-rendering/chapter-14-advanced-techniques-realistic-real-time-skin (verified via http on 2026-11-29)

## Cite this entry

Texel. "Pre-integrated skin shading." https://texelatlas.vercel.app/t/pre-integrated-skin-shading/ (accessed 2026-12-01).
