Unity 6 HDRP terrain: DX11: Texture index out of range

Unity 6 HDRP

When I add the fifth terrain layer to the terrain, this error appears every second

I have a solution for the DX12: Texture index out of range error in Unity 6 HDRP. I encountered this issue myself and found the thread, but not a solution. It happened when I added more than 4 Layer Palette entries. Eventually, I figured out how to fix it through trial and error.

There are two approaches:

  1. Create a new material:
  • Use the HDRP/TerrainLit shader.
  • Disable the “Receive Decals” option.
  • Assign this material to your terrain.
  1. Adjust project settings:
  • Go to Project Settings > Quality > HDRP > Decals and enable decals.

Both methods worked for me—the error disappeared and the crashes stopped.

I also recommend not using one giant terrain. Instead, create smaller chunks (for example, 100x100 meters) and link them together. This is more performance-friendly, and since each chunk can have its own set of layers, you can often keep within the 4-layer limit per chunk.

1 Like

I recently encountered a reproducible bug triggered under these specific conditions:

  1. Working in Unlit Shading mode
  2. Adding a fifth Terrain Layer
  3. Having at least one existing Terrain Layer with a Mask Map texture

Therefore, the bug will NOT occur if:

  • You’re not in Unlit Shading mode, or
  • No Terrain Layer uses a Mask Map texture

I must say, I’m a bit surprised this hasn’t been addressed yet if it’s indeed a bug.

4 Likes

I can confirm this, Unity 6000.0.40 (and I believe Unity 6000.0.54) with DX12 still have the issue.

3 Likes

Still happens in Unity 6.3.5 with DirectX 12.