4.14+: Importing .dds Cubemaps w/o full mip chain clears Alpha

Hello,
There is an issue with .DDS cubemap importing in UE4.
Users may want to import RGBA cubemaps (e.g. if they’re attempting to encode HDR data in an LDR format, such as with RGBM or RGBD encodings for making Light Probes / IBL). If a user attempts to import an RGBA Cubemap (which is only possible with .DDS importing), and any mip levels are missing in the .DDS file, the alpha channel is cleared to 0.

This is because of the function IntegrateAngularArea in file TextureCompressorModule.cpp. It seems to be designed for cubemaps generated by the engine or imported from .hdr files, neither of which would arrive with an alpha channel, and thus uses the channel as working storage for the integration step.

If the entire mip chain is present in the .dds file, no resampling is performed and the alpha channel for all mips is preserved.

This issue was really perplexing to figure out, and I saw no discussion of it online, so I’m posting this to save the next person who hits this some time.

Hey AdrianAtGoogle,

Thank you for taking the time to post this observation. I did some searching through our database and found dealing with “DDS files with custom mipmap can not be imported.”

UE-24529

Note: Link might not work until the beginning of next week.

The end result being a ‘Won’t Fix’ as the original implementation of Importing .DDS Cubemaps was to have them working as reference.

Allowing DXT compressed DDS is troublesome. Either we recompress and add artifacts or take the input directly - engine goodies like mip sharpening won’t work, other platforms might recompress to a different format. The quality loss is something we want to avoid. DDS compressed as DXT1 is unsupported.

Let me know if you have further questions.

Thanks,