Nanite + Foliage - Does it work?

I heard it’s not recommended to use nanite on foliage? Is this still true?

Can anyone tell me what’s going on with my tree?
This is what happens to some trees (not all) when I enable nanite. It’s from the megascans hornbeam pack and came nanite enabled. Any ideas?

Hi adhills,

Is that in 5.2? I had similiar issues, but it was fixed in 5.2. For 5.0 and 5.1 there were many issues with foliage, so it wasn’t a good idea to try with those - but 5.2 seems to be a lot more robust with foliage - just make sure you have WPO disabled at a distance in a similar way to culling.

Hey, this is in 5.2. I tried playing with WPO at distance disabled but didn’t have any effect on this. What exactly does WPODD do? Do you know?

Thanks!

Here’s a better video of what’s happening…

And weirdly this tree is totally unaffected even though it’s just another instance of exactly the same static mesh…

Any ideas? I’ve also noticed that the transform gizmos are now at quite some distance from each instance and no longer centred on the tree base. They also don’t respond to any transform - move/scale/rotate.

I see, yes this is a known issue - there is a fix suggested here by @TheKJ

1 Like

Hi. thanks. I’ve tried this out but I think this is a different issue. It’s only the static mesh foliage instances that have this problem - the static meshes are working fine. The middle tree in below vid is a static mesh - behaving correctly - the two either side are static mesh foliage instances of the same static mesh but with strange effect/animation. If I disable wind or nanite this issue is resolved.

So the problem seems to be that nanite may struggle with animated static mesh foliage instances? I’m not sure. Any further ideas on this? Ideally I’d keep nanite and wind on the tree. Cheers

I had this problem and the following is what worked for me.

Go to the material for your tree. Open the parent material for each material until you reach the end of the chain ( no more parents left)(your master material). Plugged into your world position offset should be something to simulate wind. For me it was a material function. Either in your code or a material function you want to locate the “TransformPosition” node. Under the “Source” drop down menu, change it to be “Instance and Particle Space”. You need to do this for each material (with a different parent) that uses the world position offset to simulate wind.

I hope this helps.

Hey, thanks for this! Below is the parent material. I couldn’t find the TransformPosition node unfortunately.

So I opened up MF_AdvancedWind and was confronted with this… :open_mouth:

But couldn’t find it in there either. I then tried looking inside MF_SimpleWind but nothing. These megascans trees are seemingly made differently. I’d have no idea where to look for the right setting. Any further ideas?

As it’s only the foliage instances having this issue and not the static meshes I’d be surprised it’s a material thing. Was your case identical in this regard? Or did your problem also exist on static meshes placed directly into the scene without use of foliage mode? Cheers

I don’t personally use the Megascans foliage. Here is a link for a video where he solves the problem for Megascans foliage.

In the video he opens the “Simple Wind” material function and opens another material function located inside called “Object Pivot Point”. “Object Pivot Point” is where he locates the “TransformPostition” node.

4 Likes

YES! I’ve figured out what this was. The megascans trees come in two folders - simple wind & pivot painter. For whatever reason the simple wind trees don’t work with nanite and wind enabled - at least for me. However, the pivot painter trees work fine! Just as an aside, megascans recommend pivot painter for high fidelity foreground and simple wind only for background.

Anyway, so I thought I was in for a painstaking task of switching all my simple wind trees to pivot painter - because the ‘replace with…’ option in foliage mode always crashed my machine in 5.1. But what’s really cool is that unreal has fixed this issue in 5.2 and I could quickly swap them out. Everything now works as expected. So if anyone ever runs into this - just switch to the pivot painter trees. Cheers

EDIT: Only just seen above solution which is better as PP trees are quite heavy.

Amazing!! Thanks so much for sharing this link - I’d never have found this node. This is a better solution than switching to pivot painter as these trees are less performant.

Next question - how do we keep the pivot centred and working on each instance? This seems to be a little buggy and I can’t transform my foliage. The pivot moves to a distant location as below. This only happens with nanite enabled. Cheers!

I haven’t personally experienced this one. But I found other threads that said the best solution is to disable nanite while editing foliage and then re-enabling it when finished.

Bug? Transform Tool “misplaced” when selecting foliage that has nanite enabled
UE5.1 Foliage have offset pivot point when selected

I hope this helps.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.