Enabling and disabling Nanite on individual static meshes on runtime to allow for highlight/outline

I’ve got a simple outline post process material that works using render custom depth, and it doesn’t seem to work with nanite meshes, so I was wondering if it’s possible to disable nanite on certain static meshes to allow for highlighting with custom depth, or if anyone else knows a way you can outline nanite static meshes that’d be great.

1 Like

At runtime? No (Read as: I doubt it). Nanite meshes are stored in a different format.
You could make outlines by using decals, or by spawning an additional mesh.

1 Like

yes.
“There should be a bDisallowNanite flag (which can be set a runtime) on StaticMeshComponent for the renderer to fallback to the nanite proxy mesh if r.Nanite.ProxyRenderMode is set to 0 which should be the default.”

Also i’ve made a postprocess that uses custom stencil to draw outlines and it works. so could be an issue with your meshes, not nanite.

also there’s r.nanite cvar for global toggling