Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

3 Dimensional Chat / How can i improve my inefficient terraform tool?

Years of Service
User Offline
Joined: 3rd Feb 2016
Posted: 25th Aug 2018 18:13
Currently i am trying to create a terraform tool to generate big landscapes like this:

You can use the mouse to reshape the land however it is currently very inefficient.
First i need to change a vertex's position in the memblock using SetMeshMemblockVertexPosition.
And after that i need to update the whole mesh using the new memblock data with SetObjectMeshFromMemblock.
I need to do this 60 times per second so my game runs at a real 60fps.
This isn't a problem with a small mapsize (50x50 on laptop 100x100 on desktop), but with a bigger mapsize it can't keep up.

One solution i found is to split the map up in chunks of like 25x25.
But then i will have multiple meshes which will slow down shadows since i have to do more drawcalls.
And i will need to have double data around the edges (for 2 meshes).
Isn't there a way to modify a single vertex of mesh without recreating the whole mesh?
Or do i indeed to split up my terrain into chunks?
I also looked in unity game engine since it handles it much better but i don't really understand what method they use.

Login to post a reply

Server time is: 2023-09-27 07:15:05
Your offset time is: 2023-09-27 07:15:05