3
\$\begingroup\$

I'm wondering how I can create a spherical heightmap.

In my ideal workflow, you'd see a 3D sphere that you can edit using procedural terrain techniques (like World Creator) and that spherical terrain can be exported into six seamless images based on what layout you want your images to fold up into a cube in-game to create your planet.

Another option would be if you can at least tell the program you want specific images to tile with other images, such as the designated 'front, right, back, left' images tile with each other and the 'up, down' images seamlessly.

Specifically, I'm making planets for a game that wraps six images into a cube and 'inflates' them into a planetary terrain.

I've made a few basic heightmap sets in a program called Scape, and flipped them so at least four of the images mirror each other, then I edited the interior of those maps to all be different so the landscape isn't repetitive. However, manually editing the top and bottom maps is very daunting to get perfect, and I'm creating a dozen or more planets.

I'd like to know how to make 'front, right, back, left' images tile with 'up and down' images and I can edit the interiors of the images in a 3D program of choice. I've been directed to this site from search queries many times, but I'm a newbie to all things code so I have no clue how to use things such as the Diamond-Square method or any algorithms to achieve seamless textures (what program do you actually use, literally a python script you write in Notepad++ or something?).

\$\endgroup\$
0
\$\begingroup\$

When solving this problem in the past, we used an out-of-the-box terrain sculpting tool like World Machine together with a custom terrain merging tool created by our technical artist (in C# I believe).

We used the stock sculpting tool to create highly detailed, non-tiling, flat terrains, roughly twice as long as they were wide. We'd make two such terrains for each planet: one representing the equatorial to tropical regions, and one representing a "cap" over each of the north & south poles.

After exporting the terrain maps (height, material info, etc), we'd load them into our custom-built tool. This would wrap the first map around the planet in latitude-longitude form (equirectangular mapping), and blend-out the seam. Then it would cross-fade to the cap maps at the poles.

The tool had a 3D preview pane so you could orbit around the planet and inspect the merged result before saving, and exposed sliders to control the rotation/scaling of each patch being blended and the sharpness of the blending between them.

This workflow successfully shipped 7 unique planets, though I'm still leery about the distortion we get from the particular map projections we chose. I kind of wanted to explore using the Peirce Quincuncial projection, which tiles through simple rotation.

I have no clue how to use things such as the Diamond-Square method or any algorithms to achieve seamless textures

If you have questions about these algorithms, feel free to post those specific questions here and we can try to help you out. Just be sure you've searched for previous Q&A on the topic first so you're up to speed on what's already been covered. A couple off the top of my head:

(what program do you actually use, literally a python script you write in Notepad++ or something?)

Usually custom procedural generation algorithms are implemented as part of the game's code if you need runtime procedural content (eg. Minecraft, roguelikes). If you only need procedural generation offline, as in the example above, it can sometimes pay to implement it as a standalone tool program written in the language of your choice, in the IDE or text editor you prefer working in. Since it doesn't need to run with the game, you can be a bit more loose with performance or other factors, and prioritize languages/UI frameworks that help you speed up development, even if they have performance costs.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.