Hi all, I’m trying to figure out what would be the best approach to create hills/cliffs on the fly, based on a 2D grid of tiles that are either blocked or not. Take a simplified grid like this, with randomly clustered blocked tiles and a random size:
1111111111 1110011111 1100011111 1111011111 1111001111 1111111111 1001111111 1111111111
Let’s say I want tiles that are 0 (zero) to become hills or cliffs, where some kind of center of mass determines the height (thus creating peaks the bigger a hill is.
I’ve looked at libraries like Shapely or Open3D to create meshes, but they both seem a bit too much for my purpose. It feels like this could be done much more efficiently for this specific cause.
I am leaning towards cutting up every tile into 4 triangles and have the sides of eacht tile match with neighboring ones. Using some noise algorithm, I’d be able to create a random effect. Counting neighboring blocked tiles might give me a sense of height increase, so that tiles on the edges of the hill shape are lowest (effectively approaching the floor level).
I have also tried writing the grid to a height map image and using that in a GeoMipTerrain, but I need just the hills (not the surrounding flats), I need face shading (not vertex) shading and I’d really like to have more control over some kind of randomness (noise) per vertex.
I can imagine others have struggled with this, and probably have figured out a good to perfect solution. I’d love to be pointed in the right direction!