New video by the architect of Epic's Nanite system for Unreal Engine 5:
- This is heavy going and fascinating. A few key points.
- Their goal is constant-time rendering regardless of scene complexity. That seems impossible, but it's not. The key concept is that the number of pixels on screen is fixed, and thus, in theory, the number of triangles you need to display is, too. Once triangles are smaller than pixels, that's as small as you need to go. So, ideally, the total number of triangles being drawn is about 2x the number of pixels. Which is not too hard with current hardware.
- Right now, this only works for opaque, static meshes. No deformations or rigging yet. That will come.
- The Nanite LOD system is designed to take a big mesh and display any part of it at any level of detail. They start with a mesh with some huge number of triangles.Then then find small clusters which fit certain complicated geometric criteria. Those areas can be rendered either with all the triangles, or as a reduced version with half as many. The outer boundary of the cluster remains the same. This is done recursively upwards. (I'm not sure how they keep the edges of larger clusters from having thousands of tiny edge triangles.) At display time, the level of detail shown for each section of the mesh goes down to the level necessary to keep triangles roughly smaller than pixels.
- With all those tiny triangles, the fill problem is completely different than it is normally. The GPU fill hardware doesn't help much when you're filling a partial pixel. So they do a lot of that in the CPUs.
- There are some very format-specific compression and streaming mechanisms to handle storing and fetching all that data efficiently.
A huge amount of effort went into this. It's impressive from a theoretical perspective. They're reduced an O(N) problem to an O(1) problem.