microsoft / DirectXTex

DirectXTex texture processing library
https://walbourn.github.io/directxtex/
MIT License
1.8k stars 443 forks source link

Add cubemap support for OpenEXR #483

Closed vkaytsanov closed 1 month ago

vkaytsanov commented 3 months ago

OpenEXR format can includes metadata indicating the image is cubemap which is six images in a single file.

vkaytsanov commented 3 months ago

@microsoft-github-policy-service agree

walbourn commented 3 months ago

Thanks. I didn't realize OpenEXR stored envmaps directly. Can you point me to an example data file?

vkaytsanov commented 3 months ago

Hello, the test I did was using their tool that ships with vcpkg, it is called exrenvmap.exe. Official documentation: https://openexr.com/en/latest/bin/exrenvmap.html

The attribute envmap is also documented at https://openexr.com/en/latest/StandardAttributes.html

These are the test files that the tool used and produced skybox.exr in the archive. Note: I could only open these files with Photoshop to view them: forest.zip

walbourn commented 3 months ago

For texassemble it makes sense to load an .EXR with "envmap" as an array of six images and write it as a cube-map or array texture. For texconv it probably should be treated as a texture array for consistent behavior within the tool.

walbourn commented 1 month ago

I'll take this PR and do the code review in a new PR #494

Thanks!