J
J
Jim Ford2020-05-14 22:31:18
Unity
Jim Ford, 2020-05-14 22:31:18

Unity terrain - several terrains in one for optimization?

Created a map of about 7 square meters. kilometers for the future online shooter with an open world in the Unity engine. I created the map from many pieces of terrain (about 100 came out, I know - a lot). After that, I began to fill the map with details (buildings, roads, vegetation, etc.) and the editor began to slow down wildly. Quite large FPS drawdowns are caused by trees (there are about 8-10 types), but most of all the map itself eats away from many pieces of terrain (I tried to turn off buildings, trees on the stage, everything in turn - buildings are still without textures, on trees and landscape details such as stones and fallen trees hang LOD - their impact on the FPS is minimal). I turn off all the terrains - the performance returns to normal, you can work in the editor and start the game, if you don't do this, the FPS is about 1.

Out of curiosity, I tried to create a terrain comparable in size in the same scene, but in one piece, approximately recreated the relief. FPS is not lower than 30 even if you stand at a height and the camera has a view of 6-7 km, i.e. almost to the end of the map, without any optimization measures like using GPU Instancer on prefabs and trees (only their native lods) and Occlusion Culling in Unity itself.

The conclusion suggested itself - if a map of many pieces for some reason slows down the whole scene there, you can try to combine all the pieces into one, get one data. This, in principle, will facilitate many tasks, but at the time of creating the map, I did not know this, and now I have a map with a relief that has been worked out by hand in some detail, which slows down wildly and does not allow further work.

I tried to use the Stitchscape asset, but either I didn’t figure it out, or it’s not able to combine the data of several terrains into one, the “stitched” terrains are still selected in the editor in separate pieces. It only smooths out the joints, but there is practically no need for this, Unity itself does this quite well.

I read somewhere that you can try to remove raw height maps from pieces of terrain, combine them in Photoshop into one and import them into Unity, applying them in a single piece of terrain. In this case, trees and textures will have to be exposed and redrawn, which I would not like (I used the standard Unity terrain tools). But the wildest thing is to combine about a hundred pieces into one card in Photoshop, at the mere thought of this I start to get old, gray hair breaks through and my joints ache ...

Is there any way to bring the fps back to normal, whether by combining many terrains into one, or something else?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
ALTech1, 2020-05-16
@ALTech1

Personally, after working with Unity Terrain, I decided to abandon it. Yes, it's convenient, but when changing the shape, too many polygons are created. Occlusion Culling can help, but I don't think it will give a strong result in your case. If I were you, I would retopologize the models with fewer vertices and make the terrain myself in the same Blender. This way you will control the number of polygons.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question