Best Way to Create Cube Terrain Mesh

Hello, I am new to Babylon and 3D in general, although I have done quite a bit of 2D game dev.

I am interested in making terrain from cube shapes, but not exactly voxels. I am aiming for something that looks like the terrain in Cube World, but it will completely static. Nothing will be modified or destroyed. I haven’t been able to find what I am looking for on google and I think a full blown voxel approach might be overkill. Hoping someone can point me in the right direction.

My first question, is a mesh the right way to do this? Can I accomplish this with a height map by turning subdivisons to 0 or something similar?

Secondly, is there an algorithm or best approach to connect all vertices so I can only store visible faces of the cubes instead of creating all vertices of a cube and culling? Maybe if height_map can be used, this won’t matter. My goal is to have it be like a folded piece of paper rather than stacked cubes. Hopefully this makes sense.

Thanks for any help!

Hello and welcome!

yes meshes are probably the good way to go. Probably by merging all the cubes into one big mesh or by leveraging instances

heightmap cannot be use here as it is purely a 2D approach

Could you please explain how heightmap is only 2D? There is an example on the Babylon page where a heightmap of the world is used to generate a 3D render of the world map.

Yeah sorry I was unclear. By 2D I mean it only change one dimension of the mesh (Y axis) and then let the 2 other axes unchanged