Instant NGP (Multiresolution Hash Encoding)
Replaces large coordinate MLPs with a small network fed by a multiresolution hash table of trainable features, training NeRFs and SDFs in seconds to minutes on one GPU.
Also known as Instant-NGP, hash grid encoding
In the family Capture, reconstruction & splatting, neural scene representation
Where it runs
Built inOfficial add-onPluginNone foundNot researched
| Engine | Support | How |
|---|---|---|
| three.js r187 | None found | |
| Babylon.js 9.38.0 | None found | Multiresolution hash-grid NeRF rendering is not built in. |
| Godot 4.7 | Not applicable | Offline reconstruction/generative method, not an engine feature. |
| Unity | None found | |
| Unreal 5.7 | None found | External multiresolution hash-grid NeRF framework; not built into Unreal Engine. |
| Blender 5.2 | Plugin | Blender add-on: BlenderNeRF (exports Instant NGP datasets) docs Dataset export only; training is external. |
| WebGPU W3C | None found | |
| Metal | None found |
How it works
The input position is looked up in several grids of increasing resolution. Each level hashes its integer corner coordinates into a fixed-size table of trainable feature vectors, interpolates trilinearly between corners, and the per-level features are concatenated. Hash collisions are tolerated: the small downstream MLP and gradient averaging resolve them in favour of the cells that matter. Because most of the capacity sits in the table, the MLP can be tiny and is fused into one CUDA kernel, so training is bandwidth-bound rather than FLOP-bound. An occupancy grid skips empty space during ray marching. The same encoding works for NeRF, signed distance functions, images and neural volumes.
When to choose it
Reach for it when
- nerf training takes hours
- want a neural radiance field in minutes on one gpu
- large coordinate network trains too slowly
- need interactive preview of a neural scene while training
Choose it when you want a NeRF or neural SDF trained in minutes and previewed interactively on an NVIDIA GPU. Prefer 3D Gaussian Splatting for higher render speed and quality on large scenes, Mip-NeRF 360 when anti-aliasing and unbounded quality matter more than training time, and Neuralangelo for high-fidelity surfaces built on the same hash encoding.
Field marks
- Hash collisions add high-frequency noise and speckle when the table is too small for the scene
- Floaters and background fog in sparsely observed regions, as in vanilla NeRF
- Not anti-aliased across scales, so zoomed-out views alias
- Tied to NVIDIA GPUs and a non-commercial research licence in the reference code
Presets
Hash encoding configuration used for NeRF
{
"n_levels": 16,
"n_features_per_level": 2,
"log2_hashmap_size": 19,
"base_resolution": 16,
"mlp_hidden_layers": 1,
"mlp_neurons": 64
}Attribution: Values follow the configuration reported in the paper; the reference repo NVlabs/instant-ngp is under NVIDIA's non-commercial source code licence. · basis: 0
Instant NGP — multiresolution spatial hash-grid levels (left) vs decoded high-frequency NeRF (right)
{
"P_HASH_LEVELS": 5,
"P_SIGMA_GAIN": 5.2,
"P_ROT_SPEED": 0.58,
"P_SPLIT": 0.48
}Show GLSL (128 lines)
const float P_HASH_LEVELS = 5.0; // P Hash Levels L [1.0, 6.0, 1.0]
const float P_SIGMA_GAIN = 5.2; // P Volume Sigma [1.5, 10.0, 0.25]
const float P_ROT_SPEED = 0.58; // P Orbit Speed [0.0, 2.2, 0.05]
const float P_SPLIT = 0.48; // P Hash Grid / NGP [0.0, 1.0, 0.02]
mat2 rot2(float a) { float c = cos(a), s = sin(a); return mat2(c, -s, s, c); }
float hash31(vec3 p) {
p = fract(p * 0.1031);
p += dot(p, p.yzx + 33.33);
return fract((p.x + p.y) * p.z);
}
// Multiresolution hash-encoded neural feature sum across geometric cascade resolutions N_l = N_min * b^l
float evalHashFeatures(vec3 p, float maxL) {
float acc = 0.0;
float res = 3.0;
float amp = 0.5;
for (int l = 0; l < 6; l++) {
if (float(l) >= maxL) break;
vec3 gp = p * res;
vec3 cell = floor(gp);
vec3 f = fract(gp);
f = f * f * (3.0 - 2.0 * f);
// Trilinearly interpolated hashed vertex features (mimicking T-entry spatial hash table)
float v000 = hash31(cell);
float v100 = hash31(cell + vec3(1.0, 0.0, 0.0));
float v010 = hash31(cell + vec3(0.0, 1.0, 0.0));
float v110 = hash31(cell + vec3(1.0, 1.0, 0.0));
float v001 = hash31(cell + vec3(0.0, 0.0, 1.0));
float v101 = hash31(cell + vec3(1.0, 0.0, 1.0));
float v011 = hash31(cell + vec3(0.0, 1.0, 1.0));
float v111 = hash31(cell + vec3(1.0, 1.0, 1.0));
float c00 = mix(v000, v100, f.x);
float c10 = mix(v010, v110, f.x);
float c01 = mix(v001, v101, f.x);
float c11 = mix(v011, v111, f.x);
float c0 = mix(c00, c10, f.y);
float c1 = mix(c01, c11, f.y);
acc += (mix(c0, c1, f.z) - 0.5) * amp;
res *= 1.85;
amp *= 0.54;
}
return acc;
}
vec3 aces(vec3 x) {
x = max(x, 0.0);
return (x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14);
}
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;
float screenX = fragCoord.x / max(iResolution.x, 1.0);
float split = clamp(P_SPLIT, 0.0, 1.0);
bool isGrid = screenX < split;
float maxL = clamp(floor(P_HASH_LEVELS + 0.5), 1.0, 6.0);
float sigmaGain = clamp(P_SIGMA_GAIN, 1.0, 12.0);
float spin = iTime * max(P_ROT_SPEED, 0.0);
vec3 ro = vec3(0.0, 0.22, 2.28);
vec3 rd = normalize(vec3(uv - vec2(0.0, 0.03), -1.52));
ro.xz = rot2(spin * 0.52) * ro.xz;
rd.xz = rot2(spin * 0.52) * rd.xz;
vec3 bg = mix(vec3(0.018, 0.025, 0.044), vec3(0.052, 0.072, 0.120), smoothstep(-0.55, 0.55, uv.y));
vec3 col = bg;
float b = dot(ro, rd);
float c = dot(ro, ro) - 1.02 * 1.02;
float disc = b * b - c;
if (disc > 0.0) {
float t0 = max(-b - sqrt(disc), 0.1);
float t1 = -b + sqrt(disc);
float dt = (t1 - t0) / 44.0;
vec3 acc = vec3(0.0);
float T = 1.0;
vec3 lDir = normalize(vec3(0.58, 0.80, 0.45));
for (int i = 0; i < 44; i++) {
float t = t0 + (float(i) + 0.5) * dt;
vec3 p = ro + rd * t;
// Sculpted bonsai-arch/crystal core modulated by multiresolution hash encoding
float baseD = length(p) - 0.58;
float ringD = length(vec2(length(p.xz) - 0.52, p.y)) - 0.16;
float dShape = min(baseD, ringD);
float hf = evalHashFeatures(p, maxL);
float d = dShape + hf * 0.22;
float sigma = exp(-max(d, 0.0) * 20.0) * smoothstep(0.14, -0.04, d) * sigmaGain;
if (isGrid) {
// Left: Visualize active occupancy grid + multiresolution hash-lattice wireframe
vec3 gCoarse = abs(fract(p * 4.0) - 0.5);
vec3 gFine = abs(fract(p * 10.0) - 0.5);
float wC = smoothstep(0.04, 0.01, min(gCoarse.x, min(gCoarse.y, gCoarse.z)));
float wF = smoothstep(0.05, 0.012, min(gFine.x, min(gFine.y, gFine.z))) * smoothstep(0.18, -0.05, dShape);
vec3 hashCol = 0.5 + 0.5 * cos(vec3(0.0, 2.1, 4.2) + hf * 8.0 + p.y * 2.5);
float sVis = sigma * 0.45 + wC * 0.35 + wF * 1.4;
float a = 1.0 - exp(-sVis * dt);
vec3 rad = mix(vec3(0.14, 0.78, 0.96) * wC + vec3(0.98, 0.62, 0.18) * wF, hashCol, clamp(sigma * 0.25, 0.0, 1.0));
acc += T * a * rad * 1.25;
T *= (1.0 - a);
} else {
// Right: Tiny fused MLP radiance decode with sharp high-frequency surface detail
float a = 1.0 - exp(-sigma * dt);
if (a > 0.005) {
vec3 n = normalize(p + vec3(hf * 0.8, hf * 0.6, -hf * 0.7) + vec3(1e-4));
float diff = max(dot(n, lDir), 0.0);
float spec = pow(max(dot(n, normalize(lDir - rd)), 0.0), 36.0);
vec3 alb = mix(vec3(0.16, 0.66, 0.88), vec3(0.96, 0.52, 0.22), smoothstep(-0.35, 0.35, hf + p.y * 0.5));
vec3 rad = alb * (0.30 + 0.82 * diff) + vec3(1.0, 0.95, 0.88) * spec * 0.45;
acc += T * a * rad;
T *= (1.0 - a);
}
}
if (T < 0.015) break;
}
col = acc + T * bg;
}
float sep = smoothstep(0.0035, 0.0008, abs(screenX - split));
col = mix(col, vec3(0.95, 0.97, 1.0), sep);
fragColor = vec4(pow(clamp(aces(col), 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);
}Attribution: MIT — written for this index.
Measured GPU weight & timing
| Preset | GPU | Weight / p50 / p95 | Method |
|---|---|---|---|
| instant-ngp-live | Tesla T4 1920x1080 | 477× baseline (extreme) · 15.7 ms / 15.8 ms | opengl-timer-query · 16 frames · GPU Weight Atlas · Colab T4 sweep |
| instant-ngp-live | NVIDIA L4 1920x1080 | 423× baseline (extreme) · 6.72 ms / 6.80 ms · 2.3× faster on L4 | opengl-timer-query · Cross-architecture validation |
| instant-ngp-live | NVIDIA A100-SXM4-40GB 1920x1080 | 364× baseline (extreme) · 10.5 ms / 10.5 ms · 1.5× faster on A100 | opengl-timer-query · Cross-architecture validation |
Lineage
From the citation graph (Crossref reference lists): its primary source cites Neural Radiance Caching, OpenVDB, NanoVDB; cited by 2D Gaussian Splatting, 4D Gaussian Splatting, DreamGaussian, 3D Gaussian Splatting, Hierarchical Binary-Tree 3DGS LOD & Paged Streaming, Large Reconstruction Model (LRM), Mip-Splatting, Random-access neural texture compression, Neuralangelo, Gaussian splats drawn as brush marks, StopThePop (Sorted Gaussian Splatting), Stylized Gaussian splatting (G-Style), Stylized nonlinear Monte Carlo rendering, TexFusion.
Crosses
- Neuralangelo: Neuralangelo uses the multiresolution hash grid as its SDF feature backbone.
Sources
- primaryThomas Müller, Alex Evans, Christoph Schied, Alexander Keller (2022). Instant neural graphics primitives with a multiresolution hash encoding. ACM Transactions on Graphics.Verified via crossref · 2026-11-29doi:10.1145/3528223.3530127
- primaryThomas Müller, Alex Evans, Christoph Schied, Alexander Keller (2022). Instant Neural Graphics Primitives with a Multiresolution Hash Encoding. ACM Trans. Graph. 41, 4, Article 102 (July 2022), 15 pages.Verified via arxiv · 2026-11-29doi:10.1145/3528223.3530127 · arXiv:2201.05989
- implementationNVlabs (2022). NVlabs/instant-ngp. Instant neural graphics primitives: lightning fast NeRF and moreGitHub API · license NOASSERTION · 2026-11-29
- tutorialNVIDIA Research. Instant Neural Graphics Primitives project page. nvlabs.github.io.Verified via live page · 2026-11-29