How would you create terrain that doesn't lag?
Here's my situation. I have a function in a blueprint class that inputs an x and y position and outputs a height. I want to create an infinite world that is generated as a character walks through it, so basically during runtime. I have created something that works, but when new chunks are loaded it lags tremendously like down to 20 fps. I started using the procedural mesh component to generate terrain, that was too laggy, so I moved on to using the Runtime Mesh Component (which is a plugin) which solved most of the lag except when chunks were generated. So if anyone knows any different ways of generating terrain with blueprints please reply!
Thank you all, - Will
asked Aug 24 '17 at 01:37 PM in Blueprint Scripting
I don´t know if you already resolved the problem, its already a bit ago.
What i´ve done is creating a quad tree, each node represents two different quality levels, the full detail and one of the parent (if not all 4 children can be displayed at full, then the parent mesh can be displayed)
Most if the stuff is done in async, as this was killing my performance (generating vertices, triangles, normals etc.) After the task is done, i can create one to two new nodes per frame, with rock solid 120 fps.
Async snipped (reduced):
A few numbers: Numbers of vertices: 30 per site, 900 total Numbers of tris: around 5000 Numbers of UV, normals, tangents: each 900
if i split the tree, each children has only the half site length (4 children), so i double the quality with each deeper level in the tree.
At level 1 its 900 vertices, if you would replace the level 1 with the level 8 children (4096 of them), i end up having 1920 vertices for one site and 3686400 overall. But not all are displayed all the time for sure, its only around the player based on the distance.
Hint: Make the collision only were you need them, and set:
to have async cooking of collision (before creating a new section or registering the compontent)
answered Mar 21 '18 at 07:46 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here