When using the Niagara Mesh Renderer with multiple mesh variants selected via MeshIndex, the number of TLAS instances allocated is NumParticles × NumMeshVariants and enabling the Path Tracer can cause a 24-bit InstanceId overflow:
Ensure condition failed: InstanceDesc.InstanceId <= 0xFFFFFF [File: RayTracingInstanceBufferUtil.cpp] [Line: 316] InstanceId must fit in 24 bits.
GetDynamicRayTracingInstances() in NiagaraRendererMeshes.cpp (line ~1660) force-disables sort/cull for the RT path:
ParticleMeshRenderData.bNeedsSort = false; ParticleMeshRenderData.bNeedsCull = false; ParticleMeshRenderData.bSortCullOnGpu = false;
This causes PerformSortAndCull() to return the total particle count for every mesh variant,. Each mesh variant creates an FRayTracingInstance with NumTransforms set to all particles. The total TLAS instances is NumParticles × NumMeshVariants. The raster path handles this correctly via SortAndCullIndices / FNiagaraSortCullHelper::IsVisibile() which filters by MeshIndex.
The InstanceId is set to InstanceSceneDataOffset + TransformIndex with bIncrementUserDataPerInstance = true (in PrimitiveSceneInfo.cpp:SetupCachedRayTracingInstance), which can exhausts the 24-bit DXR InstanceId space.
Re-enable MeshIndex culling for the RT path. For CPU sims, the existing FNiagaraSortCullHelper already filters by MeshIndex — remove the force-disable in the RT path and call InitializeSortInfo before PerformSortAndCull. For GPU sims, a lightweight count pass or one-frame-latent readback of per-variant counts would be needed since particle data is not CPU-accessible.
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-381970 in the post.
| 0 |
| Component | UE - Rendering - Graphics Features - Ray Tracing |
|---|---|
| Affects Versions | 5.7, 5.8 |
| Created | May 28, 2026 |
|---|---|
| Updated | Jun 3, 2026 |