How to make normal maps that map to a sphere from bitmap images?
Posted: 03.11.2021, 20:54
I'm working on updating Saturn and its moons for default Celestia, and I need normal maps for several moons. I at least need a normal map for Iapetus, since Project Echoes uses a model and I'd prefer not to use models for near-spherical objects by default. It would also be nice to have better normal maps for Enceladus, Tethys, Dione, and Rhea than the ones in Project Echoes. (Mimas is irregular enough to use a model by default, and Titan doesn't have good height data.) To do this, I need to convert existing bump maps to normal maps.
Unfortunately, most tools for creating normal maps don't work correctly for a texture mapped to a sphere (the scale near the poles is wrong). The only tool I know of that does work correctly in this regard is Fridger's NmTools; however it doesn't work correctly with bitmap source images, such as PNG images. I keep getting results like this:
So how can I convert a bitmap bump map to a normal map that maps to a sphere? There must be some way, given that Celestia Origin and Project Echoes exclusively use normal maps, at least some of which must have been converted from bitmap images. I guess I could just not be so perfectionist and use a model/bump map/incorrectly scaled normal map for Iapetus and possibly other moons - or even an already existing Iapetus normal map, if there is one - but knowing how to do this would be useful in general.
Also, on the topic of Saturn's moons, here's a surface texture for Titan using the alpha channel as a specular map, just like Celestia's Earth texture. Credit to FarGetaNik and Askaniy for the source textures used.
Added after 45 minutes 32 seconds:
Edit: The Iapetus model/heightmap (as well as Enceladus and Rhea heightmaps) is derived from here, which has no clear license, so unless the license is clarified and compatible with the GPL it can't be used in default Celestia. It seems that default Iapetus will have to remain without height data for now. I'd still like an answer to my question though.
Unfortunately, most tools for creating normal maps don't work correctly for a texture mapped to a sphere (the scale near the poles is wrong). The only tool I know of that does work correctly in this regard is Fridger's NmTools; however it doesn't work correctly with bitmap source images, such as PNG images. I keep getting results like this:
So how can I convert a bitmap bump map to a normal map that maps to a sphere? There must be some way, given that Celestia Origin and Project Echoes exclusively use normal maps, at least some of which must have been converted from bitmap images. I guess I could just not be so perfectionist and use a model/bump map/incorrectly scaled normal map for Iapetus and possibly other moons - or even an already existing Iapetus normal map, if there is one - but knowing how to do this would be useful in general.
Also, on the topic of Saturn's moons, here's a surface texture for Titan using the alpha channel as a specular map, just like Celestia's Earth texture. Credit to FarGetaNik and Askaniy for the source textures used.
Added after 45 minutes 32 seconds:
Edit: The Iapetus model/heightmap (as well as Enceladus and Rhea heightmaps) is derived from here, which has no clear license, so unless the license is clarified and compatible with the GPL it can't be used in default Celestia. It seems that default Iapetus will have to remain without height data for now. I'd still like an answer to my question though.