---
id: "film-grain-synthesis"
title: "Film grain synthesis"
domain: "post"
stage: "post"
realtime: "realtime"
platforms: [webgl2, webgpu, desktop-gpu, cpu, python]
year_introduced: 2017
inputs: [ldr-image, hdr-image]
outputs: [ldr-image]
style: "photoreal"
dynamic: "both"
cost: "medium"
authority: "Newson et al., 2017"
url: "https://texelatlas.vercel.app/t/film-grain-synthesis/"
sources_verified_at: "2026-11-29"
---
# Film grain synthesis (Newson et al., 2017)

> Adds grain from a stochastic model of film grains rather than uniform noise, giving intensity-dependent, resolution-independent texture; real-time shaders approximate it with filtered noise.

## Reach for it when

- digital image looks too clean and sterile
- want grain that resembles a real film stock
- uniform noise looks fake and resolution dependent
- grain should be stronger in midtones than highlights
- match cinematic texture across different output sizes

## How it works

Newson et al. model film as a Boolean process: grains are discs of random radius scattered over the image as a Poisson point process. A pixel's output value is the probability that it is covered by some grain, which is a function of the input intensity. Rendering simulates by Monte Carlo: for each output pixel, a few random points are drawn over a window, grains are placed around the nearest Poisson grid cells, and the covered fraction is counted. Rendering at any resolution is possible because the model is defined in continuous space. Mid-tones get the strongest grain, while shadows and highlights show less, matching real film. Real-time engines substitute luminance-weighted blue-ish noise with a grain size parameter.

## When to use it

Choose it when you want grain whose size and distribution match a real film stock and survive resolution changes.

Prefer cheap hash noise scaled by luminance for games, and apply it after [Chromatic aberration and vignette](https://texelatlas.vercel.app/t/chromatic-aberration.md). Prefer a full [Film emulation (spectral stock simulation)](https://texelatlas.vercel.app/t/film-emulation.md) pipeline if colour behaviour matters, not only texture.

## Cost

medium — The exact Monte Carlo model is heavy; shader approximations are cheap. GPU code exists for the full model.
Measured GPU Weight: 2.93× baseline (light) — 0.0965 ms median / 0.1 ms p95 on Tesla T4/PCIe/SSE2 @ 1920x1080 (opengl-timer-query).
Ada L4 scaling: 2.58× baseline (light) — 0.041 ms median (2.35× faster on L4).
Ampere A100 scaling: 1.72× baseline (feather) — 0.0494 ms median (1.95× faster on A100).

## Failure modes

- Animated grain crawls and shimmers if the seed is not changed per frame at film rate
- Grain applied before AA or upscaling is smeared or reinforced by the filter
- Plain Gaussian noise looks digital and shows in sky gradients as banding structure
- Video compression erases fine grain at low bitrates

## Engine support

- babylonjs: builtin — `pipeline.grainEnabled = true (GrainPostProcess)` (evidence: https://github.com/BabylonJS/Babylon.js/blob/9.38.0/packages/dev/core/src/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.pure.ts, checked 2026-12-01) — Simple noise grain, not spectral synthesis.
- blender: builtin — `Compositor > Add > Camera Lens Effects > Film Grain` (evidence: https://docs.blender.org/manual/en/5.2/compositing/types/camera_lens_effects/film_grain.html, checked 2026-12-01)
- threejs: official — `import { film } from 'three/addons/tsl/display/FilmNode.js' (WebGL: FilmPass)` (evidence: https://github.com/mrdoob/three.js/blob/r187/examples/jsm/tsl/display/FilmNode.js, checked 2026-12-01) — Simple noise grain, not physically based synthesis.
- unity: builtin — `Volume > Add Override > Post-processing > Film Grain` (evidence: https://github.com/Unity-Technologies/Graphics/blob/557f6ac22b948284f57ffae6a789751fd1f63620/Packages/com.unity.render-pipelines.high-definition/Documentation~/Post-Processing-Film-Grain.md, checked 2026-12-01) — Texture-based grain presets or a custom texture, not spectral grain synthesis.
- unreal: builtin — `Post Process Volume > Film Grain` (evidence: https://dev.epicgames.com/documentation/en-us/unreal-engine/post-process-effects-in-unreal-engine, checked 2026-12-01)

## Dataflow

- Inputs: ldr-image, hdr-image
- Outputs: ldr-image
- Platforms: webgl2, webgpu, desktop-gpu, cpu, python

## Presets

### A smooth grey ramp. Left: uniform additive noise. Right: correlated grain scaled by an intensity function (glsl-fragment; rendered 2026-11-29)

```json
{
  "GRAINSZ": 1.6,
  "AMT": 0.55
}
```

```glsl
float hash(vec2 c){uvec2 u=uvec2(ivec2(floor(c)));uint h=u.x*1597334673u^u.y*3812015801u;h^=h>>15;h*=2246822519u;h^=h>>13;h*=3266489917u;h^=h>>16;return float(h)*(1./4294967296.);}
float lum(vec3 c){return dot(c,vec3(.2126,.7152,.0722));}
vec3 gam(vec3 c){return pow(clamp(c,0.,1.),vec3(1./2.2));}

const float GRAINSZ=1.6; // P
const float AMT=0.55; // P
float vn(vec2 p){vec2 i=floor(p),f=fract(p);f=f*f*(3.-2.*f);
  return mix(mix(hash(i),hash(i+vec2(1.,0.)),f.x),mix(hash(i+vec2(0.,1.)),hash(i+vec2(1.,1.)),f.x),f.y);}
void mainImage(out vec4 fragColor,in vec2 fragCoord){
  vec2 uv=(fragCoord-.5*iResolution.xy)/iResolution.y;bool R=uv.x>0.;vec2 q=vec2(uv.x+(R?-.25:.25),uv.y);
  float L=clamp((q.x+.25)/.5,0.,1.);if(uv.y<0.)L=.5;
  float g=(vn(fragCoord/GRAINSZ+3.)+.5*vn(fragCoord/(GRAINSZ*.5)+9.)-.75)*1.6;
  float n=hash(fragCoord)-.5;
  float v=R?L+g*AMT*sqrt(max(L*(1.-L),0.))*.5:L+n*.18;
  vec3 col=vec3(clamp(v,0.,1.));
  if(abs(uv.x)<.0015)col=vec3(1.);
  fragColor=vec4(col,1.);
}
```

Attribution: written for this index

## Combines with

- [Film emulation (spectral stock simulation)](https://texelatlas.vercel.app/t/film-emulation.md): Grain is the last stage of a film-stock simulation.

## Sources

1. [primary] Alasdair Newson, Noura Faraj, Bruno Galerne, Julie Delon (2017) Realistic Film Grain Rendering. Image Processing On Line. https://doi.org/10.5201/ipol.2017.192 (verified via doi.org on 2026-11-29)
2. [primary] A. Newson, J. Delon, B. Galerne (2017) A Stochastic Film Grain Model for Resolution‐Independent Rendering. Computer Graphics Forum. https://doi.org/10.1111/cgf.13159 (verified via crossref on 2026-11-29)
3. [implementation] mrdoob (2010) mrdoob/three.js. https://github.com/mrdoob/three.js License: MIT. (verified via github on 2026-11-29)

## Cite this entry

Texel. "Film grain synthesis." https://texelatlas.vercel.app/t/film-grain-synthesis/ (accessed 2026-12-01).
