We've been asked to use Nanite for a project (just a blanket order to enable Nanite on every mesh that even remotely supports it). Whatever one might think of that, I need to make sure we cause as little trouble for ourselves on the asset creation side of things, and I feel like Nanite throws out most of what I know about optimizing assets for realtime use.
Are there any well established best practises for optimizing a model specifically for use in Nanite?
For example:
- Should/can you still use baked normal maps at all? Does it just not matter, or can baking and using normal maps actively interfere with Nanite?
- Are there any rules of thumb for determining an appropriate mesh resolution, other than "don't worry about it"? Surely you wouldn't want to use 30 billion tri source mesh for a small rock, just because Nanite itself can handle it, if nothing else just for file size and import times, but I'm struggling to think of a good rule of thumb to follow here.
- Are there any kinds of topology or shapes that cause problems with Nanite, and should be avoided?
- Are there any non-obvious traps to fall in regarding unwrapping and vertex colors?
- What else might I have missed?
I'm planning on testing as much as possible, iterating on test geometry to find the edges where Nanite breaks down.But I was hoping there might be experience already out there to pull from.
All the information I can find about Nanite, even on here, seems to revolve around Nanite inside UE itself and how to solve problems by tweaking the engine settings, not how to avoid problems up front with sensible asset authoring.
Replies
-Try to use mostly continuous meshes and avoiding really large polygons is ideal. If you have a pile of small rocks for example, your better off booleaning it together or shrink wrapping a grid on top of it. Culling is done per cluster, so large polygons don't cull as well. That being said, if you made a bike, for example, don't worry about trying to merge the handle bars, frame, tires, gears, etc, into one continuous mesh (although you're probably better off having the nuts and bolts being continuous with whatever they're attached to).
-Nanite doesn't support vertex painting in the same way as normal geo, so all instances of a static mesh shares the same vertex colors, 5.5 added a work around https://portal.productboard.com/epicgames/1-unreal-engine-public-roadmap/c/1667-mesh-texture-color-painting Vertex colors are still really useful but can have pop in if you push it too far.
Re: large polygons, let's say I have a large flat plane as the floor of a building, for example, is there a chance it'd be beneficial to add otherwise unnecessary loops across it to give Nanite something to work with?
You have two bake options, one is to bake the nanite mesh with itself or have one mesh under million tris and bake high on top of it.
Above million its going to be an issue with file size optimization + textures importing / exporting.
UV continuous are better as you need ~half the vert count of total tri count for nanite to be efficient (EPID DEV forum on nanite has more info), UV splits = vert count increase.
You can try tri planar texturing in engine but it will be all generic without much control, ideal for background assets though (rocks, cliffs)
Have tris where intricate details are and less tris on flatter areas (Zbrush decimation with masking does that for you or Houdini) (example image of my project) face area has more tris vs flat areas.
UV coverage above 65% 70% is a must (nanite or standard mesh)
Use weighted normals to avoid shading artifacts as nanite requires 1 smoothing group to work. Although that might be more visible on 4k below textures and depending on mesh, its size during mipping. This also helps getting cleaner normal maps.
Are you referring to baking normal maps? What would baking the mesh with itself achieve other than a blank map?
If you have modular sci fi walls as nanite and you want vert paint (which is not an option) you may want to bring in masks and via material instances you can give some variation.
Like I said, if its background stuff then dont bake, use tileable textures and call it day.
I am currently trying to build a small, stylized, ancient sci-fi environment with nanite workflow, I'm still trying to give the first pass on everything. The idea is to have a dense environment, with more stone, organic models than hard surfacing and less organic ones.
Here`s my questions:
Props: Should we always decimate? For example, I have stuff like pots, vases, and some of them are not huge. From what I've found on the internet, Nanite works better with decimated models. Keep in mind that I am not used to work this way lol, decimating models and creating their uvs is a bit of a pain in the soul. I don't know if we can keep the work in quads but more mid res than low poly, I'm a bit confused in which one is the best option.
Here's a few images of props inside the scene:
Regarding the UVS:
From what I understand (and thank you so much for the explanation!) I should keep as merged as possible with less island. Right?
Long and stretched triangles to avoid: Is this always something that we have to fix with a manual clean up? Or is there a way to setup the decimation so they can create less stretched triangles? I'm asking this because what I'm doing right now is: I mask the areas that I want to be more dense and decimate using 50% instead of 20. But most of the time it creates some long triangles in which are both hard to uv proprely and wrong to have like it's mentioned in this thread.
This is the exterior: (again, rough pass on everything, especially the rocks)