[SOLVED] How do I import a .png as a cubemap

Ah yes, another poor soul discovers that working with Cubemaps in UE4 is absolutely terrible. We can convert a regular texture to a volume texture or a virtual texture but lord help us if we want to make a regular texture into a texture cube.

In order to import a Long/Lat cubemap like yours you have to import it as an hdr file. How do you get a .hdr file? Well therein lies the dilemma because it seems most image editing software will not save to this. Photoshop might, but I don’t have that. What I do have though is Substance Designer, which will also save an HDR:

Once you’ve got your .hdr file and you’ve imported it to UE4 you’re going to notice a number of immediately obvious problems.

  1. Because UE4 is expecting an HDR image and your image is an 8bit PNG, the colors will not be correct. You can compensate for this a bit by setting the brightness curve on the texture asset to 2.2
  2. The cubemap resolution will be noticeably worse than your import resolution. It won’t display higher than 1024x512. You can adjust the max texture resolution but be brace yourself, the memory consumption will be ridiculous. I don’t recommend going to 4k with this and I would urge you to use a different compression setting than default HDR.

If it is an option for you then I would strongly suggest you generate your cubemaps from inside UE4, using the Capture Cube actor and a render target.

5 Likes