Jump to content
3DCoat Forums

Import/export heightmap for sphere?


Innovine
 Share

Recommended Posts

  • Advanced Member

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.. :/

Link to comment
Share on other sites

  • Advanced Member

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
Link to comment
Share on other sites

  • Contributor

@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

Link to comment
Share on other sites

  • Contributor

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
Link to comment
Share on other sites

  • Advanced Member

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?

 

Link to comment
Share on other sites

  • Contributor

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.

 

Link to comment
Share on other sites

  • Advanced Member

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
Link to comment
Share on other sites

  • Advanced Member

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
Link to comment
Share on other sites

  • Contributor
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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...