Being Preemptive With UDIM Atlases
Opening Notes
Most of what I’ve written here has been about digging out of a hole. The HWRT post and the Nanite cluster post were both firefights, performance exploded and we went hunting.
This one is the opposite. It’s about a decision we made before it would become a problem.
Same project as before: Trollheim: Gnomes, a dense open world, everything Nanite, everything instanced at scale through PCG, and a player avatar the size of a mouse.

Screenshot from our title Trollheim: Gnomes.
When you build a world like that, the asset count gets away from you fast. Hundreds of foliage variants, trees, rocks, construction pieces, etc. And if every one of those assets arrives with its own texture set and its own material instance, each one becomes its own shading bin (indirect compute dispatch) that the shading pass pays for, every frame. I will explain this in more detail later.

Screenshot of the shading bin debug view, showing a scene full of shading bins due to assets having a lot of different materials. Every unique color is a bin.
So we decided early that Foliage, Trees and Construction, etc., would each get one master material with UDIM support, and that the texture work would be authored into shared UDIM atlases from day one.
This post covers why we took that decision and how we built the pipeline and tools to make it work.
But first, some more information about shading bins.
Raster And Shading Bins
Nanite runs in its own rendering pass that bypasses traditional draw calls entirely. The old draw-call-per-mesh problem I spent so much time on in Mannequin is simply gone. Instance count is nearly free on the raster side.
What you’re actually fighting is the number of bins, and the number of indirect dispatches that come with them.
That’s the thing a UDIM atlas collapses, and this adds up quickly to a real cost even though it hides from the counters you’d instinctively check.
Nanite shades in two stages, and each stage sorts work into bins.
A raster bin is a unique combination of material properties that affect rasterization. It can be the blend mode, if the material is one-sided versus two-sided, and whether the material needs programmable raster (World Position Offset, pixel depth offset, masked opacity) rather than the fixed-function path.
A shading bin is, in the simplest terms, one unique material in the visibility buffer.
We will focus on shading bins in this post, but with that said, keeping as much as possible in the fixed-function pass is something we strove for early too. You do this by disabling WPO, tessellation, etc., based on camera distance. The closer you can set it the better.
Each shading bin gets its own indirect compute dispatch, running that material’s shader graph over only the pixels it covers.
If you want the full picture of how this works, Graham Wihlidal’s GDC 2024 talk Nanite GPU Driven Materials is a good source, and Scthe’s notes on it are an excellent condensed read.
Why Bin Count Is The Thing To Watch
Here’s the part that made us act early.
The CPU has to launch every possible shading bin dispatch, because it can’t know which bins the GPU culling will leave empty.
Think about what a forest looks like from a bin perspective. Hundreds of foliage variants, each with its own texture set, each needing its own material instance to point at those textures. A simple plant can carry three or more bins on its own, so the ground cover alone runs into the hundreds before you count a single tree.

Another screenshot from our forest in shading bin visualisation mode, before atlases. Several of our plants consist of multiple shading bins each.
And on top of this we have bins behind the camera, bins occluded by a hill, bins that are sub-pixel in the distance. They all still cost something.
Every unique material in your scene is another bin, another dispatch, and another piece of per-frame overhead that exists whether or not it covers any pixels.
Foliage is the worst case for shading bins, because variation is the whole point of it, and a single asset rarely stops at one material. Most of them have different parts that require different material types. Leaves use two-sided materials, other parts like berries require another type with subsurface scattering and the list goes on.
The shading bin count is the part a UDIM atlas removes.
In short, all those assets add to the material instance count, and converting them into one UDIM-driven material instance per domain collapses them into a single bin.
We had also already committed to virtual textures, which is required for UDIM. Epic recommends them for Nanite projects anyway, so that didn’t add a dependency we weren’t already carrying.
These were the arguments that made the decision easy.
Why UDIM And Not A Packed Atlas
Once we agreed on one master material per domain, the question was how to get many assets’ textures behind one material instance.
The traditional answer is a packed atlas: lay everything out in one 0-1 UV space, pack it by hand and fight bleeding at the seams. We’ve all done it. It does not scale very well across a team.
A UDIM set is just a naming convention, T_Foliage_C.1001.png, T_Foliage_C.1002.png, and so on. On import Unreal brings the whole set in as a single Virtual Texture asset. Each tile maps to its own 0-1 UV space.
That gives us three things we cared about:
- No packing. We give each asset its own tile, so its UVs stay in a clean 0-1 space, just offset by the tile index.
- No re-packing. Adding an asset means adding a tile. Existing tiles keep their coordinates.
- Per-tile resolution. Each tile’s density comes from its own source file, independent of every other tile. A 128x128 pebble tile sits beside a 2048x2048 bark tile at no extra cost.
The UDIM Atlas Tool
None of the above survives unless artists can actually work this way. A shared texture set is a shared resource, and shared resources are where pipelines go to die; two people touch the same atlas and one of them loses work.
So we built a tool around it, UDIM Builder.
It’s a small standalone app that turns a folder of textures into editable UDIM tile sets. The builder checks out a set’s config the moment someone starts editing it and syncs sources before every build; a source checked out by somebody else blocks the build and so does a source with unsaved edits, making no room for mistakes or lost work.
Getting it into Unreal is a one button press; the import button reads the manifest and imports into whatever path and name that set’s config specifies, reimporting in place if the asset already exists or creating it fresh at that location if it doesn’t.

The UDIM atlas tool.
Results
So let’s look at the before pictures again and compare it against a new one with everything in a UDIM atlas.

Shading bin debug visualization before the atlases.

A section of the forest after the atlas fix. Notice that the foliage and trees are now drawn in one bin each.
As you can see, all actors using the same material got their shading bin count reduced to one.
Almost all ground foliage got reduced to one bin and all the trees to one, not counting the ones with moss on them.
I do not have any good before and after stat numbers due to the fact that we did this so early in production. But knowing how it was at the point when I joined the team and already noticing the growth of bins per asset so early, it’s not too hard to imagine how big the count would be if we let it be.
Ending Notes

Screenshot from our title Trollheim: Gnomes.
Most of the posts I’ve written here have been about paying down a performance debt, so it’s a nice change to write about something you get to do preemptively instead. Bin count turns out to be one of those rare things that’s decided almost entirely by pipeline structure, and if you decide it on day one it costs a few days of tool work. Decide it in year two and you and the team have to edit UVs and reimport everything.
The nice part about using a tool is that nobody on the art team has to remember a rule for it. An artist just thinks about their asset and their tile, and the bin count quietly stays low as a side effect. A stripped-down version of the tool, with the project-specific parts taken out, is on GitHub if any of it is useful to you.
And once again, thanks to the art team for being willing to change how they author and import textures, and for testing the tool while it was still rough.
I hope this post was interesting, and maybe convinced you to look at your shading bin count before it becomes a problem.
Every bin you don’t create is one less dispatch for the CPU, and less waiting for the GPU. Be nice to your CPU and GPU.
Comments
Reply on Bluesky to leave a comment.