Skip to content

Conversation

@Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Mar 27, 2024

Related issue: #27992

Description

This PR adds two helper methods to DataUtils for packing/unpacking floating point values in context of RGB9E5. The code is based on the C implementation of https://registry.khronos.org/OpenGL/extensions/EXT/EXT_texture_shared_exponent.txt.

I have tested the change with a modified version of RGBELoader and webgl_loader_texture_hdr. I did not add these changes to this PR since RGBELoader might not be the best spot for using RGB9E5. That's because RGB9E5 is not a color renderable format so we can't convert a RGB9E5 equirectangular environment map to a RGB9E5 cube map. This is required though since we don't support equirectangular textures in the shaders. If we switch to half float in the conversion process, it would not make sense to use RGB9E5 in the first place. The same issue exists with PMREM as well.

As pointed out in #27971, WEBGL_render_shared_exponent is required to make RGB9E5 color renderable but browser/device support for that isn't great right now.

@github-actions
Copy link

github-actions bot commented Mar 27, 2024

📦 Bundle size

Full ESM build, minified and gzipped.

Filesize dev Filesize PR Diff
671.2 kB (166.4 kB) 671.7 kB (166.7 kB) +507 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Filesize dev Filesize PR Diff
451.1 kB (109 kB) 451.1 kB (109 kB) +0 B

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants