How to render a Panorama (or 6 faces of a cube) that has an alpha channel (partly transparent)

I have a high resolution equirectangular panorama (12k x 6k) that I want to project to the inside of a sphere. This panorama image is partly transparent and hence has an alpha channel.

After trying out the technique mentioned here I realized that the panorama must be in a .hdr for this to work. However, .hdr does not support an alpha channel but my panorama is partly transparent and the alpha channel is important for me.

I can also convert the high res panorama to 6 textures representing the sides of a cube. Each of these textures would then be 4k. But I am not sure how to project those to the inside of a sphere.

I am curious if there is any other way to do this (probably by creating a custom material that projects the 6 faces of the cube to a sphere).

I am open to learning/reading about something new. I have spent a lot of time trying to figure this out and its a bit frustrating that Unreal does not support OpenEXR (along with .hdr) which would preserve the alpha channel.

Well, i would say, the easiest way would be to modify the HDRI Backdrop material, so that you can use your transparency in it. Since it accepts HDRI only, you would need to make your transparency a separate texture.
Then you would just need to go into it´s material folder and add your transparency/alpha texture to the material, and of course set it to a transparent material (with forward shading, to have all the inputs available).

1 Like

Hey, thanks a lot for taking time reading about my issue and your solution post!

I have one quick question. How can I get the alpha texture to be 12k x 8k ? I think Unreal has a cap on the texture sizes such that the max texture size can be 4k. To the best of my knowledge, it is only .hdr images that are allowed to be higher resolution (and unfortunately, the .hdr image does not support an alpha channel)

Do you recommend using a normal colored image as an alpha mask (perhaps a black/white image) for this?

As long as it only works with HDRI, you could render your alpha channel as a greyscale HDRI.

Sidenote: 12k to 8k is a weird format for a cubemap o.O i would have expected either 12k to 6k or 16k to 8k, a 2:1 format.

The cubemaps or spherical panoramas i have dealt with are all in 2:1, like those things here:

Edit: … yeah, why not simply use a regular exr/jpg spherical cubemap and drag it on a sphere and make it two sided? ^.^ All that math is not required, if you use one of those with spheres. Then you also have no problem using the alpha, if you set the material to translucent.

So if you get an EXR, just make sure, that you get it as a spherical cubemap (or whatever they are called), thats the easiest way possible.