- Home /
Large terrain navmesh generation strategy
I have a pretty large terrain 3x3 km .I need to set nav system for AI.When I generate navmesh for the whole terrain I am getting the error: maxVertices <65536 && maxIndices <65536*3 - which probably means that the vertex and index buffers can not contain more than those numbers of the attributes.Besides,the generated navmesh is so heavy that the scene hardly responds.So how can I maybe generate nav mesh on some parts of the terrain?Or smth else?Does Unity have any solution for this?
For those curious : I must have that size of terrain as my program must work with real world units. Thanks.
Answer by HarshadK · Dec 16, 2014 at 12:12 PM
One way to handle this is:
Export your terrain into an .obj file using TerrainObjExporter (It's a very useful script by Eric).
Open this terrain object into any modelling application and generate a low poly mesh from this object.
Now you can import this low poly mesh into Unity, place it on your terrain and use it to generate your NavMesh.
I know it's not the best method but it will work.
Answer by two2uns · Oct 16, 2020 at 05:27 PM
I was looking for a solution today. This is what I found:
There is no need to render a global scene navmesh. The navmesh component approach can limit navmesh generation to a smaller, dynamic volume. Updating or extending such a small volume at runtime is also not as expensive.
Here is a Unite talk with an example. Where a small, moving navmesh is computed around the player: https://youtu.be/n-RXnDGE72M?t=1286
Your answer
Follow this Question
Related Questions
Painting or assigning NavMesh area's on terrain 3 Answers
Make navmesh agent follow terrain 0 Answers
How can i make a nav Mesh in a procedural terrain? 0 Answers
Terrain navmesh areas based on textures 2 Answers