{
 "id": "octahedral-impostors",
 "title": "Octahedral impostors",
 "aliases": [
  "octahedral imposter",
  "hemi-octahedral impostor",
  "parallax impostor"
 ],
 "domain": "performance",
 "subdomain": "impostors",
 "stage": "performance",
 "realtime": "realtime",
 "platforms": [
  "webgl2",
  "webgpu",
  "desktop-gpu",
  "unity",
  "unreal",
  "godot"
 ],
 "year_introduced": 2018,
 "inputs": [
  "mesh",
  "material-params"
 ],
 "outputs": [
  "texture",
  "gbuffer"
 ],
 "style": "both",
 "dynamic": "both",
 "summary": "Replace distant, complex meshes with a quad that samples a pre-baked atlas of views taken from directions on an octahedron, blending the nearest frames for smooth viewpoint changes.",
 "how_it_works": "Bake: render the object from a grid of camera directions covering the sphere (or upper hemisphere for plants and props that sit on the ground). Directions are mapped to a square atlas through octahedral encoding, which spreads samples evenly and avoids pole singularities. Each frame stores albedo, normals and often depth, so the impostor can be relit at runtime.\n\nRuntime: a camera-facing quad computes the view direction in object space, finds the three nearest baked frames, and blends them using barycentric weights. With the stored depth, a parallax step offsets each frame's lookup so the silhouette and internal parallax stay plausible; this is the 'parallax' variant. Output goes into the G-buffer, so lighting and shadows treat it like geometry.",
 "when_to_use": "Choose it for dense vegetation, rocks and props at far LOD where triangle count or overdraw dominates. Prefer `nanite-virtualized-geometry` or `meshlets` with continuous simplification when the engine supports it and you want no baked data. Prefer plain mesh LOD from `meshoptimizer` when objects stay within moderate distance, since impostors cannot be seen up close.",
 "cost": {
  "class": "cheap",
  "notes": "One quad per instance, a few texture fetches; baking is offline and atlas memory scales with frame count and channels."
 },
 "failure_modes": [
  "Visible popping or ghosting when blending between frames, since neighbouring views disagree on silhouettes",
  "Parallax distortion at grazing angles because stored depth is a single layer",
  "Baked lighting or shadows leak if the atlas contains shading rather than material data",
  "Wrong results for animated or deformed meshes, such as wind-bent trees, without a separate vertex animation path",
  "Atlas memory cost grows quickly with frame resolution and channel count"
 ],
 "sources": [
  {
   "role": "primary",
   "key": "url:https://shaderbits.com/blog/octahedral-impostors",
   "type": "tutorial",
   "title": "Octahedral Impostors",
   "authors": [
    "Ryan Brucks"
   ],
   "year": null,
   "venue": "shaderbits.com",
   "url": "https://shaderbits.com/blog/octahedral-impostors",
   "ids": {},
   "license": null,
   "extra": {
    "http_status": 200,
    "live": true,
    "archive": {
     "url": "http://web.archive.org/web/20261113064542/https://shaderbits.com/blog/octahedral-impostors",
     "timestamp": "20261113064542"
    },
    "page_title": "Post Page",
    "host": "shaderbits.com",
    "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-30T18:01:53.730Z"
    },
    "url": {
     "authority": "http",
     "endpoint": "GET https://shaderbits.com/blog/octahedral-impostors → 200",
     "checked_at": "2026-11-30T18:01:53.730Z"
    },
    "authors": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-30T18:01:53.730Z"
    },
    "venue": {
     "authority": "http",
     "endpoint": "GET https://shaderbits.com/blog/octahedral-impostors → 200",
     "checked_at": "2026-11-30T18:01:53.730Z"
    },
    "year": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-30T18:01:53.730Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-30T18:01:53.730Z",
   "title_sim": 0,
   "__bib": "brucksoctahedral"
  },
  {
   "role": "implementation",
   "key": "gh:agargaro/octahedral-impostor",
   "type": "code",
   "title": "agargaro/octahedral-impostor",
   "description": "wip",
   "authors": [
    "agargaro"
   ],
   "year": 2025,
   "venue": "GitHub",
   "url": "https://github.com/agargaro/octahedral-impostor",
   "ids": {
    "repo": "agargaro/octahedral-impostor"
   },
   "license": "MIT",
   "extra": {
    "stars": 72,
    "stars_checked": "2026-11-29",
    "archived": false,
    "fork": false,
    "pushed_at": "2025-11-03T20:58:34Z",
    "language": "TypeScript",
    "homepage": null,
    "license_name": "MIT License"
   },
   "provenance": {
    "title": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/agargaro/octahedral-impostor",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/agargaro/octahedral-impostor",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/agargaro/octahedral-impostor",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/agargaro/octahedral-impostor",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/agargaro/octahedral-impostor",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "license": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/agargaro/octahedral-impostor",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": null,
   "__bib": "agargaro2025agargaro"
  },
  {
   "role": "implementation",
   "key": "gh:wojtekpil/godot-octahedral-impostors",
   "type": "code",
   "title": "wojtekpil/Godot-Octahedral-Impostors",
   "description": "Octahedral Impostors implementation for Godot Game Engine",
   "authors": [
    "wojtekpil"
   ],
   "year": 2020,
   "venue": "GitHub",
   "url": "https://github.com/wojtekpil/Godot-Octahedral-Impostors",
   "ids": {
    "repo": "wojtekpil/Godot-Octahedral-Impostors"
   },
   "license": "MIT",
   "extra": {
    "stars": 314,
    "stars_checked": "2026-11-29",
    "archived": false,
    "fork": false,
    "pushed_at": "2021-06-24T19:08:56Z",
    "language": "GDScript",
    "homepage": null,
    "license_name": "MIT License"
   },
   "provenance": {
    "title": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/wojtekpil/Godot-Octahedral-Impostors",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/wojtekpil/Godot-Octahedral-Impostors",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/wojtekpil/Godot-Octahedral-Impostors",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/wojtekpil/Godot-Octahedral-Impostors",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/wojtekpil/Godot-Octahedral-Impostors",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "license": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/wojtekpil/Godot-Octahedral-Impostors",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": null,
   "__bib": "wojtekpil2020wojtekpil"
  },
  {
   "role": "tutorial",
   "key": "url:https://kvyverse.com/octahedral-tree-impostors",
   "type": "web",
   "title": "Octahedral Tree Impostors with Depth Parallax and Silhouette Strips",
   "authors": [
    "Vlad Krutenyuk"
   ],
   "year": 2026,
   "venue": "kvyverse",
   "url": "https://kvyverse.com/octahedral-tree-impostors",
   "ids": {},
   "license": null,
   "extra": {
    "http_status": 200,
    "live": true,
    "archive": {
     "url": "http://web.archive.org/web/20261129003738/https://kvyverse.com/octahedral-tree-impostors",
     "timestamp": "20261129003738"
    },
    "page_title": null,
    "host": "kvyverse.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-30T18:01:53.730Z"
    },
    "url": {
     "authority": "http",
     "endpoint": "GET https://kvyverse.com/octahedral-tree-impostors → 200",
     "checked_at": "2026-11-30T18:01:53.730Z"
    },
    "authors": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-30T18:01:53.730Z"
    },
    "venue": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-30T18:01:53.730Z"
    },
    "year": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-30T18:01:53.730Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-30T18:01:53.730Z",
   "title_sim": null,
   "__bib": "krutenyuk2026octahedralb"
  },
  {
   "role": "implementation",
   "key": "url:https://kvyverse.com/editor/world/6b0041d2e78fe5de949e5722",
   "type": "web",
   "title": "Octahedral Tree Impostors Live Source (Three.js)",
   "authors": [
    "Vlad Krutenyuk"
   ],
   "year": 2026,
   "venue": "kvyverse Editor",
   "url": "https://kvyverse.com/editor/world/6b0041d2e78fe5de949e5722",
   "ids": {},
   "license": null,
   "extra": {
    "http_status": 200,
    "live": true,
    "archive": null,
    "page_title": null,
    "host": "kvyverse.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-30T18:01:53.730Z"
    },
    "url": {
     "authority": "http",
     "endpoint": "GET https://kvyverse.com/editor/world/6b0041d2e78fe5de949e5722 → 200",
     "checked_at": "2026-11-30T18:01:53.730Z"
    },
    "authors": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-30T18:01:53.730Z"
    },
    "venue": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-30T18:01:53.730Z"
    },
    "year": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-30T18:01:53.730Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-30T18:01:53.730Z",
   "title_sim": null,
   "__bib": "krutenyuk2026octahedral"
  }
 ],
 "presets": [
  {
   "id": "octahedral-impostors-specimen",
   "title": "Octahedral impostor atlas of baked box views, 8x8 directions",
   "runtime": "glsl-fragment",
   "params": {
    "GRID": 8
   },
   "code": "// Octahedral impostor atlas: each cell is a baked orthographic view of a box from the direction that cell encodes via octahedral mapping.\nconst float GRID = 8.0;\nvec3 octDecode(vec2 e) {\n    vec2 f = e * 2.0 - 1.0;\n    vec3 n = vec3(f.x, 1.0 - abs(f.x) - abs(f.y), f.y);\n    if (n.y < 0.0) n.xz = (1.0 - abs(n.zx)) * sign(n.xz);\n    return normalize(n);\n}\nvoid mainImage(out vec4 fragColor, in vec2 fragCoord) {\n    vec2 uv = fragCoord / iResolution.xy * GRID;\n    vec2 cell = floor(uv), f = fract(uv) * 2.0 - 1.0;\n    vec3 dir = octDecode((cell + 0.5) / GRID);        // camera direction for this cell\n    vec3 fw = -dir;\n    vec3 up = abs(dir.y) > 0.95 ? vec3(0, 0, 1) : vec3(0, 1, 0);\n    vec3 rt = normalize(cross(fw, up)); up = cross(rt, fw);\n    vec3 ro = dir * 4.0 + (rt * f.x + up * f.y) * 1.25;\n    vec3 inv = 1.0 / fw;\n    vec3 h = vec3(0.55, 0.9, 0.55);\n    vec3 ta = (-h - ro) * inv, tb = (h - ro) * inv;\n    vec3 tn = min(ta, tb), tf = max(ta, tb);\n    float t0 = max(max(tn.x, tn.y), tn.z), t1 = min(min(tf.x, tf.y), tf.z);\n    vec3 col = vec3(0.07, 0.08, 0.11) + 0.5 * vec3(0.1, 0.15, 0.3) * (0.5 + 0.5 * dir.y) * 0.4;\n    // hit a lower smaller box on top to give the silhouette shape\n    if (t1 > max(t0, 0.0)) {\n        vec3 p = ro + fw * t0;\n        vec3 n = -sign(fw) * step(tn.yzx, tn.xyz) * step(tn.zxy, tn.xyz);\n        float dif = max(dot(n, normalize(vec3(0.5, 0.8, 0.4))), 0.0);\n        vec3 alb = abs(n.y) > 0.5 ? vec3(0.9, 0.75, 0.45) : (abs(n.x) > 0.5 ? vec3(0.4, 0.65, 0.9) : vec3(0.9, 0.45, 0.4));\n        float stripe = 0.85 + 0.15 * sin(p.y * 14.0);\n        col = alb * (0.25 + 0.8 * dif) * stripe;\n    }\n    vec2 g = abs(f);\n    col = mix(col, vec3(0.0), smoothstep(0.03, 0.0, 1.0 - max(g.x, g.y)));\n    fragColor = vec4(pow(col, vec3(0.8)), 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": "octahedral-impostors",
     "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.214,
      "std": 0.1258,
      "unique_colors": 42
     },
     "image": "/specimens/octahedral-impostors-specimen.webp",
     "reason": null
    }
   }
  }
 ],
 "related": [
  "meshlets",
  "nanite-virtualized-geometry",
  "meshoptimizer"
 ],
 "extends": [],
 "supersedes": [],
 "combines_with": [
  {
   "id": "gpu-driven-rendering",
   "why": "Culling produces a per-instance LOD choice that switches far instances to impostor quads in the same indirect draw."
  }
 ],
 "provenance": {
  "prose": "original text written for this index (research draft, editorially reviewed)",
  "sources_verified_at": "2026-11-29T15:51:27.588Z",
  "draft": "data/drafts/performance/octahedral-impostors.json"
 },
 "solves": [
  "thousands of trees too heavy to render as meshes",
  "distant props look flat when camera moves around",
  "need cheap far lods for foliage with lighting",
  "billboards look wrong from different angles"
 ],
 "authority": "Brucks",
 "url": "https://texelatlas.vercel.app/t/octahedral-impostors/",
 "execution_fidelity": "conceptual-diagram",
 "fidelity_label": "Visual Diagram",
 "benchmark_eligible": false,
 "gpu_weight": {
  "weight_x": 2.81,
  "tier": "light",
  "p50_ms": 0.0923,
  "p95_ms": 0.0929,
  "baseline_p50_ms": 0.0329,
  "gpu": "Tesla T4/PCIe/SSE2",
  "resolution": "1920x1080",
  "method": "opengl-timer-query",
  "frames": 40,
  "preset_id": "octahedral-impostors-specimen",
  "execution_fidelity": "conceptual-diagram",
  "fidelity_label": "Visual Diagram",
  "benchmark_eligible": false,
  "generated_at": "2026-11-30T21:07:47Z",
  "l4": {
   "weight_x": 2.16,
   "tier": "light",
   "p50_ms": 0.0343,
   "p95_ms": 0.0351,
   "speedup_x": 2.69,
   "gpu": "NVIDIA L4/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0159
  },
  "a100": {
   "weight_x": 1.56,
   "tier": "feather",
   "p50_ms": 0.0449,
   "p95_ms": 0.045,
   "speedup_x": 2.06,
   "gpu": "NVIDIA A100-SXM4-40GB/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0288
  }
 }
}