Skip to content
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

EXRLoader: impl single tiled-image support #28033

Merged
merged 2 commits into from
Apr 2, 2024
Merged

Conversation

sciecode
Copy link
Contributor

@sciecode sciecode commented Mar 30, 2024

Related issue: #27933

After evaluating some sample files in an attempt to add support to envmap, I noticed that all files containing that information appear to be in a tiledimage data layout, as such the only way to properly add support for it, is to also add support for tiledimages.

I decided to bite the bullet and commit to adding full support for it. This PR implements basic support for tiled data layout, but it does not (yet) fully support envmap. The loader will no longer report either envmap or tiledimage as unsupported, but textures are loaded following OpenEXR's envmap orientation and format, which differs from ours - this will be addressed at a later time.

There is currently only one restriction in regards to tiled-images:

  • RIPMAP_LEVELS tile-layout, non-uniform scaled axis mip-maps, are not yet supported.

I don't expect anyone will run into this, as it is incredibly rare for this to be used in any form of graphics application - but I do throw an exception informing of this limitation in the eventually that anyone runs into it.


Although I have extensively tested this new functionality as well as backwards compatibility with previously supported formats - There are simply too many format variations to fully validate compatibility.

As such, I have limited the scope of my tests to existing files in both our project & in the OpenEXR's test images suite. This by no means covers every possible variation, but it is as far as I'm able to test for the time being.

Potentially faulty features will be addressed if/when they appear.


Live Example

@Mugen87 Mugen87 added this to the r164 milestone Mar 31, 2024
@sciecode
Copy link
Contributor Author

No idea why test failed, probably just a fluke.

@Mugen87
Copy link
Collaborator

Mugen87 commented Mar 31, 2024

I've manually restarted the failed run and now it works. This kind of failure happens sometimes and can be ignored^^.

@Mugen87
Copy link
Collaborator

Mugen87 commented Apr 1, 2024

Side note: For a later PR I would suggest to add at least a single tiled test image to webgl_loader_texture_exr or webgl_materials_envmaps_exr than can be selected via a lil-gui dropdown input. Similar to the GUI in https://threejs.org/examples/webgl_loader_3mf. In this way, we can quickly check for regressions if someone in the community creates a PR in context of EXRLoader.

@sciecode
Copy link
Contributor Author

sciecode commented Apr 1, 2024

Sounds good to me. I think webgl_loader_texture_exr is likely the better candidate, envmap can get a bit weird to validate correctness.

I'll check the licenses on OpenEXR's test images, I believe we might be able to use one of their images.

@mrdoob mrdoob merged commit 1ff0d56 into mrdoob:dev Apr 2, 2024
11 checks passed
@sciecode sciecode deleted the dev-exr-tiles branch April 2, 2024 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants