Download

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

[SOLVED]

This issue has been solved by both **Arkiras and NotSoAccurateNo1 **in two different methods, if you’re having the same issue, check out their messages below. Feel free to revive this thread with new comments, but don’t expect new responses.

[ORIGINAL POST:]

I want to import cubemaps I rendered out in blender into unreal, but I can’t for the life of me figure out how I get from a .png image that blender exports to the very specific kind of .dds that UE4 asks for. I’ve tried the ATI tools, which only give me coloured cubemaps and I can’t figure out how to export my .png cubemap instead of the placeholder colours and the NVIDIA tools won’t let me import my cubemap as a cubemap and just completely remove the option of exporting it as one.

Here’s an example of a test cubemap I’ve rendered out:

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.

I couldn’t really figure out how to do that, but after clearing my head a bit and this rather simple explanation I finally get it! I’ll do that, so the cubemaps will match the graphics of the game. Thank you very much for your help!

For simple cubemaps, like what you rendered in blender, you can render them in ue4 with a captureCube component.

  1. add a captureCube to the world or to an actor blueprint.
  2. add new renderTarget cube for the captureCube
  3. then you rightick the rendertarget and save as static texture.

You can also convert jpg to cubemap by adding a uv sphere around a capturecube. Material has to be 2 sided. The material shading model set to unlit. texture plugged into emissive.

Guys, you can use this page to convert any img file to hdr, i tested and worked pretty fine

https://convertio.co/