---
id: "instant-ngp"
title: "Instant NGP (Multiresolution Hash Encoding)"
aliases: [Instant-NGP, hash grid encoding]
domain: "capture"
stage: "capture"
realtime: "interactive"
platforms: [cuda]
year_introduced: 2022
inputs: [photos, camera-poses]
outputs: [radiance-field, sdf]
style: "photoreal"
dynamic: "static"
cost: "offline"
authority: "Müller et al., 2022"
url: "https://texelatlas.vercel.app/t/instant-ngp/"
sources_verified_at: "2026-11-29"
---
# Instant NGP (Multiresolution Hash Encoding) (Müller et al., 2022)

> 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.

## 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

## 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 use it

Choose it when you want a NeRF or neural SDF trained in minutes and previewed interactively on an NVIDIA GPU. Prefer [3D Gaussian Splatting](https://texelatlas.vercel.app/t/gaussian-splatting-3dgs.md) for higher render speed and quality on large scenes, [Mip-NeRF 360](https://texelatlas.vercel.app/t/mip-nerf-360.md) when anti-aliasing and unbounded quality matter more than training time, and [Neuralangelo](https://texelatlas.vercel.app/t/neuralangelo.md) for high-fidelity surfaces built on the same hash encoding.

## Cost

offline — Paper-reported training in seconds to a few minutes on a single high-end NVIDIA GPU; requires CUDA/tiny-cuda-nn.
Measured GPU Weight: 476.58× baseline (extreme) — 15.6795 ms median / 15.8455 ms p95 on Tesla T4/PCIe/SSE2 @ 1920x1080 (opengl-timer-query).
Ada L4 scaling: 422.87× baseline (extreme) — 6.7236 ms median (2.33× faster on L4).
Ampere A100 scaling: 363.57× baseline (extreme) — 10.4709 ms median (1.5× faster on A100).

## Failure modes

- 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

## Engine support

- blender: plugin — `Blender add-on: BlenderNeRF (exports Instant NGP datasets)` (evidence: https://github.com/maximeraafat/BlenderNeRF, checked 2026-12-01) — Dataset export only; training is external.

## Dataflow

- Inputs: photos, camera-poses
- Outputs: radiance-field, sdf
- Platforms: cuda

## Presets

### Hash encoding configuration used for NeRF (json-params; parameter preset)

```json
{
  "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) (glsl-fragment; rendered 2026-11-30)

```json
{
  "P_HASH_LEVELS": 5,
  "P_SIGMA_GAIN": 5.2,
  "P_ROT_SPEED": 0.58,
  "P_SPLIT": 0.48
}
```

```glsl
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.

## Lineage

- extends [Neural Radiance Fields (NeRF)](https://texelatlas.vercel.app/t/nerf.md)

## Combines with

- [Neuralangelo](https://texelatlas.vercel.app/t/neuralangelo.md): Neuralangelo uses the multiresolution hash grid as its SDF feature backbone.

## Sources

1. [primary] Thomas Müller, Alex Evans, Christoph Schied, Alexander Keller (2022) Instant neural graphics primitives with a multiresolution hash encoding. ACM Transactions on Graphics. https://doi.org/10.1145/3528223.3530127 (verified via crossref on 2026-11-29)
2. [primary] Thomas 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. https://arxiv.org/abs/2201.05989 (verified via arxiv on 2026-11-29)
3. [implementation] NVlabs (2022) NVlabs/instant-ngp. https://github.com/NVlabs/instant-ngp License: NOASSERTION. (verified via github on 2026-11-29)
4. [tutorial] NVIDIA Research Instant Neural Graphics Primitives project page. nvlabs.github.io. https://nvlabs.github.io/instant-ngp (verified via http on 2026-11-29)

## Cite this entry

Texel. "Instant NGP (Multiresolution Hash Encoding)." https://texelatlas.vercel.app/t/instant-ngp/ (accessed 2026-12-01).
