Instanced Geometry
GPU ハードウェア・インスタンシング(一つのメッシュの多数の複製を単一の描画呼び出しで描く)は、2000年代半ばのプログラマブル・パイプラインとともにリアルタイムグラフィックス API(OpenGL/Direct3D)に導入された。特定の作品技法というより描画プリミティブ。
コミュニティ・通称 名称 — 命名・エポニムではなく記述的なカテゴリ名。用語の単一の命名者は確認されていない。
ひとことで 同一ジオメトリを大量に GPU インスタンス化して並べる 3D テクニック。森・パーティクル・ボクセル群に使われる。
コード
上のデモの実際のスケッチ(サンドボックスで再現可能)。これで全部です。
instanced-geometry/index.html
const SEED = Math.floor(Math.random()*1e9);
// A dense field of identical boxes (the "instanced" primitive) on a grid,
// each extruded in height by a noise field — a rotating 3D bar-chart cityscape.
let GN, hueBase;
function setup() {
randomSeed(SEED); noiseSeed(SEED);
const s = Math.min(windowWidth, windowHeight);
createCanvas(s, s, WEBGL);
colorMode(HSB, 360, 100, 100);
GN = 22;
hueBase = random(360);
}
function draw() {
background(230, 50, 10);
const s = width;
ambientLight(0, 0, 30);
directionalLight(0, 0, 90, 0.3, 0.7, -0.5);
pointLight((hueBase+40)%360, 50, 100, 0, -s*0.3, s*0.4);
rotateX(-0.9);
rotateZ(frameCount * 0.004);
const span = s * 0.7;
const step = span / GN;
const t = frameCount * 0.01;
noStroke();
for (let i = 0; i < GN; i++) {
for (let j = 0; j < GN; j++) {
const nx = i/GN, nz = j/GN;
const hgt = (noise(nx*2.2 + t, nz*2.2) ** 2) * s * 0.6 + 2;
push();
translate(-span/2 + i*step + step/2, 0, -span/2 + j*step + step/2);
translate(0, -hgt/2, 0);
ambientMaterial((hueBase + hgt*0.25) % 360, 60, 90);
box(step * 0.82, hgt, step * 0.82);
pop();
}
}
}仕組み
基本メッシュ(頂点/インデックス)を一度アップロードし、各複製のパラメータ(通常は 4×4 変換行列+色/スケール)を持つインスタンス属性バッファを与える:(1) インスタンスバッファを CPU(または compute/GPGPU パス)で構築 — 各複製の位置・回転・スケールを、ノイズ・グリッド・パッキングで配置、(2) N インスタンスのインスタンス描画を 1 回発行し、頂点シェーダが gl_InstanceID/インスタンス属性を読んで共有メッシュを所定位置へ変換、(3) GPU がオブジェクト毎の CPU オーバーヘッドなしに全 N を描画するため、数万〜数十万でもリアルタイム。ジオメトリでなくインスタンスバッファだけをアニメートすれば、全体を安価に動かせる。
パラメータ
instanceCount: number — Number of copies drawn in a single batched call.baseGeometry: string — The mesh replicated per instance (box, sphere, etc.).transforms: array — Per-instance position/rotation/scale applied to the base mesh.
系譜
よく組み合わされるアルゴリズム
- Fragment Shader (GLSL) · 13 作品
- 3D Mesh / Geometry · 12 作品
- Perlin / Simplex Noise · 8 作品
- Raymarching with SDFs · 3 作品
- Geometric / Hexagonal Tiling · 2 作品
- Bezier / Catmull-Rom Splines · 2 作品
- Plotter-style Hatching · 2 作品
- Glitch / Datamosh · 2 作品
- Dithering · 1 作品
- Strange Attractor · 1 作品
- Boids / Flocking · 1 作品
- Quadtree / Recursive Quad Split · 1 作品
このアルゴリズムを使う作品 (18)
Agglo
leander-herzog
Assemblage
sab-k2xl
Augmented Sequence
toiminto
Beauty of Skateboarding
jeanvascript
Chimera
mpkoz
Democracity
generative-artworks
Escherly Seeds
martijn-cohen
Fushi No Reality - フシノゲンジツ
samsy
Gas Wars
jack-butcher
Immaterial
bj-rn-staal
Isodream
henrysdev-amnda
Jiometory No Compute - ジオメトリ ハ ケイサンサレマセン
samsy
l.o
night-sea
Melancholic Magical Maiden
emi-kusano
Mind Maze
parse-error
Structura
office-ca-protocelllabs
Transitions
jason-ting-x-matt-bilfield
Vahria
darien-brito
最終更新 2026-07-16