Русский New site

Advanced search

[ New messages · Forum rules · Members ]
Page 1 of 11
Forum » SpaceEngine » Mods and Addons » Cube map conversion (other way around)
Cube map conversion
Fireinthehole-Date: Saturday, 15.03.2014, 01:58 | Message # 1
Pioneer
Group: Translators
Sweden
Messages: 365
Status: Offline
I'm not sure where to put this thread but I think this is where it belongs.

It is quite easy to convert an equirectangular map to a cube map, but is it possible to do the other way around, converting a cube map into an equirectangular (or maybe cylindrical) map?





Love Space Engine!
 
HarbingerDawnDate: Saturday, 15.03.2014, 06:59 | Message # 2
Cosmic Curator
Group: Administrators
United States
Messages: 8714
Status: Offline
Quote Fireinthehole ()
equirectangular (or maybe cylindrical)

An equirectangular map is a cylindrical map.





All forum users, please read this!
My SE mods and addons
Phenom II X6 1090T 3.2 GHz, 16 GB DDR3 RAM, GTX 970 3584 MB VRAM
 
Fireinthehole-Date: Saturday, 15.03.2014, 10:26 | Message # 3
Pioneer
Group: Translators
Sweden
Messages: 365
Status: Offline
Quote HarbingerDawn ()
An equirectangular map is a cylindrical map.

That's what I thought wink But is the conversion possible and if so how does one do it?





Love Space Engine!
 
SpaceEngineerDate: Saturday, 15.03.2014, 10:36 | Message # 4
Author of Space Engine
Group: Administrators
Russian Federation
Messages: 4798
Status: Offline
Of course any conversion is possible. Use some GIS software.




 
Fireinthehole-Date: Saturday, 15.03.2014, 11:13 | Message # 5
Pioneer
Group: Translators
Sweden
Messages: 365
Status: Offline
Quote SpaceEngineer ()
Of course any conversion is possible. Use some GIS software.

Great! I have the NASA G-projector software, but I can't find the conversion from cube map to cylindrical, only from cylindrical to cube.





Love Space Engine!
 
SolarLinerDate: Saturday, 15.03.2014, 14:20 | Message # 6
Explorer
Group: Users
France
Messages: 267
Status: Offline
I was searching for something like this, didn't find anything, so I wrote a little app in C# but the conversion of a cube map with 512px tiles takes 25 mins with. So I threw that off. What I did is using Blender (a free 3D suite software), map the faces to a cube, put a camera in panoramic mode in the middle of it, and render the cube shaderless with the camera into a file. It takes 2 seconds to render, I made a "conversion-ready" blender file, so it takes 30 seconds to me to setup the scene. I just have to rotate the camera to rotate the equirectangular panorama the way I want.

I will be as simple as I can (because you might not be familiar with Blender) :
- Download Blender (free) : http://www.blender.org/
- Install it, don't really care about the options.
- Open the attached blend file.

If all the faces are into one picture Example of what works
- Select the biggest cube of the two by right-clicking on it (it should be named "CubeAll6")
- Go to the "Materials" tab on the right, this button:
- Next to the "Image Texture" blue drop down, there's a + expander. Click on it to reveal a button to select the cube map.


- Go to the tree node in the top right and uncheck the eye, the mouse and the camera at the line "Cube":


- Select the camera (by right-clicking on it) and press 0. You should normally see the equirectangular map:


Now you should see the cylindrical map appear on screen. Rotate the camera with R and RR (double-press) to change the way the map is displayed. Once you're satisfied, press Z to return into Wireframe mode.
- Go into the render properties:

- Under the dimensions panel, change the resolution of the image to what you need (X value should be 2 times the Y value, to have a 2:1 ratio), and make sure it is set at 100% (to have full resolution)
- Press F12. Wait a little for the render to compute, and the generated image should appear just in front of you.
- Press F3 to save the image where you want, and on the bottom-left you have the image save properties. Boom! You have your equirectangular map !

Added (15.03.2014, 17:20)
---------------------------------------------
(continuing the post)
If you have separated faces of the cube map
- Select the smallest cube, and go to Materials tab. You will see 6 pink circles all names "POS_Z", "NEG_Z", etc...
- For each one corresponds a face. POS_Z is the Positive Z face, NEG_Z the Negative Z face, and so on ...
NOTE: For space engine cube maps, Positive Y and Negative Y images must be swapped in order to work. Plus the Negative X face must be rotated 90° Counter-Clockwise in order to work perfectly.

- For each material (pink ball), select it, go to the Surface panel, and click Open under the blue "Image Texture" drop down.
- Go select your image. After a bit, the pink ball should change into a ball with the image mapped in it.

After you're done with that:
- Right-click on the camera on the 3D viewport, and press 0.
- Press SHIFT+Z to go into rendered mode.
- You should see your equirectangular map. Pres R and RR (double-press) to rotate the camera and turn the map the way you want it.
- Once you're done, press Z to return to Wireframe mode, go to the Render tab, and under the Dimensions panel, set the resolution to what you want. Ideally the X value should be 2 times the Y value. And make sure it's at 100% (to have full resolution). Press F12 to render the map, then, when it's done, press F3 to save it. On the bottom-left hand you have the properties on how to save the image.

You're done!

Maybe that's a bit too complicated, especially if you are not familiar with Blender, so if you have 2-3 cube maps to convert, I'll be glad to convert them for you (just specify me the resolution you want of the image) !

Attachments: CubeMap_Equirec.blend(591Kb) · 1892221.jpg(8Kb) · 4800299.jpg(15Kb) · 7200981.jpg(17Kb) · 5039094.jpg(125Kb) · 7535373.jpg(8Kb)





custom landing page to share: http://bit.ly/spaceengine

Edited by SolarLiner - Saturday, 15.03.2014, 14:01
 
Forum » SpaceEngine » Mods and Addons » Cube map conversion (other way around)
Page 1 of 11
Search: