-
-
Notifications
You must be signed in to change notification settings - Fork 36.2k
Add FastHDR environment example page #31749
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
what is the basisu command to generate this ktx2 files for envmap? |
|
There's no single command to generate them right now. We're working on providing tools to make this easier, but it's so much better than the status quo that we wanted to share some preprocessed files already. Right now there's multiple steps involved as it combines two ideas to make it both fast and memory efficient:
PMREM HDR 4x4 works "right now" for a number of three.js versions, as seen in this PR. HDR 6x6 will be even smaller and we got it to work with an updated BasisU transcoder, see #31718, so that's a potential future improvement. |
|
Would be okay if we wait with a merge until users are able to generate such KTX2 texture with your mentioned tools? Otherwise I fear additional support effort since we have to explain users the incomplete workflow. |
|
Users are able to generate them today (see my post above), but I agree that it should be easier. I think it's already quite useful with the set of processed files we made (happy to add more by the way if you want specific ones!) since it makes all three.js apps faster, and the building blocks (pmrem, compression, etc.) are already in place. Out of curiosity, what would be the minimum for you to consider as "complete workflow"? Is a description of command-line tools ok? Using Draco or KTX2 nowadays also often requires command-line knowledge. |
|
I think for a good adaption on the user side there should be a command line tool that let you do the conversion in one go. Something like: The general interface could be like in gltf-tranform if it makes sense to have more than one command: |
|
Certainly a CLI is more practical, but we do have the example at https://threejs.org/examples/?q=exr#misc_exporter_exr for exporting PMREM data as OpenEXR files, too. |
|
Hey there, the technical article is live: I would love input from all of you! Would be cool to get this merged for r180! |
|
The section "Creating files in the FastHDR format" is sufficient for me from a support perspective. If developers have questions, we can guide them towards this article. |
|
That's great! We'll also make sure to add links to the article from the FastHDR landing page (linked in the example header) |
|
Added controls to the example for exposure, fov and blurriness + some more hdri images to switch https://three.needle.tools/examples/?q=fast#webgl_materials_envmaps_fasthdr 20250901-110111_three.js_examples_-_Google_Chrome.mp4 |
|
Hmm, have you guys considered calling it I know it's not as catchy as I also proposed renaming |
|
We're open for suggestions – that being said, the idea with" FastHDR" was to make it clear that this is, indeed, faster, hopefully helping with adoption (don't think there's any real downside to it). I think PMREM HDR is too complicated – it's yet another acronym and people need to know a lot to understand what it means (and it's an 8-letter acronym 🤔)
Yes, there would need to be some support for either the CubeUV format, or for shuffling the blocks around so that the loaded texture is an equirect map with mips, for example. But it's kind of the same with UltraHDR, it also has RGB and mono modes, and various ways to use the metadata, and I don't think many systems actually support multiple ways? Can see why UltraHDR has beat JPGHDR lol |
|
Thanks for merging! Question @mrdoob : the example page is now marked as "external" but I think that is usually used for external code references – FastHDR doesn't have any external references, it's just regular KTX2Loader used slightly differently. So I think "external" can be removed?
|
|
Strictly I think environment maps are not “high dynamic range images” — UltraHDR's compression methods are optimized for display- and perception-based metrics that don't necessarily apply to raw / scene-referred / floating-point RGB data. If UltraHDR gives results you're happy with, great! Just be aware of that possible mismatch if quality isn't as expected in some cases. “HDR” is a fine term for describing modern display hardware, and (IMO) much messier and muddier when applied to anything else, but oh well. 😅 Arguably "PMREM HDR" is a bit of a contradiction for that reason. "FastEnvironment" or "FastIBL" would avoid these conceptual challenges. Just my drive-by thoughts though, naming is hard, and I like the PR! |
Wow that's extreme! Are you using Telekom by any chance? I think there have been issues with Cloudflare and Telekom in the past but haven't heard about it anymore for a while. |

Description
This PR adds an example for using FastHDR environment maps, which are smaller, load faster, and use almost no GPU memory in comparison to both EXR and UltraHDR.
Technically, FastHDR textures are "Precomputed PMREM in KTX2 UASTC HDR 4x4 format". (We chose that name to have something similar to "UltraHDR" which is also a "nice name" for a complex technical description.)
We have already processed a number of environments into this format, and they are CC0 and can be found here: https://cloud.needle.tools/hdris. We're working on some tools to make it easier to use the toolchain needed to precompute EXR textures as PMREM and then compress them with basis.
Live:
https://three.needle.tools/examples/?q=fast#webgl_materials_envmaps_fasthdr
Screencapture:
fastenv.mp4
This contribution is funded by Needle