{
 "id": "frostbite-pbr",
 "title": "Frostbite physically based rendering",
 "aliases": [],
 "domain": "materials",
 "subdomain": "engine PBR pipeline",
 "stage": "material",
 "realtime": "realtime",
 "platforms": [
  "webgl2",
  "webgpu",
  "desktop-gpu",
  "mobile-gpu",
  "unity",
  "unreal",
  "godot",
  "blender"
 ],
 "year_introduced": 2014,
 "inputs": [
  "material-params",
  "normals",
  "irradiance-probes"
 ],
 "outputs": [
  "radiance"
 ],
 "style": "photoreal",
 "dynamic": "both",
 "summary": "The Frostbite engine's PBR recipe: GGX specular with height-correlated Smith, Disney-style diffuse, photometric light units, and a consistent IBL and area-light pipeline. Its course notes are the reference for shipping PBR in a game engine.",
 "how_it_works": "The notes document a full engine-level pipeline rather than a single BRDF. Materials use a base colour/metalness/reflectance/smoothness parameterisation with a remap from artist roughness to GGX alpha. Direct lighting evaluates GGX with the height-correlated Smith visibility term and a Frostbite-tuned diffuse (a Disney variant with energy normalisation). Lights are specified in physical photometric units (lumens, lux, nits) with exposure applied afterwards, and area lights use representative-point or LTC-style approximations. IBL uses pre-filtered specular cubemaps and a split-sum BRDF LUT with a dominant-direction correction for rough reflections, and diffuse from pre-integrated irradiance. The text also covers unit conversion, occlusion handling and specular occlusion.",
 "when_to_use": "Choose it as a checklist when building or auditing a game PBR pipeline: units, roughness remapping, specular occlusion, IBL pre-filtering. Prefer `disney-principled-brdf` when you want the artist parameter philosophy instead of an engine recipe, and `openpbr-surface` for offline interchange.",
 "cost": {
  "class": "cheap",
  "notes": "Designed for console budgets: one GGX lobe per light plus pre-filtered IBL lookups."
 },
 "failure_modes": [
  "Split-sum IBL assumes view = normal, so stretched reflections at grazing angles and on rough surfaces are too short",
  "Pre-filtered cubemaps are box-parallax-free; interiors need local probes or reflections look detached",
  "Photometric exposure workflows break when artists or tonemappers assume sRGB-ranged lights",
  "Single-scatter specular loses energy at high roughness; add kulla-conty-multiscatter"
 ],
 "sources": [
  {
   "role": "primary",
   "key": "url:https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf",
   "type": "web",
   "title": "Moving Frostbite to Physically Based Rendering",
   "authors": [
    "Sébastien Lagarde",
    "Charles de Rousiers"
   ],
   "year": null,
   "venue": "SIGGRAPH 2014 course",
   "url": "https://seblagarde.wordpress.com/wp-content/uploads/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf",
   "ids": {},
   "license": null,
   "extra": {
    "http_status": 200,
    "live": true,
    "archive": null,
    "page_title": null,
    "host": "seblagarde.wordpress.com",
    "title_confirmed_by_page": false,
    "title_unconfirmed": false
   },
   "provenance": {
    "title": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "http",
     "endpoint": "GET https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf → 200",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": null,
   "__bib": "lagardemoving"
  }
 ],
 "presets": [
  {
   "id": "frostbite-pbr-specimen",
   "title": "Frostbite PBR spheres: dielectric and gold, roughness sweep",
   "runtime": "glsl-fragment",
   "params": {
    "ROUGH_MIN": 0.08
   },
   "code": "// Frostbite-style PBR: GGX + height-correlated Smith visibility + Burley diffuse with the energy-conserving\n// bias/factor. Top row dielectric, bottom row gold metal, roughness 0.08 -> 1.0 left to right.\nconst float ROUGH_MIN = 0.08;\nconst vec3 ALBEDO = vec3(0.75, 0.12, 0.1);\nconst vec3 METAL_F0 = vec3(1.0, 0.77, 0.34);\nconst vec3 L_DIR = vec3(0.5, 0.7, 0.6);\n\nvec3 env(vec3 d) {\n  vec3 c = mix(vec3(0.12, 0.1, 0.1), vec3(0.4, 0.55, 0.85), smoothstep(-0.3, 0.8, d.y));\n  return c + vec3(3.0) * pow(max(dot(d, normalize(L_DIR)), 0.0), 50.0);\n}\nfloat visSmith(float nl, float nv, float a) {\n  float a2 = a * a;\n  float gv = nl * sqrt((-nv * a2 + nv) * nv + a2);\n  float gl = nv * sqrt((-nl * a2 + nl) * nl + a2);\n  return 0.5 / max(gv + gl, 1e-4);\n}\nvec3 shade(vec3 n, vec3 v, float rough, float metal) {\n  vec3 l = normalize(L_DIR); vec3 h = normalize(v + l);\n  float nl = clamp(dot(n, l), 1e-3, 1.0), nv = max(dot(n, v), 1e-3);\n  float nh = clamp(dot(n, h), 0.0, 1.0), lh = clamp(dot(l, h), 0.0, 1.0);\n  float a = rough * rough; float d = nh * nh * (a * a - 1.0) + 1.0;\n  float D = a * a / (3.14159 * d * d);\n  vec3 f0 = mix(vec3(0.04), METAL_F0, metal);\n  vec3 F = f0 + (1.0 - f0) * pow(1.0 - lh, 5.0);\n  vec3 spec = D * visSmith(nl, nv, a) * F;\n  float eb = mix(0.0, 0.5, rough), ef = mix(1.0, 1.0 / 1.51, rough);\n  float fd90 = eb + 2.0 * lh * lh * rough;\n  float fd = (1.0 + (fd90 - 1.0) * pow(1.0 - nl, 5.0)) * (1.0 + (fd90 - 1.0) * pow(1.0 - nv, 5.0)) * ef;\n  vec3 diff = (1.0 - metal) * ALBEDO * fd / 3.14159;\n  vec3 amb = env(n) * ALBEDO * (1.0 - metal) * 0.5;\n  vec3 fr = f0 + (max(vec3(1.0 - rough), f0) - f0) * pow(1.0 - nv, 5.0);\n  amb += env(reflect(-v, n)) * fr * (1.0 - 0.5 * rough);\n  return (diff + spec) * nl * 3.14159 * 1.4 + amb;\n}\nvoid mainImage(out vec4 fragColor, in vec2 fragCoord) {\n  vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;\n  vec3 ro = vec3(0.0, 0.0, 4.0), rd = normalize(vec3(uv, -1.6));\n  vec3 col = env(rd) * 0.35; float best = 1e9;\n  for (int j = 0; j < 2; j++) for (int i = 0; i < 5; i++) {\n    vec3 c = vec3((float(i) - 2.0) * 0.5, j == 0 ? 0.28 : -0.28, 0.0);\n    vec3 oc = ro - c; float b = dot(oc, rd); float hh = b * b - dot(oc, oc) + 0.23 * 0.23;\n    if (hh < 0.0) continue;\n    float t = -b - sqrt(hh);\n    if (t > 0.0 && t < best) {\n      best = t; vec3 n = normalize(ro + rd * t - c);\n      col = shade(n, -rd, mix(ROUGH_MIN, 1.0, float(i) / 4.0), j == 0 ? 0.0 : 1.0);\n    }\n  }\n  col = col / (1.0 + col);\n  fragColor = vec4(pow(col, vec3(1.0 / 2.2)), 1.0);\n}\n",
   "basis": "original",
   "license_note": "written for this index",
   "execution_fidelity": "conceptual-diagram",
   "proof": {
    "kind": "rendered",
    "label": "rendered 2026-11-29",
    "ok": true,
    "proof": {
     "ok": true,
     "technique": "frostbite-pbr",
     "runtime": "glsl-fragment",
     "checked_at": "2026-11-29T15:51:50.471Z",
     "renderer": "Chromium 145.0.7632.6 headless, WebGL2 via ANGLE/SwiftShader, 512×512, iTime=1.5",
     "stats": {
      "mean": 0.316,
      "std": 0.1071,
      "unique_colors": 321
     },
     "image": "/specimens/frostbite-pbr-specimen.webp",
     "reason": null
    }
   }
  }
 ],
 "related": [
  "disney-principled-brdf",
  "ggx-trowbridge-reitz",
  "smith-masking-shadowing",
  "kulla-conty-multiscatter"
 ],
 "extends": [
  "disney-principled-brdf"
 ],
 "supersedes": [],
 "combines_with": [],
 "provenance": {
  "prose": "original text written for this index (research draft, editorially reviewed)",
  "sources_verified_at": "2026-11-29T15:51:27.588Z",
  "draft": "data/drafts/materials/frostbite-pbr.json"
 },
 "solves": [
  "need a checklist for shipping pbr in a game engine",
  "lighting units and roughness remapping are inconsistent",
  "specular occlusion and ibl prefiltering questions",
  "auditing my game's physically based pipeline",
  "area lights and ibl don't match in brightness"
 ],
 "authority": "Lagarde & Rousiers",
 "url": "https://texelatlas.vercel.app/t/frostbite-pbr/",
 "execution_fidelity": "conceptual-diagram",
 "fidelity_label": "Visual Diagram",
 "benchmark_eligible": false,
 "gpu_weight": {
  "weight_x": 3.63,
  "tier": "light",
  "p50_ms": 0.1195,
  "p95_ms": 0.126,
  "baseline_p50_ms": 0.0329,
  "gpu": "Tesla T4/PCIe/SSE2",
  "resolution": "1920x1080",
  "method": "opengl-timer-query",
  "frames": 40,
  "preset_id": "frostbite-pbr-specimen",
  "execution_fidelity": "conceptual-diagram",
  "fidelity_label": "Visual Diagram",
  "benchmark_eligible": false,
  "generated_at": "2026-11-30T21:07:47Z",
  "l4": {
   "weight_x": 2.82,
   "tier": "light",
   "p50_ms": 0.0448,
   "p95_ms": 0.0452,
   "speedup_x": 2.67,
   "gpu": "NVIDIA L4/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0159
  },
  "a100": {
   "weight_x": 2.22,
   "tier": "light",
   "p50_ms": 0.0638,
   "p95_ms": 0.0639,
   "speedup_x": 1.87,
   "gpu": "NVIDIA A100-SXM4-40GB/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0288
  }
 }
}