00:03In this video, I'm going to cover everything you need to know about Nanite: when you should use it, its benefits, its limitations, and what it is
00:12So, Nanite is basically a very efficient way to render objects on a screen
00:15The way it works is by breaking down meshes into a cluster of triangles
00:20There are two ways to enable Nanite on your mesh
00:25When importing a mesh into Unreal Engine, just make sure to check the 'Build Nanite' box, then go import
00:31When your mesh is imported, it will be imported with Nanite enabled
00:38The second way to enable Nanite on a mesh is to open up the mesh in the editor, go to Nanite settings, just check 'Enable Nanite Support,' then click 'Apply Changes.' The light will be enabled on this mesh in Unreal Engine 5.1, Nanite has been updated to work
00:55For material-driven animations and deformations via wall position offset as well as opacity mask, this allows it to work a lot better with foliage meshes
01:03So, to enable Nanite on a foliage mesh, you just open it up and check the "Enable Nanite Support" option and apply changes to see how Nanite breaks down meshes into clusters
01:16Drag in your Nanite mesh anywhere into your project
01:24Then, to visually see Nanite enabled on your meshes, go to Edit, then Project Settings
01:29If you're using the latest version of Unreal Engine, make sure that SM6 is checked
01:32Then, go to Lighting, select No Light Visualization, and choose Clusters
01:41You will see that each Nanite model has been split into many different individual colors, each color..
01:45represents one cluster, and the clusters will adjust based on many settings: the size they are on the screen, the distance away they are from the camera, and the resolution
01:55Clusters will be reduced or removed when they're not visible on the screen
01:58This allows Nanite meshes to be very optimized, and there are many different Nanite view modes
02:04So, I can go here and switch to the Night visualization and go to the overview, and it'll show me a view mode displaying all the different Nanite view modes
02:13So, what are the benefits of Nanite? Nanite allows you to directly import high-quality models into your projects
02:21You can use photorealistic scans and high-poly models without having to worry about the performance impact on your game or project
02:26Nanite can handle millions of polygons being on the screen
02:31Nanite automatically calculates levels of detail (LODs), so you do not have to worry about making multiple LODs or versions of your model, as Nanite can handle this
02:37It makes asset batching easier
02:42If you're unfamiliar with asset bashing, it's basically a concept where you take a bunch of models from different sources and combine them to make a scene
02:52Before Nanite, this was kind of inefficient, as you would have to load in many different models from various places, which could drain the performance of your project
03:00Lastly, Nanite compresses meshes very well
03:04I'm going to show an image on the screen, and you can see a comparison between two meshes which have the same amount of polygons
03:10Triangles, you can see that the Nanite mesh is around seven times smaller, so this can save a lot of space in your game
03:16So, what are some of the limitations of Nanite? It does not work so well with closely stacked surfaces
03:24This is when loads of meshes are stacked on top of one another
03:28Nanite can do a good job of detecting static meshes and optimizing them, although when meshes are too close together, sometimes Nanite will not be able to determine which mesh is on top or bottom, which causes both meshes to be drawn simultaneously
03:44This can result in overdraw, where the same pixel is drawn multiple times in a single frame, which isn't really efficient
03:50Now, it also doesn't work with aggregate geometry; aggregate geometry is geometry merged or combined for optimization
03:54which has fine detail such as the leaves on trees or hair
03:59Although, as mentioned earlier in Unreal Engine 5.1, they updated Nanite, and it works a lot better with foliage
04:05Unreal Engine is continuously improving, so this could change
04:09Just because it doesn't work that well with these types of geometry yet, it doesn't mean you can't still enable Nanite on these types of meshes
04:19Nanite also only works with certain meshes; currently, it doesn't support spline or skeletal meshes
04:24 So, when should you use Nanite? Nanite should be used where possible, as it will take up less memory on your computer and provide much better performance for your projects
04:37The Unreal Engine documentation recommends using Nanite
04:40When a mesh contains many triangles, when a mesh has many instances in the scene, or if the mesh acts as a major occluder—for example, a large wall that blocks light—these are all cases where Nanite can be useful
04:52So, that's all for this video
04:57Hopefully, you now know much more about Nanite
04:59If you enjoyed it, please like and subscribe, and I'll see you guys next time
05:04Bye.