Nanite principle — billions of triangles, one screen (3D)
About this app
A rock with 12.6 million triangles, split into clusters of 128 triangles: each cluster is drawn just fine enough that its error stays below one pixel. As you fly closer the coloured clusters break into finer ones live; roughly as many triangles are drawn as there are pixels. Comparison with classic LOD, seams, frozen selection. Principle recreated, not Unreal Engine software.
As many triangles as pixels
A screen has only a few million pixels. Drawing a model with billions of triangles in full would be wasteful, because most triangles would be smaller than a pixel. Virtualized geometry, as implemented by Nanite in Unreal Engine, therefore splits the model into small clusters of about 128 triangles each and stores several levels of detail for every cluster. Each frame it picks, per cluster, the coarsest level whose on-screen error stays below roughly one pixel. The number of triangles drawn thus stays close to the number of pixels, however detailed the model is.
What the app shows
A sandstone block with up to 12.6 million triangles, or 3.1 million on a phone. In cluster view each cluster has its own colour; as the camera flies closer the clusters split into finer ones live, and the counter of drawn triangles stays roughly constant as long as the block fills the screen. Further views show individual triangles, detail levels and the split between software and hardware rasterizer. A comparison shows classic LOD with three fixed levels for the whole model. Principle recreated, not Unreal Engine software.
Try it yourself
Let the camera fly in or choose distances from 1 to 5, change the error threshold from 0.5 to 8 pixels and switch the model size: the model then holds many times more triangles, yet almost the same number is drawn. Turn off seam closing to see cracks between coarse and fine clusters, and freeze the selection to look at it from outside.
Frequently asked questions
- What is Nanite in Unreal Engine?
- Nanite is the virtualized geometry system of Unreal Engine 5. It splits highly detailed models into clusters with several levels of detail and, every frame, picks for each cluster the level whose on-screen deviation is below about one pixel. This makes models with millions to billions of triangles renderable in real time.
- How is Nanite different from classic LOD?
- Classic level of detail switches the whole model between a few fixed levels by distance; the switch is visible as popping, and up close the entire model is drawn in full detail. Nanite chooses the level for every small cluster individually by its pixel error, so only visible, nearby areas are drawn finely.
- Does a model with more triangles make a game slower?
- With virtualized geometry hardly at all, as long as the model is split into clusters: roughly as many triangles are drawn as pixels are covered. More triangles in the model mainly cost memory, not drawing time. With classic rendering, time grows with the triangle count.
- Is the Nanite principle app Unreal Engine software?
- No. It recreates the principle in simplified form in the browser: with a quadtree hierarchy instead of the original's cluster graph, grid simplification and no real software rasterizer. The numbers depend on window size and device.
Subject: Computer science
More from Computer science
- Ackermann function
- Elevator simulator
- Binary workshop
- Binary versus linear search
- The Collatz problem
- Inside a CPU
- Swap the inside
- One frame in 16 milliseconds — how a game engine renders an image (3D)
A VisuApp by heyprof: interactive, free in your browser, no sign-up. What is a VisuApp? · All apps