PDA

View Full Version : Quick question. Close approximation of height information from a drawn map for 3D?



Chin Swift
06-15-2013, 11:16 AM
Hi there! I feel it's best to come and ask the experts of such a concern.

I am with a group of close friends working on an open world fantasy sandbox game which has been in 'hobby' development for a few years now. We are currently trying to wrack our brains over how to as accurately as realistically possible, transfer height information over from a drawn 'painted' style map, a-kin to the many maps on this site, onto a height map for use as a base to shape the 3D terrain of the game world.

We have the world map in the form of a drawn map, and wish to create an accurate 3D terrain of this map. I am wondering if there is any information how to go about performing this process. We have tried so far to generate a normal map from the image and then convert that to a height map. This is a fairly close approximation but problems arise due to the normal mapping, which takes vertex normal direction as colour information, where as a height map takes absolute pixel height information (as a binary integer between 1 and 255) per pixel as colour information.

Basically this means that a mountain on the original map will actually make a smaller mountain, offset slightly, and a gully next to it, as the 'height' on the height map will actually be a generated from the lighter colour for 1 side for the mountain, and a darker for the other based on normal information, not 'height' information. It basically means that a height map from a normal map is a weird sort of scewed reflection, instead of a direct representation.

It works, sort of, and has been the best results so far but it is still a long way from something we would be happy with.

I am wondering if there is any information available about the general workflow of retaining and transferring topological detail as formed in classical map creation, over into crafting a height map for 3D terrain generation of the originally created topology in the map.

We are making acceptable progress in experiments, but as ever, asking the professionals about any information regarding this concern is a no brainer :)

Thanks in advance for any advice!

monks
06-16-2013, 05:08 AM
Hi, I'm sure there must be at least one tutorial on here somewhere that will help. Can you post an image of your map, or some representative section of it?

monks

Chin Swift
06-16-2013, 03:18 PM
Thanks for replying. Sure!

Here's the over all world map (https://photos-3.dropbox.com/t/0/AADhlAP9yd2Xx6UvV35L2RrGLVYRZ-_FTLtitxaYlOSLhA/12/81011765/jpeg/32x32/3/_/1/2/World%20Map%20-%20Final%20Blank.bmp/PIjRE32yAkmELyBYZHgrd8fidepLCxXP-pL1Cdz5kRQ%2C4NKjCRbFpAnXxNLe8M18BmVpmMo76BDtwN0S2 E0qfE8%2C1fx6vWPFZaa5rrhCwTNQiyyZtN_4QL9tyC2GDaQ1k T4%2CSa8iaaTBRJNYCtYClZ0Eo5prRzK28KAXLsJi7XM8as8%2 CIz7Pmw6XD8dAp_xqzASmhjz_-nLWHEw09s-96iE4amY?size=1024x768)

Here's the Southern Continent (https://photos-3.dropbox.com/t/0/AAA0clnUKyk3HguEVLxctaot7bSgfyLgKetiYoePcVkkNg/12/81011765/jpeg/32x32/3/_/1/2/Southern%20Continent%20-%20%20Blank.bmp/pg9B2AiZvCLfSx6D8NM7RMVw0kSHhLQB1ncv04tIyx4%2CjTzn EawVehoaGciKGgxUcYB0txMFZM1OTIfRMUwCE2Y%2CKBesd6AT y45vG9ftXIgN5SK8dMMQyIM2CO-xEZylIzo%2CbVaHt9PnduLxyq0d5nWoRglklXTj5Gx0vc7poRL z7xo%2CZVBfiiUL0B3g5LsDO50kXrktuXa1tZXKDPxkkpL3e24 %2C7chiBFzvZCaBPpAyZiX8Bm8ptFWPHQ80espuQhLUF5Q%2CK T2LnvuvOGr8qL2uZYSr8RjVjoQbFmLHbhQyJmr8a8s%2CALNm3 V2_ayvISy8qSQvRYYo9DrFdnVInmRD_tlygPVM%2CJcPpl029s BgrOCQiHq9T2n83YZmLjvtdh55OQhp1tAo%2COOSvWoxdVAgKS _F_HpIoHHyROfq4Egojnp2juzC6GOE%2CPaEE6uhnLQSXZcAgk QO9rFzV_IKuBVfxIz1bz_TDbWg%2CdEF7S3oKU4BVF1ULbV0LF vbYUNruD1cY7aXymSAa4p0%2Cu4g9ngO1bK7V6ZMVncVwaEt2t 25qSy00HbXU10NyKWQ?size=1024x768), close up.

