Panorama Transformations


Panoramas come in many different layouts, each with their own advantages and disadvantages. The most common layouts are:

Equirectangular

Default layout of most panoramas, also the standard layout for most 3D applications.

Pros: least amount of seams, no distortion at the horizon level.
Cons: larger filesize, impossible to manually paint on the top of the sky due to the distortion.

Cube Map

Often used in computer games because it has the most space efficient layout (and this format has hardware support).

Pros: least amount of distortion, small filesize
Cons: many seams make it hard to paint anywhere but in the middle of the cube faces



Lightprobe

Because of the massive loss of detail in large parts of the panorama this format is not recommended for anything but lighting or scenes where the reflections do not need much detail.
This format used to be popular because it was easy to capture by photographing a mirrored ball.

Pros: smallest filesize
Cons: A lot of distortion and massive loss of detail




Converting between layouts


There may be times when you want to paint in a panorama. The equirectangular layout is pretty good for this, excep when you want to paint on the top part of the sky. In that case the best option is to convert the top part to a cube face so you can work on it. When you are done, convert the cubemap back to the equirectangular format and overlay the correction.

Converting 8-bit panoramas is easy with the utility Pano2VR:



Simply load the panorama in Pano2VR, press the 'Convert input' button and select which output format you want. When you are done making your corrections, drag the corrected panorama back into Pano2VR and convert back to the equirectangular format.

Keep in mind that any conversion slightly decreases the image quality, so it is better to mask out the parts where you made corrections and layer it on top of the original (untransformed) panorama.

Another utility which does panorama transformations is Bixorama.


Converting HDR panoramas with Flexify


The easiest way to transform HDR panoramas is using the Photoshop plugin Flexify 2 by Flaming Pear Software:



You can change the 'Latitude' setting to -90 and work on the top part of the sky, and then transform it back. Do this on a copied layer so you can mask out the changes only. That way most of the panorama won't have to be resampled twice.


Converting HDR panoramas with PTGui

For larger panoramas it might be faster to use the panorama stitching program PTGui to convert to a cube face and back.
It's quite involved, but in practice this is pretty fast and you can save the project and just drop in a new file later.

This is how to do it:

1. Open up PTGui and load your equirectangular panorama by pressing the 'Load Images' button. (Input any number for the lens settings)

2. Press the 'Advanced' button and go to the 'Lens Settings' Tab. Set the lens type to 'Equirectangular'. The horizontal views should be set to 360 degrees.



3. Go to the 'Panorama Settings' Tab and set the panorama type to Rectangular and the Field of View to 90 degrees for both Horizontal and Vertical.



4. The next step depends on which cube face you want to render out. Generally this will be the top of the sky. Go to the 'Image Parameters' Tab and set the Pitch of the image to -90 degrees. In the preview you will see the top cube face. Press CTRL-E to see a bigger preview.


5. Make sure that at the Tab 'Exposure/HDR' the Method is set to True HDR.

6. Finally, go to the 'Create Panorama' Tab and click on 'Set Optimum Size' and select Maximum size. The input panorama I used is 12.000 pixels wide, and this gives a 3818 pixel cube face.



7. Press 'Create Panorama' and your top cube face will be created.



To convert back you can use the same method, but with a 90 degree FOV rectangular lens, and the panorama type set to Equirectangular 360x180 degrees. The image needs a 90 degree Pitch. Paste the result over your original panorama in Photoshop and erase the edges for a nice blend.