Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

'Update Instance Transform' / 'Remove Instance' == big performance hit even if used only on 1 instance

Repro steps:

  1. Have a Landscape (or anything else) with large amount of grass/foliage painted (around 500k to test it)

  2. In blueprint, get any instance of the foliage mesh component and (using 'Update Instance Transform' with 'Mark Render State Dirty' enabled to see the changed transform) update its transform, for example, every 0.1s for couple of seconds. It gets massive lag this way.

  3. I've tesed it with profiler and here is what causes the lag: PROFILER

What happens? Maybe it updates every instance inside foliage mesh component, instead of just one?

When I have less foliage painted on landscape (but still dense & visible over all viewport), the lag is almost not noticeable. How to fix this? Or maybe is there some workaround?

Update: Same thing happens with 'Remove Instance' node!

Product Version: UE 4.12
bez tytułu.png (61.1 kB)
more ▼

asked Aug 04 '16 at 04:15 PM in Everything Else

avatar image

2k 157 153 207

avatar image Crazy Rabbits Dec 12 '18 at 11:33 AM

I have encountered the same problem 4.20, does anyone know how to solve this problem? I added hundreds of thousands of plants, and when I fell one of them, the FPS dropped from 120 to 8.

avatar image Slavq Dec 12 '18 at 11:38 AM

I'm afraid that this is a limitation of the engine and nothing can be done except some workarounds with chunking (but that all depends on your project) - see the answer, I've also added comments about it under it.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hi Slavq,

The lag you are experiencing is something I would expect in this case. Foliage instances are all instances tied to one actor. When you move the transform of one instance, technically it has to destroy and recreate every foliage instance in the level, which would easily cause the lag you are seeing when dealing with 500,000+ instances. Once foliage is placed, it is not meant to be moved or edited at runtime, because when one instance is updated, the entire foliage actor, including every instance within the foliage actor, must then be updated. The functionality you are looking for is going to require a different system to implement outside of the foliage tool, as this is a limitation of the tool.

more ▼

answered Aug 04 '16 at 05:50 PM

avatar image Slavq Aug 04 '16 at 06:24 PM

Thanks for the explanation! Maybe I'll divide existing foliage components into chunks (multiple components) on Begin Play to minimize the lag... Or find some other workaround.

avatar image visualnotte Apr 08 '18 at 04:10 PM

Hey man, I have same problem, you can tell me which solution you have find? Tk

avatar image Sir_Enhance_Alot May 27 '18 at 07:45 AM

Hey did you ever find a solution? I tried splitting it up into many different instances but the performance was about identical when removing the instance as it was when they were all in the same instance static mesh component.

avatar image Slavq May 27 '18 at 09:22 AM

Hey, there is no real solution for this, since it needs to re-draw every instance anyway. In my case I've divided my foliage into chunks, for example instead of hacing only one hierarchical static mesh component for entire scene, I've recreated it using 5 components. This way when updating an instance it won't re-draw whole big component, but only one of the 5 smaller components.

avatar image Sir_Enhance_Alot May 27 '18 at 08:57 PM

That's what I did but I get the same lag spikes whether I split it into 5 or even 100 smaller components. With 500 Instances each.

avatar image Sir_Enhance_Alot May 27 '18 at 09:11 PM

It almost seems like if I remove an instance on one it still redraws every instance in the scene.

avatar image DistrictWare Oct 22 '18 at 04:04 PM

Thats exactly what it seems to be doing, it redraws every instance in the scene regardless of the foliage type or component. Does anyone have a fix for this yet? seems like it should not behave this way.

avatar image Crazy Rabbits Dec 13 '18 at 11:29 AM

Is there a way to solve this problem? Too many tree instances have good fps, but cutting down trees will cause FPS to drop lot by 1 second.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question