Jump to content
3DCoat Forums
Innovine

Import/export heightmap for sphere?

Recommended Posts

I have a heightmap for a sphere (its terrain for a planet) using a rectilinear projection. Unfortunately it is a bit low resolution. I would like to import this into 3d-coat on a sphere, sculpt some more detail, and then export it again at a higher resolution. Can 3d-coat do this? 

I managed to do it for a flat plane, but the distortion near the poles means I can't really sculpt those areas.. :/

Share this post


Link to post
Share on other sites

I'm afraid you need to do the rectilinear projection to spherical projection conversion on a separate program, 3Dcoat does not have tools to perform that conversion automatically

Share this post


Link to post
Share on other sites

Do you have a suggestion for software that can do this?

I'm not entirely sure if its rectilinear, or equirectangular projection, so maybe support for both..?

 

This is the heightmap I am using:

https://www.deviantart.com/fargetanik/art/Ceres-Bump-Map-16k-683946785

 

Even if I could model a crater entirely freehand in 3d-coat, how might I convert it to a heightmap, and then distort it so I could place it onto the main heightmap? 

 

Edited by Innovine

Share this post


Link to post
Share on other sites

@Innovine you can use Blender to prepare the mesh for sculpting.

Use the Ceres texture as linear environment map and bake the lighting into high res uv unwrapped icosphere. Be sure to set icosphere's material to a perfect mirror beforehand and to use linear image as render target.

Then, use this texture to displace points of the sphere using displace modifier and export the model to 3D Coat. The greater the icosphere resolution, the finer the detail you will get from displacement.

ceres-icosphere.gif

Share this post


Link to post
Share on other sites

Your baked lightmap becomes the new height map. You then use the displace modifier to bake it into the mesh before exporting to 3DC. With icosphere's topology, you won't have to worry about pinching on the poles.

Make sure to vertically flip your original height map before baking it into lightmap texture because otherwise it will end up inverted (due to how refraction works). Also, set Glass BSDF IOR to 0.

Some screenshots of the procedure:

blender-baked-envmap.thumb.jpg.21ad6dd6c71eed702e1d77b5dcb3c679.jpg

blender-lightmap-as-displacement.thumb.jpg.f7010c199a0cfabfc6bec3de2d2b61af.jpg

You can compare the displacement result to this photograph: https://en.wikipedia.org/wiki/Ceres_(dwarf_planet)#/media/File:PIA19310-Ceres-DwarfPlanet-20150225.jpg

Cheers

PS. Andrew Price has a good video on lightmap baking in Cycles:

https://www.youtube.com/watch?v=sB09T--_ZvU

Edited by ajz3d

Share this post


Link to post
Share on other sites

Ok I'm struggling to get even the low rez version into 3d coat, and I am wondering... with a 16k x 8k heightmap, thats like 128 million data points... can 3d coat handle that as the starting point for sculpting?

Once I've sculpted some more surface detail, do you think I can export it as fbx back to blender, and get blender to render out the heightmap at, say, 32k x 16k to the original projection?

 

Share this post


Link to post
Share on other sites

Why not just use a displacement map? I don't see the point of the rest of it..


A valid question. The only difference is that the method above is UV agnostic and in theory should work with any convex mesh, whatever its uvs may be.
But if you have an icosphere with polar coordinates that fit the displacement map nicely, there's no reason not to use it.

Ok I'm struggling to get even the low rez version into 3d coat, and I am wondering... with a 16k x 8k heightmap, thats like 128 million data points... can 3d coat handle that as the starting point for sculpting?


How and what are you importing to 3DC?

Once I've sculpted some more surface detail, do you think I can export it as fbx back to blender, and get blender to render out the heightmap at, say, 32k x 16k to the original projection?


My guess is that it solely depends on your hardware. Memory footprint of a mesh that is supposed to be mapped 1:1 in vertex-to-displacement-map-pixel ratio, can be significant. Especially if we're talking about 16x8k displacement map.

If you need to do some close-ups of a specific area (do you?), why not cheat your way out by using a separate mesh for that zoomed-in shot and leave the rest of the moon lowres or not import it at all? This way you could import just a fraction of the moon to 3DC for detail sculpting, and then combine it with the rest of the celestial body in your main DCC software down the stream.

 

Share this post


Link to post
Share on other sites

My software generates the in-game mesh at runtime, at different resolutions depending on the distance to the camera. That part works great, and supports arbitrary sized heightmaps. The camera is on a spaceship which can fly around and go from the surface to orbit, so I really do need that extra detail. Not everywhere, but in a bunch of places.

I've tried having a separate mesh for detailed work, and got a lovely effect, but it's left very obvious seams at the edges, and the LOD behavior is rather different, so it sticks out like a sore thumb. Since it won't cost any more performance, doing it with heightmap is still very attractive.

For my low rez experiment I was importing an icosphere as fbx or obj, with some hundreds of thousands of tris. It worked, but 3d coat stopped responding a couple of times when working on it. Maybe it would have finished some day, but I didn't wait.

Your technique seems to remove most of the distortion, which would let me save the texture, cut it into little bits, and work on them individually as flat pieces though. I could hopefully put it back together in photoshop. I'll give that a try next and see

Edited by Innovine

Share this post


Link to post
Share on other sites

Could you do me one big favor, and that is, if its possible to go from the UV'd isosphere's heightmap back to the equirectangular projection, can you suggest how? :)

Your trick with the environment map and mirrored surface was great, now how do I do it backwards? :)

 

Edited by Innovine

Share this post


Link to post
Share on other sites
6 hours ago, Innovine said:

(...) go from the UV'd isosphere's heightmap back to the equirectangular projection, can you suggest how?

Just perform standard texture baking of your highpoly detailed sculpture into a sphere that has equirectangular uvs. I'm not sure if it won't reintroduce texture distortion at the poles though.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×