# Nanite + Foliage - Does it work?

**URL:** <https://forums.unrealengine.com/t/nanite-foliage-does-it-work/1208590>\
**Category:** Rendering\
**Tags:** unreal-engine, question\
**Created:** [June 23, 2023, 6:25pm UTC](https://forums.unrealengine.com/t/nanite-foliage-does-it-work/1208590 "2023-06-23T18:25:35Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![adhills](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@adhills](https://forums.unrealengine.com/u/adhills)\
**Post date:** [June 23, 2023, 6:25pm UTC](https://forums.unrealengine.com/t/nanite-foliage-does-it-work/1208590/1 "2023-06-23T18:25:36Z")

</div>

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?

[https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/3/f/13f94f2e041b20d077952a9420bc1a14697a8ac2.mp4](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/3/f/13f94f2e041b20d077952a9420bc1a14697a8ac2.mp4)

---

<div class="post-metadata">

**Author:** ![RecourseDesign](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/recoursedesign/32/1194503_2.png) [@RecourseDesign](https://forums.unrealengine.com/u/RecourseDesign)\
**Post date:** [June 23, 2023, 6:40pm UTC](https://forums.unrealengine.com/t/nanite-foliage-does-it-work/1208590/2 "2023-06-23T18:40:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![adhills](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@adhills](https://forums.unrealengine.com/u/adhills)\
**Post date:** [June 23, 2023, 7:48pm UTC](https://forums.unrealengine.com/t/nanite-foliage-does-it-work/1208590/3 "2023-06-23T19:48:02Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![adhills](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@adhills](https://forums.unrealengine.com/u/adhills)\
**Post date:** [June 23, 2023, 7:56pm UTC](https://forums.unrealengine.com/t/nanite-foliage-does-it-work/1208590/4 "2023-06-23T19:56:00Z")

</div>

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

[https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/1/6/316321c0c013f51d23b153c71221e11f1c4d11ee.mp4](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/1/6/316321c0c013f51d23b153c71221e11f1c4d11ee.mp4)

---

<div class="post-metadata">

**Author:** ![adhills](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@adhills](https://forums.unrealengine.com/u/adhills)\
**Post date:** [June 23, 2023, 8:09pm UTC](https://forums.unrealengine.com/t/nanite-foliage-does-it-work/1208590/5 "2023-06-23T20:09:40Z")

</div>

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

 ![Screenshot 2023-06-23 210035](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/1/f/a1fcc2dbb549aec692769caf7f4f857f195c0cd6.jpeg)

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.

---

<div class="post-metadata">

**Author:** ![RecourseDesign](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/recoursedesign/32/1194503_2.png) [@RecourseDesign](https://forums.unrealengine.com/u/RecourseDesign)\
**Post date:** [June 23, 2023, 8:22pm UTC](https://forums.unrealengine.com/t/nanite-foliage-does-it-work/1208590/6 "2023-06-23T20:22:52Z")

</div>

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

> [@Ghosting in moving foliage in Unreal Engine 5](https://forums.unrealengine.com/t/ghosting-in-moving-foliage-in-unreal-engine-5/1172596):
>
> I have trying to create an environment with tones of grass and other foliage assets, but as soon as I enable the wind the foliage a bit far away tend to become blurrier or ghosted. I thought it was becoz of low end hardware but then I tested it on my 4090 but the issue stayed the same. This issue is not that apparent in megascans tree though. Can anyone tell me some kind of solution to implement to mitigate this, its quite distracting in the viewport?

---

<div class="post-metadata">

**Author:** ![adhills](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@adhills](https://forums.unrealengine.com/u/adhills)\
**Post date:** [June 24, 2023, 7:55am UTC](https://forums.unrealengine.com/t/nanite-foliage-does-it-work/1208590/7 "2023-06-24T07:55:09Z")

</div>

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

[https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/0/c/70c44ce82b79deab55b84048be607fcb14df4928.mp4](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/0/c/70c44ce82b79deab55b84048be607fcb14df4928.mp4)

---

<div class="post-metadata">

**Author:** ![Slimwaffle](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/slimwaffle/32/696460_2.png) [@Slimwaffle](https://forums.unrealengine.com/u/Slimwaffle)\
**Post date:** [June 24, 2023, 10:05am UTC](https://forums.unrealengine.com/t/nanite-foliage-does-it-work/1208590/8 "2023-06-24T10:05:34Z")

</div>

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.

 ![WindFix](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/8/b/78bafdcc0fb10868e82534eb13e232d8ca4692e3.jpeg)

---

<div class="post-metadata">

**Author:** ![adhills](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@adhills](https://forums.unrealengine.com/u/adhills)\
**Post date:** [June 24, 2023, 1:17pm UTC](https://forums.unrealengine.com/t/nanite-foliage-does-it-work/1208590/9 "2023-06-24T13:17:59Z")

</div>

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

 ![Screenshot 2023-06-24 135942](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/f/1/1f1a0f2c71b41bf5c26d0f54e471c795f2ed15d1.png)

So I opened up MF\_AdvancedWind and was confronted with this… 😮

 ![Screenshot 2023-06-24 141045](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/4/2/b42f0f74474ed59af0355f4635051528c9d4b34b.png)

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

---

<div class="post-metadata">

**Author:** ![Slimwaffle](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/slimwaffle/32/696460_2.png) [@Slimwaffle](https://forums.unrealengine.com/u/Slimwaffle)\
**Post date:** [June 25, 2023, 10:15am UTC](https://forums.unrealengine.com/t/nanite-foliage-does-it-work/1208590/10 "2023-06-25T10:15:46Z")

</div>

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

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/e/b/feb157e24af01c282c5c23afaf68ecb9bced1054.jpeg "Nanite Foliage Fix for Unreal Engine 5.1 + Z axis crazy movement") ](https://www.youtube.com/watch?v=wVMImHI24QI)

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.

---

<div class="post-metadata">

**Author:** ![adhills](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@adhills](https://forums.unrealengine.com/u/adhills)\
**Post date:** [June 25, 2023, 10:25am UTC](https://forums.unrealengine.com/t/nanite-foliage-does-it-work/1208590/11 "2023-06-25T10:25:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![adhills](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@adhills](https://forums.unrealengine.com/u/adhills)\
**Post date:** [June 25, 2023, 10:50am UTC](https://forums.unrealengine.com/t/nanite-foliage-does-it-work/1208590/12 "2023-06-25T10:50:45Z")

</div>

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!

 ![Screenshot 2023-06-24 090529](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/e/6/5e6a0f527c5b59b3ddc4932b0367f66e4f62c93e.jpeg)

---

<div class="post-metadata">

**Author:** ![Slimwaffle](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/slimwaffle/32/696460_2.png) [@Slimwaffle](https://forums.unrealengine.com/u/Slimwaffle)\
**Post date:** [June 29, 2023, 1:24pm UTC](https://forums.unrealengine.com/t/nanite-foliage-does-it-work/1208590/13 "2023-06-29T13:24:11Z")

</div>

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](https://forums.unrealengine.com/t/bug-transform-tool-misplaced-when-selecting-foliage-that-has-nanite-enabled/657548)  
[UE5.1 Foliage have offset pivot point when selected](https://forums.unrealengine.com/t/ue5-1-foliage-have-offset-pivot-point-when-selected/722788)

I hope this helps.

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [July 29, 2023, 1:25pm UTC](https://forums.unrealengine.com/t/nanite-foliage-does-it-work/1208590/14 "2023-07-29T13:25:06Z")

</div>

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