---
id: "kajiya-kay-hair-shading"
title: "Kajiya-Kay hair shading"
aliases: [Kajiya-Kay model, strand tangent shading]
domain: "materials"
stage: "material"
realtime: "realtime"
platforms: [webgl2, webgpu, desktop-gpu, mobile-gpu, cpu, unity, unreal, godot, blender]
year_introduced: 1989
inputs: [curves, material-params]
outputs: [radiance]
style: "both"
dynamic: "both"
cost: "cheap"
authority: "Kajiya & Kay, 1989"
url: "https://texelatlas.vercel.app/t/kajiya-kay-hair-shading/"
sources_verified_at: "2026-11-29"
---
# Kajiya-Kay hair shading (Kajiya & Kay, 1989)

> Treats a hair strand as an infinitely thin cylinder with a tangent instead of a normal. Diffuse and specular depend on the angle between tangent, light and view, giving the stretched highlight band every game hair shader starts from.

## Reach for it when

- need cheap shiny highlight along hair strands
- hair cards look like flat plastic
- want anisotropic highlight following hair direction
- game character hair that runs on mobile
- two-tone specular on hair cards

## How it works

A fibre has no single surface normal, so the model works with the strand tangent T. Diffuse is the average over all normals perpendicular to T, which comes out as sin of the angle between T and the light: sqrt(1 - dot(T,L)^2). Specular uses the cone around T on which light reflects: the highlight is strongest when the angle of the light to the strand mirrors the angle of the eye, giving spec = pow(dot(T,L)*dot(T,V) + sinTL*sinTV, p) with sinTL = sqrt(1-dot(T,L)^2) and sinTV likewise. Real-time versions usually add a second, differently coloured and shifted lobe by sliding the tangent along the normal using a noise or shift map, imitating the secondary reflection, and multiply by a flow-map or card tangent so highlights follow the hair direction. Shadows and opacity come from separate hair-card or strand techniques; the shading itself is purely local.

## When to use it

Choose it for hair cards, fur cards, anisotropic satin and stylised hair where cost and artist control matter. Prefer [Marschner hair scattering model](https://texelatlas.vercel.app/t/marschner-hair-scattering.md) or [Disney / Chiang hair and fur BSDF](https://texelatlas.vercel.app/t/disney-hair-bsdf.md) when physically based fibre colour, multiple lobes and path-traced reference are required. Prefer [Anisotropic GGX](https://texelatlas.vercel.app/t/anisotropic-ggx.md) for brushed metal where a surface normal still exists. Use [Strand-based real-time hair (TressFX style)](https://texelatlas.vercel.app/t/strand-based-real-time-hair.md) for the geometry side when hair is simulated and rendered as lines.

## Cost

cheap — A handful of dot products and pow per light; the second lobe roughly doubles the specular math.
Measured GPU Weight: 1.45× baseline (feather) — 0.0478 ms median / 0.0492 ms p95 on Tesla T4/PCIe/SSE2 @ 1920x1080 (opengl-timer-query).
Ada L4 scaling: 1.28× baseline (feather) — 0.0203 ms median (2.35× faster on L4).
Ampere A100 scaling: 1.01× baseline (feather) — 0.0292 ms median (1.64× faster on A100).

## Failure modes

- Highlight sits at the wrong place on the strand because the tangent is not normalised or flips direction along the card
- No light transport through the fibre, so blond or white hair lacks glow and backlighting
- Highlights are single and white without the shifted second lobe, giving a plastic look
- Hair cards sorted wrongly with alpha blending cause popping; alpha-to-coverage trades that for noise
- Specular aliasing on thin fibres sparkles without a roughness or power adjustment at distance

## Engine support

- unity: builtin — `HDRP Hair Shader Graph > Material Type = Approximate` (evidence: https://github.com/Unity-Technologies/Graphics/blob/557f6ac22b948284f57ffae6a789751fd1f63620/Packages/com.unity.render-pipelines.high-definition/Documentation~/snippets/shader-properties/surface-options/material-type-hair.md, checked 2026-12-01) — HDRP Hair shader.

## Dataflow

- Inputs: curves, material-params
- Outputs: radiance
- Platforms: webgl2, webgpu, desktop-gpu, mobile-gpu, cpu, unity, unreal, godot, blender

## Presets

### Kajiya-Kay highlights on latitude strands (glsl-fragment; rendered 2026-11-29)

```json
{
  "SPEC_POWER": 80,
  "SPEC_POWER_2": 20
}
```

```glsl
// GLSL ES 3.0, Shadertoy-style. Strands run along latitude lines of a sphere.
const float SPEC_POWER = 80.0;
const float SPEC_POWER_2 = 20.0;
const vec3 HAIR = vec3(0.35, 0.18, 0.08);

float kk(vec3 t, vec3 l, vec3 v, float p) {
    float tl = dot(t, l), tv = dot(t, v);
    float s = tl * tv + sqrt(max(1.0 - tl * tl, 0.0)) * sqrt(max(1.0 - tv * tv, 0.0));
    return pow(clamp(s, 0.0, 1.0), p);
}

void mainImage(out vec4 fragColor, in vec2 fragCoord) {
    vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;
    vec3 ro = vec3(0.0, 0.0, 3.0);
    vec3 rd = normalize(vec3(uv, -1.5));
    vec3 col = vec3(0.03, 0.03, 0.05);
    float b = dot(ro, rd);
    float h = b * b - (dot(ro, ro) - 1.0);
    if (h > 0.0) {
        vec3 p = ro + rd * (-b - sqrt(h));
        vec3 n = normalize(p);
        vec3 t = normalize(cross(vec3(0.0, 1.0, 0.0), n));
        vec3 l = normalize(vec3(sin(iTime) * 0.8, 0.7, 0.9));
        vec3 v = -rd;
        float tl = dot(t, l);
        float diff = sqrt(max(1.0 - tl * tl, 0.0)) * (0.3 + 0.7 * max(dot(n, l) * 0.5 + 0.5, 0.0));
        vec3 t2 = normalize(t + 0.25 * n);
        vec3 spec = vec3(1.0) * kk(t, l, v, SPEC_POWER) + HAIR * 3.0 * kk(t2, l, v, SPEC_POWER_2);
        col = HAIR * diff + 0.6 * spec;
    }
    fragColor = vec4(pow(col, vec3(1.0 / 2.2)), 1.0);
}
```

Attribution: written for this index

## Lineage

- extended by [Marschner hair scattering model](https://texelatlas.vercel.app/t/marschner-hair-scattering.md)

## Combines with

- [Strand-based real-time hair (TressFX style)](https://texelatlas.vercel.app/t/strand-based-real-time-hair.md): Simulated strand lines supply per-vertex tangents that the Kajiya-Kay lobes consume.

## Sources

1. [primary] J. T. Kajiya, T. L. Kay (1989) Rendering fur with three dimensional textures. Proceedings of the 16th annual conference on Computer graphics and interactive techniques. https://doi.org/10.1145/74333.74361 (verified via crossref on 2026-11-29)
2. [secondary] Cem Yuksel, Sarah Tariq Advanced techniques in real-time hair rendering and simulation. cemyuksel.com. https://www.cemyuksel.com/courses/conferences/siggraph2010-hair (verified via http on 2026-11-29)

## Cite this entry

Texel. "Kajiya-Kay hair shading." https://texelatlas.vercel.app/t/kajiya-kay-hair-shading/ (accessed 2026-12-01).
