Reduce Lag during Terrain Generation?
I am currently using Perlin Sound for terrain generation, and I can successfully generate terrains. However, as I increase the map size, it's becoming laggy, as more procedural actors are spawned in the map.
I've tried optimizing the procedural generation by using getRenderedActors and getNotRenderedActors from here (which helps to detect which object is in the viewport, and which object isn't): https://answers.unrealengine.com/questions/21801/check-if-an-object-is-visible-by-a-camera.html, and setting actorHiddenInGame and actorCollisionEnabled for each procedural actor per tick. However, this doesn't really work, as it's still as laggy as usual.
I have been searching around for days with no luck. It would be great if I can get some recommendations on someone knows how runtime optimization for procedural generation works. I suspect it cannot be something that is done each tick for each procedural actor. Or else, am I doing the viewport object detection incorrectly?
Just a tip on huge amount of meshes - try hierarchical instanced static meshes. It's great for static objects or foliage. You can easily add new instances. Uses a single draw call and is just a single actor. Though be vary that "remove" is actually "swap remove". Cause of it you wont get lag on instance removal, but does not have a consistent ordering of the instances.
answered Jun 27 '18 at 06:12 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here