{
 "id": "worley-noise",
 "title": "Worley (Cellular) Noise",
 "aliases": [
  "cellular noise",
  "Voronoi noise",
  "F1/F2 noise"
 ],
 "domain": "procgen",
 "subdomain": "noise functions",
 "stage": "procedural",
 "realtime": "realtime",
 "platforms": [
  "webgl2",
  "webgpu",
  "desktop-gpu",
  "mobile-gpu",
  "cpu",
  "blender",
  "houdini",
  "unity",
  "unreal",
  "godot",
  "python"
 ],
 "year_introduced": 1996,
 "inputs": [],
 "outputs": [
  "texture",
  "heightfield"
 ],
 "style": "both",
 "dynamic": "both",
 "summary": "A procedural texture basis built from distances to the nearest scattered feature points. F1 gives cells, F2-F1 gives cell borders, and combinations give stone, cracks, scales and caustics.",
 "how_it_works": "Space is split into a grid and each cell holds a few jittered feature points, generated by hashing the cell index so the pattern is infinite and seedable. At a shading point you search the point's own cell and its neighbours (3x3 in 2D, 3x3x3 in 3D, sometimes more for several points per cell) and record the sorted distances F1, F2, F3 to the closest features. Any function of these distances is a texture: F1 looks like pebbles or bubbles, F2-F1 produces thin crack-like borders along Voronoi edges, F2 squashed gives scales. Switching the metric from Euclidean to Manhattan or Chebyshev changes cell shapes. The cell id of the nearest feature can also be used to give each cell a random colour or height.",
 "when_to_use": "Choose it for stone, tiles, cracked mud, cell membranes, scales or any texture with explicit cell structure, and as a source of cell ids for per-cell variation. Prefer `perlin-noise` family when you want smooth blobby fields, `voronoi-lloyd-relaxation` when you need an explicit mesh of cells rather than a per-pixel function, and `poisson-disk-sampling` when point spacing must be guaranteed.",
 "cost": {
  "class": "cheap",
  "notes": "Fixed neighbourhood search per pixel (9 or 27 cells); cost grows with points per cell and with 3D."
 },
 "failure_modes": [
  "Searching only the 3x3 neighbourhood misses the true nearest point when jitter is large, producing straight-edged discontinuities in F1",
  "F1 has gradient discontinuities along cell borders, which show as sharp creases in bump mapped surfaces",
  "Unbounded jitter plus low point density yields very large cells and visible lattice alignment",
  "Hash correlation between neighbouring cells creates repeating motifs"
 ],
 "sources": [
  {
   "role": "primary",
   "key": "doi:10.1145/237170.237267",
   "type": "paper",
   "title": "A cellular texture basis function",
   "authors": [
    "Steven Worley"
   ],
   "year": 1996,
   "venue": "Proceedings of the 23rd annual conference on Computer graphics and interactive techniques",
   "url": "https://doi.org/10.1145/237170.237267",
   "ids": {
    "doi": "10.1145/237170.237267"
   },
   "license": null,
   "extra": {
    "csl_type": "proceedings-article"
   },
   "provenance": {
    "title": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/237170.237267",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/237170.237267",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/237170.237267",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/237170.237267",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/237170.237267",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": 1,
   "__bib": "worley1996cellular"
  },
  {
   "role": "tutorial",
   "key": "url:https://iquilezles.org/articles/voronoise",
   "type": "tutorial",
   "title": "Voronoise",
   "authors": [
    "Inigo Quilez"
   ],
   "year": null,
   "venue": "iquilezles.org",
   "url": "https://iquilezles.org/articles/voronoise",
   "ids": {},
   "license": null,
   "extra": {
    "http_status": 200,
    "live": true,
    "archive": {
     "url": "http://web.archive.org/web/20260915200246/https://iquilezles.org/articles/voronoise/",
     "timestamp": "20260915200246"
    },
    "page_title": "Inigo Quilez :: computer graphics, maths, shaders, fractals, demoscene",
    "host": "iquilezles.org",
    "title_confirmed_by_page": false,
    "title_unconfirmed": true
   },
   "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://iquilezles.org/articles/voronoise → 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://iquilezles.org/articles/voronoise → 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": 0,
   "__bib": "quilezvoronoise"
  },
  {
   "role": "tutorial",
   "key": "url:https://iquilezles.org/articles/voronoilines",
   "type": "tutorial",
   "title": "Voronoi Edges",
   "authors": [
    "Inigo Quilez"
   ],
   "year": null,
   "venue": "iquilezles.org",
   "url": "https://iquilezles.org/articles/voronoilines",
   "ids": {},
   "license": null,
   "extra": {
    "http_status": 200,
    "live": true,
    "archive": {
     "url": "http://web.archive.org/web/20261012040029/https://iquilezles.org/articles/voronoilines/",
     "timestamp": "20261012040029"
    },
    "page_title": "Inigo Quilez :: computer graphics, maths, shaders, fractals, demoscene",
    "host": "iquilezles.org",
    "title_confirmed_by_page": false,
    "title_unconfirmed": true
   },
   "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://iquilezles.org/articles/voronoilines → 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://iquilezles.org/articles/voronoilines → 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": 0,
   "__bib": "quilezvoronoi"
  }
 ],
 "presets": [
  {
   "id": "worley-cells-edges",
   "title": "Worley F1 cells with F2-F1 borders",
   "runtime": "glsl-fragment",
   "params": {
    "scale": 7,
    "jitter": 1
   },
   "basis": "original",
   "license_note": "written for this index",
   "code": "// GLSL ES 3.0, Shadertoy-style. Worley F1/F2 cells with animated feature points.\nconst float SCALE = 7.0;   // cells across the screen height\nconst float JITTER = 1.0;  // 0 = regular grid, 1 = fully random points\n\nvec2 hash22(vec2 p){\n  vec3 q = fract(vec3(p.xyx) * vec3(.1031, .1030, .0973));\n  q += dot(q, q.yzx + 33.33);\n  return fract((q.xx + q.yz) * q.zy);\n}\n\nvoid mainImage(out vec4 fragColor, in vec2 fragCoord){\n  vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y * SCALE;\n  vec2 ip = floor(uv);\n  vec2 fp = fract(uv);\n  float f1 = 8.0, f2 = 8.0;\n  vec2 id = vec2(0.0);\n  for (int j = -1; j <= 1; j++) {\n    for (int i = -1; i <= 1; i++) {\n      vec2 g = vec2(float(i), float(j));\n      vec2 h = hash22(ip + g);\n      vec2 o = 0.5 + 0.5 * sin(iTime * 0.8 + 6.2831 * h);\n      vec2 pt = g + mix(vec2(0.5), o, JITTER);\n      float d = length(pt - fp);\n      if (d < f1) { f2 = f1; f1 = d; id = ip + g; }\n      else if (d < f2) { f2 = d; }\n    }\n  }\n  vec3 cellCol = 0.5 + 0.5 * cos(6.2831 * (hash22(id).x + vec3(0.0, 0.33, 0.67)));\n  float edge = smoothstep(0.0, 0.08, f2 - f1);\n  vec3 col = cellCol * (0.55 + 0.45 * (1.0 - f1));\n  col = mix(vec3(0.03), col, edge);\n  fragColor = vec4(col, 1.0);\n}",
   "execution_fidelity": "faithful-pass",
   "proof": {
    "kind": "rendered",
    "label": "rendered 2026-11-29",
    "ok": true,
    "proof": {
     "ok": true,
     "technique": "worley-noise",
     "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.3872,
      "std": 0.1893,
      "unique_colors": 1286
     },
     "image": "/specimens/worley-cells-edges.webp",
     "reason": null
    }
   }
  }
 ],
 "related": [
  "voronoi-lloyd-relaxation",
  "perlin-noise",
  "fractal-brownian-motion",
  "poisson-disk-sampling"
 ],
 "extends": [],
 "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/procgen/worley-noise.json"
 },
 "solves": [
  "need cellular or cracked pattern texture",
  "make stone, scales or water caustics procedurally",
  "pattern with distinct cells and distances to points",
  "organic cell structure looks different from perlin noise"
 ],
 "authority": "Worley, 1996",
 "url": "https://texelatlas.vercel.app/t/worley-noise/",
 "execution_fidelity": "faithful-pass",
 "fidelity_label": "Faithful Pass",
 "benchmark_eligible": true,
 "gpu_weight": {
  "weight_x": 7.6,
  "tier": "moderate",
  "p50_ms": 0.2502,
  "p95_ms": 0.2579,
  "baseline_p50_ms": 0.0329,
  "gpu": "Tesla T4/PCIe/SSE2",
  "resolution": "1920x1080",
  "method": "opengl-timer-query",
  "frames": 40,
  "preset_id": "worley-cells-edges",
  "execution_fidelity": "faithful-pass",
  "fidelity_label": "Faithful Pass",
  "benchmark_eligible": true,
  "generated_at": "2026-11-30T21:07:47Z",
  "l4": {
   "weight_x": 6.68,
   "tier": "moderate",
   "p50_ms": 0.1062,
   "p95_ms": 0.1062,
   "speedup_x": 2.36,
   "gpu": "NVIDIA L4/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0159
  },
  "a100": {
   "weight_x": 4.82,
   "tier": "light",
   "p50_ms": 0.1387,
   "p95_ms": 0.1388,
   "speedup_x": 1.8,
   "gpu": "NVIDIA A100-SXM4-40GB/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0288
  }
 }
}