{
 "id": "hable-filmic-tonemapping",
 "title": "Hable filmic (Uncharted 2) tonemapping",
 "aliases": [
  "Uncharted 2 tonemapper",
  "filmic curve"
 ],
 "domain": "post",
 "subdomain": "tonemapping",
 "stage": "post",
 "realtime": "realtime",
 "platforms": [
  "webgl2",
  "webgpu",
  "desktop-gpu",
  "mobile-gpu",
  "unity",
  "unreal"
 ],
 "year_introduced": 2010,
 "inputs": [
  "hdr-image"
 ],
 "outputs": [
  "ldr-image"
 ],
 "style": "photoreal",
 "dynamic": "both",
 "summary": "A parametric filmic curve from Uncharted 2 with separate toe, linear and shoulder terms. It gives contrasty blacks and a soft highlight roll-off, and is easy to tune by hand.",
 "how_it_works": "The curve is a rational function ((x(Ax+CB)+DE)/(x(Ax+B)+DF)) - E/F with six constants controlling shoulder strength, linear strength, linear angle, toe strength, toe numerator and toe denominator. The input is scaled by an exposure bias, passed through the function, and divided by the same function evaluated at a linear white point so that white maps to 1. It is applied per channel in the shader, then gamma encoded. The toe crushes dark values for a film-like black, the linear section keeps mid-tones close to proportional, and the shoulder compresses highlights gradually. Because the constants are explicit, artists can re-fit the curve to a target look.",
 "when_to_use": "Choose it when you want a simple filmic curve you can tune by hand with no matrices or LUTs.\n\nPrefer `aces-tonemapping` for an industry-standard look, `agx-tonemapping` for hue stability, and `reinhard-tonemapping` for the least contrast. Hable's curve skews hue like ACES because it runs per channel.",
 "cost": {
  "class": "cheap",
  "notes": "One rational function per channel."
 },
 "failure_modes": [
  "Per-channel hue skew and desaturation of saturated highlights",
  "Constants are scene-dependent: the white point and exposure bias need re-tuning",
  "Crushed blacks when exposure is low",
  "Colours differ from authored albedo, unlike a neutral mapper"
 ],
 "sources": [
  {
   "role": "primary",
   "key": "url:https://filmicworlds.com/blog/filmic-tonemapping-operators",
   "type": "web",
   "title": "Filmic Tonemapping Operators",
   "authors": [
    "John Hable"
   ],
   "year": null,
   "venue": "filmicworlds.com",
   "url": "https://filmicworlds.com/blog/filmic-tonemapping-operators",
   "ids": {},
   "license": null,
   "extra": {
    "http_status": 200,
    "live": true,
    "archive": {
     "url": "http://web.archive.org/web/20260919080845/https://filmicworlds.com/blog/filmic-tonemapping-operators/",
     "timestamp": "20260919080845"
    },
    "page_title": "Filmic Tonemapping Operators",
    "host": "filmicworlds.com",
    "title_confirmed_by_page": true,
    "title_unconfirmed": false
   },
   "provenance": {
    "title": {
     "authority": "http",
     "endpoint": "GET https://filmicworlds.com/blog/filmic-tonemapping-operators → 200",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "http",
     "endpoint": "GET https://filmicworlds.com/blog/filmic-tonemapping-operators → 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": "http",
     "endpoint": "GET https://filmicworlds.com/blog/filmic-tonemapping-operators → 200",
     "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": 1,
   "__bib": "hablefilmic"
  },
  {
   "role": "implementation",
   "key": "gh:dmnsgn/shaders-tone-map",
   "type": "code",
   "title": "dmnsgn/shaders-tone-map",
   "description": "Thirteen tone mapping operators for GLSL and WGSL, as ES module strings and as plain shader files.",
   "authors": [
    "dmnsgn"
   ],
   "year": 2019,
   "venue": "GitHub",
   "url": "https://github.com/dmnsgn/shaders-tone-map",
   "ids": {
    "repo": "dmnsgn/shaders-tone-map"
   },
   "license": "MIT",
   "extra": {
    "stars": 242,
    "stars_checked": "2026-11-29",
    "archived": false,
    "fork": false,
    "pushed_at": "2026-08-28T07:23:45Z",
    "language": "JavaScript",
    "homepage": "https://dmnsgn.github.io/shaders-tone-map/",
    "license_name": "MIT License"
   },
   "provenance": {
    "title": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/dmnsgn/shaders-tone-map",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/dmnsgn/shaders-tone-map",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/dmnsgn/shaders-tone-map",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/dmnsgn/shaders-tone-map",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/dmnsgn/shaders-tone-map",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "license": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/dmnsgn/shaders-tone-map",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": null,
   "__bib": "dmnsgn2019dmnsgn"
  }
 ],
 "presets": [
  {
   "id": "hable-filmic-curve-plot",
   "title": "Filmic curve visualised against Reinhard and clamp",
   "runtime": "glsl-fragment",
   "params": {
    "A": 0.15,
    "B": 0.5,
    "C": 0.1,
    "D": 0.2,
    "E": 0.02,
    "F": 0.3,
    "W": 11.2,
    "EXPOSURE_BIAS": 2
   },
   "code": "// GLSL ES 3.0, Shadertoy-style\n// Plots Hable filmic, Reinhard and linear clamp for scene values 0..8.\nconst float A = 0.15, B = 0.50, C = 0.10, D = 0.20, E = 0.02, F = 0.30;\nconst float W = 11.2;\nconst float EXPOSURE_BIAS = 2.0;\nconst float X_MAX = 8.0;\n\nfloat hable(float x) {\n    return ((x * (A * x + C * B) + D * E) / (x * (A * x + B) + D * F)) - E / F;\n}\nfloat filmic(float x) { return hable(EXPOSURE_BIAS * x) / hable(W); }\nfloat reinhard(float x) { return x / (1.0 + x); }\n\nfloat line(float y, float f, float w) {\n    return smoothstep(w, w * 0.4, abs(y - f));\n}\n\nvoid mainImage(out vec4 fragColor, in vec2 fragCoord) {\n    vec2 uv = fragCoord / iResolution.xy;\n    float x = uv.x * X_MAX;\n    vec3 col = vec3(0.07, 0.08, 0.10);\n    // grid\n    float gx = abs(fract(uv.x * X_MAX) - 0.5);\n    float gy = abs(fract(uv.y * 5.0) - 0.5);\n    col += 0.05 * smoothstep(0.47, 0.5, max(gx, gy));\n    // curves in the upper part, gradient strip below\n    float cy = (uv.y - 0.18) / 0.82;\n    if (uv.y > 0.18) {\n        col = mix(col, vec3(0.9), line(cy, min(x, 1.0), 0.008));\n        col = mix(col, vec3(0.2, 0.7, 1.0), line(cy, reinhard(x), 0.008));\n        col = mix(col, vec3(1.0, 0.55, 0.15), line(cy, filmic(x), 0.010));\n    } else if (uv.y > 0.09) {\n        float v = filmic(x);\n        col = vec3(pow(clamp(v, 0.0, 1.0), 1.0 / 2.2));\n    } else {\n        col = vec3(pow(clamp(x, 0.0, 1.0), 1.0 / 2.2));\n    }\n    fragColor = vec4(col, 1.0);\n}\n",
   "basis": "original",
   "license_note": "written for this index; constants are the published ones from the primary source (0)",
   "execution_fidelity": "faithful-pass",
   "proof": {
    "kind": "rendered",
    "label": "rendered 2026-11-29",
    "ok": true,
    "proof": {
     "ok": true,
     "technique": "hable-filmic-tonemapping",
     "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.2466,
      "std": 0.3357,
      "unique_colors": 117
     },
     "image": "/specimens/hable-filmic-curve-plot.webp",
     "reason": null
    }
   }
  }
 ],
 "related": [
  "aces-tonemapping",
  "reinhard-tonemapping",
  "agx-tonemapping"
 ],
 "extends": [
  "reinhard-tonemapping"
 ],
 "supersedes": [],
 "combines_with": [
  {
   "id": "lut-color-grading",
   "why": "Tonemap first, then grade the LDR result with a LUT."
  }
 ],
 "provenance": {
  "prose": "original text written for this index (research draft, editorially reviewed)",
  "sources_verified_at": "2026-11-29T15:51:27.588Z",
  "draft": "data/drafts/post/hable-filmic-tonemapping.json"
 },
 "solves": [
  "hdr image looks washed out with flat blacks",
  "want contrasty filmic look i can tune by hand",
  "highlights clip harshly to white",
  "need a simple tweakable shoulder and toe curve"
 ],
 "authority": "Hable",
 "url": "https://texelatlas.vercel.app/t/hable-filmic-tonemapping/",
 "execution_fidelity": "faithful-pass",
 "fidelity_label": "Faithful Pass",
 "benchmark_eligible": true,
 "gpu_weight": {
  "weight_x": 1.28,
  "tier": "feather",
  "p50_ms": 0.042,
  "p95_ms": 0.0445,
  "baseline_p50_ms": 0.0329,
  "gpu": "Tesla T4/PCIe/SSE2",
  "resolution": "1920x1080",
  "method": "opengl-timer-query",
  "frames": 40,
  "preset_id": "hable-filmic-curve-plot",
  "execution_fidelity": "faithful-pass",
  "fidelity_label": "Faithful Pass",
  "benchmark_eligible": true,
  "generated_at": "2026-11-30T21:07:47Z",
  "l4": {
   "weight_x": 1.03,
   "tier": "feather",
   "p50_ms": 0.0163,
   "p95_ms": 0.0167,
   "speedup_x": 2.58,
   "gpu": "NVIDIA L4/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0159
  },
  "a100": {
   "weight_x": 1,
   "tier": "feather",
   "p50_ms": 0.0288,
   "p95_ms": 0.0288,
   "speedup_x": 1.46,
   "gpu": "NVIDIA A100-SXM4-40GB/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0288
  }
 }
}