Here is the south western peninsula (https://photos-3.dropbox.com/t/0/AACO0t7TtBAQELFuAxg-NYwvdfUK5lP8iwK6lIUPc_lYHg/12/81011765/jpeg/32x32/3/_/1/2/outline%20for%20game%20map.bmp/9MGzsnS--URZmrGpm2N42dKe1wve5ntjU98HT-8jHbQ%2CUmMP_l-uUrTg24eLewrP1uv4wAxEAkf77QglOKViX3Y?size=1024x768 ) of the southern continent that outlines the focal points of the civilizations and landscaping details existing in that area. (the border between the blue and red overlays marks the frontier between the Amaducan (red) and Vihuali (blue) Empires.)

Here is a concept piece (https://photos-6.dropbox.com/t/0/AACZAaN2PcM9K_Gh6hhl_p1z1N4_2l3j4AoZED-3D52H-g/12/81011765/jpeg/32x32/3/_/1/2/Mt.Osunas.bmp/EN2isa5pCrr749mY3ksYsNVatxuglMQBT1sNAPkUXPA?size=1 024x768) of 'mount Osunas' (labeled Osunas on the previous overlay).

Here is the south western continent (https://photos-5.dropbox.com/t/0/AACJo8EQ_FxO5QI4Q8AaqbF_pySZl8WPJhgPIvMZqeMTEg/12/81011765/png/32x32/3/_/1/2/New%20Vihusa.png/xEFBZT0DLlMGWd8e0F_zpZN8cZGfiZtV0gGF7i3PCDA%2CSkEH AKBcnrra6W7SZGoEdeXJ_D7DE_UqndGVRYbCaXo%2CSjbwMJuT XhZetDzzfeJdICXZnR3sDUGqF9xoY_T6C5A%2C3XGV40l_zoxe qAeLdjjKdfK3sjpgJ7j5LA53f8YPRao%2CZOYkXIUTNb5Q0G6A dUAN24RB-TZhUwlMFqJ9-OrFw_g%2Cxp4xhz8XGUxHNruwj_-SUq55IHSdDZj-H2bV5zeMKeo%2CqyVXOIh5UcHKkk2P5R5FjH4T7Add6o7H40ua lwXpYJE%2CaKxL94MuqmxMpnuNf0YrMnFo0j7ThtSouuV_xnFB RLc%2Czg8rsfHTiHdOMIt_LGaCA2fJLCWo48JqSHyrVYP_fnY? size=1024x768) without the overlay, that we have been using as a base for conversion attempts.

Hope this is of use to any possible help. :)

Midgardsormr
06-17-2013, 09:32 PM
I have not yet encountered an algorithm that can do what you describe: Take lighting information and turn it into height or depth information (from the way you describe it, I assume you're working from some kind of shaded relief original map). It's actually something that I looked for pretty hard about a year ago, when I was investigating new ways of converting movies to stereo 3d. Intuitively, it seems like something that shouldn't be too difficult, but I suspect that accounting for non-planar shadow-catching surfaces makes it a great deal more complicated.

I think if I were approaching this task, I'd use the original map as a template and paint the heightmap over it. Gimp has a nice gradient feature, where if you draw a selection, it will create a gradient from the center out to the edge. That would probably be a good tool to start with. After painting it up, I'd then run it through Wilbur, which is a free utility that can perform erosion simulation.

waldronate
06-17-2013, 09:56 PM
Shape from Shading algorithms exist, but how well they work depends on the nature of your surface and how much quality you require in your output. As Midgardsormr suggests, however, the fastest and highest-quality results will likely be from painting your image directly.

Korash
06-18-2013, 01:06 AM
Chin Swift, it seems that we can not access your drop box files......We can host images here at the guild as well, and it makes it easier to see them and the posts containing them don't usually get moderated (which yours did). If you want to post the images here all you have to do is use the Go Advanced button located below and to the right of the text box. That will bring you to an expanded text box with added options - and just to the right of the smiley icon is the button for attachments. Click that and follow the instructions and your post will automatically have a thumbnail of the image. There are size restrictions for images based on what type of file they are, and I believe you can find those in the FAQ near the top of the page.