LerpworksAcademy
On this page

Graphics › The frame

LOD, instancing and Nanite: drawing a million blades of grass

Know first: Shader: a function for every pixel, Material: a shader plus data, Depth buffer: what is closer to the camera

A meadow holds a million blades of grass, and a forest holds tens of thousands of trees. A graphics card cannot draw all of that at full detail sixty times a second, and the processor cannot send a million commands in that time. Three techniques keep a big scene within budget: use less detail where nobody can see it (LOD), draw identical things with one command (instancing), and skip what is hidden (culling). The lesson also shows how Nanite handles all this on its own, one piece of a model at a time. This is the twelfth lesson of the course “How an engine draws a frame.”

Why this matters

Take a field of 100 × 100 meters with a hundred blades on every square meter. That is a million blades, and each has at least four triangles. Add trees, rocks and houses, and the scene weighs hundreds of millions of triangles. Without this lesson, several things stay unexplained:

  • why a model in the distance suddenly pops and changes shape;
  • why the grass around the player ends in a circle, with bare ground beyond it;
  • why a thousand identical rocks are cheaper than a hundred different ones;
  • what Nanite really does, and why it does not like grass and glass.

Further in the article

  1. The two prices of a scene
  2. Levels of detail
  3. Why small triangles are expensive
  4. Instancing: printing from one plate
  5. Skip what is invisible
  6. Nanite: detail piece by piece
  7. In engines and Blender
  8. Where it breaks
  9. Connections: the same idea in other fields
  10. Key points
  11. Test yourself