Skip to content

Commit 89d6d3f

Browse files
committed
nanite: work
1 parent 5df919a commit 89d6d3f

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

blog/2025-05-07-nanite-at-home/index.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,26 @@ TODO Nanite at home meme?
1717

1818

1919

20-
## Traditional LOD
20+
## Traditional Level of Detail
2121

2222
TODO pic of some low poly 3D model
2323

24-
// A 3D model is represented by a List of indices and a List of vertices.
25-
3D models for real-time rendering are made up of many triangles describing its surface and many vertices, which are the corners of our triangles. Vertices are highly configurable with the properties they have, but at the very least need to have a position of where they are. Triangles on the other hand are simply a list of indices pointing into the List of vertices, where a set of 3 form a single triangle.
24+
3D meshes for real-time rendering are made up of many triangles and their corners, called vertices.
25+
At a minimum a vertex must define its position but can have various other properties, with their memory layout being fully dynamic.
26+
Triangles on the other hand are simply a list of u16 or u32 indices pointing into the List of vertices, where a set of 3 form a single triangle.
2627

27-
When rasterizing such a model to the screen, we use a vertex shader to transform our vertices .
28+
TODO quad example?
2829

29-
The cost of rendering a 3D model is typically the amount of pixels on screen plus the amount of vertices of the model.
30+
The process of rasterising our model into colorful pixels on screen consists out of a 3 step process:
31+
* The vertex shader calculates the position of our vertex from the camera's perspective and do other kinds of per-vertex transformations.
32+
* Then our triangle is rasterized into the individual pixel locations.
33+
* The fragment shader evaluates the color of every pixel.
34+
35+
The cost of rendering scales largely by the shaders that need to be run, or in other words: The amount of pixels on screen plus the amount of vertices of the model.
36+
37+
As we move a model further away from the camera, the mesh gets smaller and fewer fragment shader need to be evaluated. However, we would still need to call the vertex shader for every single vertex to know where it ends up on screen, even if the detail they describe would be too small to notice. To improve performance, it is common practice to not just have a single mesh, but to create multiple meshes at different detail levels that can be swapped out, usually depending on the distance to the camera.
38+
39+
The reducing vertices in a model can in part be automated and is called "mesh simplification". Level of Detail (LOD)
3040

3141
## Terrain Generation
3242

0 commit comments

Comments
 (0)