Babylon Toolkit New Terrain System

Yo @Deltakosh and @trevordev and @bghgary … Hey guys, i am now moving on to the new terrain system for Babylon Toolkit 4.0. I got a few questions before i design the terrain export.

1… Is a Heightmap Impostor in any way more performant than a MeshImpostor

2… Can a Heightmap Impostor be used WITHOUT creating the mesh with CreateGroundFromHeightmap. Basically i have authored mesh tiles already dont need to actually create a ground mesh. But i can also export the heightmap image i used at design time to generate the mesh in unity. But i cant see how you use a separate heightmap image to create a heightmap impostor for an already authored terrain mesh.

3… Is it better to have several small chunks of terrain tile mesh. And what is considered too many. Should i allow you break a large terrain down into 16 tiles, 32, 64, 128 etc… how much is too many terrain tiles. Same for collision meshes (if using mesh impostors instead of heightmap impostors)

basically in unity i can generate the LARGE terrain or segment them out into tiles… I can also generate seperate collision meshes and generate those to even more tiles than the underlying terrain visual meshes… Allow you you have several more smaller collision mesh chunks.

Or i can generate LARGE heightmap terrain images representing the WHOLE terrain and CHOP that image up into TILES to use as the heightmap and CREATE EVERYTHING at runtime in babylon using CreateGroundFromHeightmap and possibly also generating LOD for each segment and i suppose since i am using the ground terrain no need of a separate collision mesh for the impostor since it is using the underlying image the ground was created from… I think.

Anyways… I need your advice on creating the BEST possible terrain exporter for the toolkit. Not just what is quicker, but what will be the BEST DEFAULT terrain export system for the UnityExporter… Thanks again for your input :slight_smile:

1 Like

There are a couple of options for this but its tricky to give a recomendation without doing more research into Bullets physics engine. There are a couple forum discussions around supporting terrain

  1. Just guessing I would say there might be somewhat better perf using heightmap impostor may be better as it limits the positions of the mesh which might make certain physics optimizations possible but these may be insignificant.

  2. I don’t think this is supported currently but should be possible in theory. Also ammo does not support heightmap impostors currently.

  3. This likely depends on the scene size as well as how much traveling would be done in the scene. From the forum post above it recommends using chunks to only load what is needed at a given time.

Likely you will need to test out each method to know for sure. I would likely start with trying to use mesh impostors to start, if that is not working well, try playing with tile sizes, then try using height map, then see if there’s any other ammo specific features that can give it a boost.

Yo @trevordev

So i would be better off still creating my terrain tile meshes as design time, as well as creted several collision mesh segments and using the regular MeshImposter…

Is it better to make my terrain collision mesh tiles as convex hull imposter and actually convex the collision geometry ???

Are you asking if you should use mesh impostor or convex hull? I would try mesh as terrain may not be convex.