Home Technical Talk

Best practices when creating assets specifically for Nanite

polycounter lvl 11
Offline / Send Message
dgruwier polycounter lvl 11
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

  • ZacD
    Online / Send Message
    ZacD ngon master
    - I like to keep meshes 1 million or less just because much larger slows down iteration and import times.
    -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. 


  • dgruwier
    Offline / Send Message
    dgruwier polycounter lvl 11
    Interesting about continuous meshes. That might actually be very relevant to some of the kitbashed models we're doing, I'll make sure to look into that.

    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?
  • ZacD
    Online / Send Message
    ZacD ngon master
    Yes, adding "unnecessary" edge loops to floors and walls in particularly helps them cull other nanite meshes behind them better.  
  • HAWK12HT
    Offline / Send Message
    HAWK12HT polycounter lvl 13
    Under a million tris without long thin triangles is better. You can have 1-2 mil tri meshes too but UV ing those is a nightmare.
    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.   



  • dgruwier
    Offline / Send Message
    dgruwier polycounter lvl 11
    Thank you for all the good information!

    HAWK12HT said:
    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.

    Are you referring to baking normal maps? What would baking the mesh with itself achieve other than a blank map?
Sign In or Register to comment.