# Nanite shading bin indices above 16383 are silently truncated, causing unrelated materials to shade visible meshes 

**URL:** <https://forums.unrealengine.com/t/nanite-shading-bin-indices-above-16383-are-silently-truncated-causing-unrelated-materials-to-shade-visible-meshes/2876674>\
**Category:** Issues and Bug Reporting (Unreal Engine)\
**Tags:** unreal-engine, Nanite\
**Created:** [December 3, 2026, 3:19pm UTC](https://forums.unrealengine.com/t/nanite-shading-bin-indices-above-16383-are-silently-truncated-causing-unrelated-materials-to-shade-visible-meshes/2876674 "2026-12-03T15:19:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ynqqqqqq](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ynqqqqqq](https://forums.unrealengine.com/u/ynqqqqqq)\
**Post date:** [December 3, 2026, 3:19pm UTC](https://forums.unrealengine.com/t/nanite-shading-bin-indices-above-16383-are-silently-truncated-causing-unrelated-materials-to-shade-visible-meshes/2876674/1 "2026-12-03T15:19:33Z")

</div>

### Summary

In Unreal Engine 5.6.1 on Windows with DirectX 12, Nanite shading bin indices above 16383 are silently truncated, causing meshes to be shaded using unrelated materials.

FNaniteShadingPipelines::AllocateBin() permits 16-bit indices, but PackShadingMask() and UnpackShadingMask() in NaniteDataDecode.ush store and extract only 14 bits. Higher indices therefore alias lower, valid material indices.

This concerns scene-wide Nanite shading bins, not the material slot count of an individual mesh.

### What Type of Bug are you experiencing?

Rendering (Graphics / Niagara)

### Steps to Reproduce

The following sequence reproduces the issue in our existing application. A standalone minimal reproduction has not yet been validated.

1. Populate a scene with Nanite-enabled meshes using enough independent dynamic material instances to exceed the 14-bit shading bin range.
2. Load additional Nanite-enabled meshes with distinct materials into the same scene.
3. Confirm that some newly registered materials receive shading bin indices greater than 16383.
4. Observe the affected meshes rendering with unrelated materials.
5. Rebuild cached rendering state, such as by toggling fullscreen. The visible rendering may recover as shading bin assignments change.

### Expected Result

Nanite should render each mesh using its assigned material.

The CPU allocator and GPU encoding should support consistent index ranges. If the supported capacity is exceeded, the engine should provide an explicit diagnostic or controlled handling rather than silently selecting unrelated materials.

### Observed Result

Indices above 16383 lose their upper bits during shading mask encoding and alias unrelated materials.

RenderDoc captures confirmed these examples:  
Assigned shading bin Truncated index  
16995 611  
17167 783  
17082 698

The unrelated materials at bins 611, 783 and 698 execute nonzero shading dispatches, while the intended materials execute zero shading groups. Affected surfaces display incorrect textures and emissive patterns.

After rebuilding cached rendering state, the same intended materials receive indices within the 14-bit range and render correctly.

### Affects Versions

5.6

### Platform(s)

Windows
