-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
Use WEBGL_render_shared_exponent for HDR textures #27971
Comments
More info: see |
What type of typed array are you use and how do you prepare the data if you want to use Is there some sort of reference implementation that we can use similar to the code of I understand the engine has to support the |
Maybe from https://registry.khronos.org/OpenGL/extensions/EXT/EXT_texture_shared_exponent.txt:
@elalish Does that look right? |
I have no idea - figured it would be easier to construct the data in a shader and let the GPU driver handle the format. Might be nice in conjunction with the UltraHDR support @mrdoob is working on, since that'll involve multiplying two SDR textures to get an HDR texture. |
KTX Software can generate E5B9G9R9 from float32 EXRs as well:
Size on disk looks similar to a compressed EXR, but the memory cost would be lower. We'd probably also need to add support to detect E5B9G9R9 in THREE.KTX2Loader. |
Just wanted to copy over my comment from #28012 since it might be important for this discussion:
|
Uh, I thought that was the whole point of WEBGL_render_shared_exponent, which says this:
|
Note that browser support is necessary but not sufficient for support on any given device, the graphics drivers also need to support it. Unfortunately overall support is currently 0.07% according to https://web3dsurvey.com/webgl2/extensions/WEBGL_render_shared_exponent. 😞 |
Sorry, I should have written my comment more clear. I just wanted to note that I couldn't get the RTT use case to work on any of my devices and yeah the reason is the missing |
Ugh, sorry, I should have checked driver support. I made the error of thinking Safari and Chrome supporting it meant it was already widely available. Well, it'll be nice someday... |
Should we revert #28012? |
@mrdoob Would you be okay if we add the routines in the addons folder somewhere? As mentioned in the PR |
Never mind, I put the code into a Gist. That should be sufficient for now^^. https://gist.github.com/Mugen87/459649eece614c4e6d57177c138757e1 |
Closing. We can reconsider producing |
Description
This should give better GPU memory usage than our current half-float textures, which could make a significant difference to render speeds since the environment map is a bit of a cache-killer. What do you think @WestLangley, @mrdoob?
Solution
Use WEBGL_render_shared_exponent, which apparently already has Chrome and Safari support - we should check on the rest of the browsers.
Alternatives
Leave it as is, I suppose.
Additional context
No response
The text was updated successfully, but these errors were encountered: