We have a system in our game where we need to be able to show a highlight on pretty much any static piece of world geometry in the game, which mostly use nanite. Our current approach to do this is to use an overlay material by temporarily disabling nanite on the static meshes in question. However, this causes popping due to the nanite fallback mesh being used, and it being visually distinct from the nanite mesh. It is not feasible to make the fallback mesh indistinguishable from the nanite one for all static geometry in the game, so it seems like using an overlay like this will inevitably cause this popping. Are there any alternatives you could suggest to achieve this affect? The overlay material is a transparent layer over the whole mesh, similar to this
[Image Removed]
Hi, there are a few different ways to set something like this up -- including the Overlay approach you’ve already tried. The complicating factor is the translucency, since Nanite isn’t compatible with translucent materials. Masked materials can be used on Nanite meshes, but they’re not as efficient as opaque materials.
If you’re open to changing your highlight to be masked/dithered or opaque instead, you could try:
- Hot-swap between the regular material and a separate highlight material. This may or may not load quickly enough, though.
- Create a Material Function with the highlight nodes, then implement it into the various regular materials. Use a material parameter to lerp between the asset being highlighted and not highlighted.
- Variation: Have two versions of the regular material, one with the Material Function and a regular one without. Use the Material Function version on LOD0 and the regular version on LOD1+; Or, only use the Material Function version on assets within range of potentially being highlighted. This way, further-away assets would look the same but wouldn’t have the more complex material applied at all times.
However, you’d probably need a different approach if translucency is a must. Some ideas:
- Use a more distinct Fresnel or some other sort of edge effect in the Overlay material, so that the difference in the mesh shape is easier to overlook or seems intentional/authored.
- Obscure the pop in the fallback mesh transition with some material or particle VFX.
- Swap to a different mesh with highlight applied as the primary material. Even if it’s not an exact match to the Nanite mesh, you may be able to author a version that matches the shape of the Nanite mesh more closely, or focuses the detail of the mesh in a way that reduces the visual pop more effectively than the fallback mesh.
The specific needs of your game and the visual priorities will shape which approach works best for your use case. I hope this helps.
You’re correct, overlay materials aren’t supported on Nanite meshes at the moment. The ideas shared were for either non-Nanite meshes or changes to the regular materials (rather than overlay materials).
Sounds good, most welcome!
Hi, thanks for the reply!
I was under the impression that overlay materials (even masked ones) were not supported by nanite at all, was I wrong in that? I think I tried it at some point and it didn’t work, although it was some time ago so maybe things have changed since then. I will need to confer with the team, but that might work if we can accept a dithered look instead of actual translucency.
Just to clarify something, the reason we are using an overlay is that we don’t show this highlight on the whole object. Imagine what is pictured above, with the yellow fading back to the regular mesh based on distance to a specific point, so I’m afraid hiding the pop with material tricks can’t work.
Also since we need this to work for basically any static object in the game, I don’t think we can do it with material parameters or material functions as we’d need to do it in pretty much every material in the game; which I don’t think is feasible for our game.
I will relay these options to my team though and see if we can come up with something. I’ll let you know if we have any questions, thanks again for the suggestions!