Support loading Radiance HDR panoramas as cubemaps - #25802
Open
stuartparmenter wants to merge 7 commits into
Open
stuartparmenter wants to merge 7 commits into
stuartparmenter wants to merge 7 commits into
Conversation
stuartparmenter
force-pushed
the
feat/equirectangular-to-cubemap
branch
from
September 15, 2026 20:24
797fd86 to
096b588
Compare
stuartparmenter
force-pushed
the
feat/equirectangular-to-cubemap
branch
from
September 15, 2026 20:29
096b588 to
64c1d8c
Compare
Zeophlite
reviewed
Sep 19, 2026
| use wgpu_types::{Extent3d, TextureDimension, TextureFormat}; | ||
|
|
||
| /// Loads HDR textures as Texture assets | ||
| /// Loads Radiance HDR images, optionally converting lat-long panoramas to cubemaps. |
Contributor
There was a problem hiding this comment.
Feels strange to bolt this onto HdrTextureLoader , rather than have a separate loader
Zeophlite
approved these changes
Sep 19, 2026
Zeophlite
left a comment
Contributor
There was a problem hiding this comment.
I think this PR would benefit from a screenshot
Contributor
Author
|
ctt 0.6.0 added support for equirectangular to cubemap, so I've rewritten this on top of #25959 so we don't need to write all of this ourself |
Contributor
Author
Zeophlite
approved these changes
Sep 30, 2026
# Conflicts: # crates/bevy_image/Cargo.toml # crates/bevy_image/src/compressed_image_saver/ctt.rs
cwfitzgerald
approved these changes
Oct 2, 2026
cwfitzgerald
left a comment
There was a problem hiding this comment.
Here comes the sun, do do do do
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Objective
Load lat-long panoramas from Radiance HDR (
.hdr) files as cubemaps without an external conversion tool. The HDR loader currently returns a 2D image, which cannot be used directly as a skybox.Related to #12455 and #19125. This grew out of loading the environment map for Zorah v2.
Depends on #25959.
Solution
Add
Image::equirectangular_to_cubemap(face_size), built on ctt's equirectangular projection and gated behind a newequirectangular_cubemapfeature. Add an optionalcubemap_face_sizesetting onHdrTextureLoaderSettingssoasset_server.load()can return the cubemap directly.Also register the HDR loader with
CompressedImageSaver, so the asset processor can convert and compress the panorama in one step.Testing
This was AI w/ Fable 5.1 and Astra as part of my work to get the Zorah scene working. I needed to be able to take their hdr skybox/environment map file and load it and apply it, so had the LLM help build it, test it, then iterated on it to optimize it and add asset loading and compression support, then reviewed and cleaned it up.