-
Notifications
You must be signed in to change notification settings - Fork 400
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
Bundle OpenEXR and enable import & conversion plugins #1447
Conversation
We need to bump our minimum CMake for this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either bump minimum CMake in this PR or get it working with the older version.
I'm fine bumping cmake. Since we support cmake installed via |
One last spot: habitat-sim/src/CMakeLists.txt Line 5 in 6dc9ad8
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great.
Thanks a lot for your STRONG support, @mosra.
@Skylion007 do you think that change is needed? Because the submodule will enforce it anyway, and if the submodule isn't there (because OpenEXR becomes optional, or because it's disabled for Emscripten, or because the user relies on a system installation), then there's no point in enforcing 3.12. @bigbike I'll leave the decision on whether make OpenEXR required or optional on you, as well as a merge of this PR. I'd suggest to base your HDR code off this branch and when you're done and it's clear whether we want to implicitly rely on OpenEXR or not, merge both PRs. |
@mosra Good point, forgot the submodule should enforce it. Feel free to revert it. |
@mosra :
This suggestion is very thoughtful. Thank you. |
That direction is not hard. The overhead of having it optional is what's big. In other words, if I make this optional now, it'll require you to add some If you think the build time / binary size / conda build size overhead is not too big to be significant, the easiest option is to merge this as-is. I tried to look at the CIs to do at least a rough comparison, but it says this branch built in 6 minutes and master in 44, so I have no idea :) |
So I just tested it, and it looks like it increases compilation time by 20-30 seconds at most. We don't really care at all about binary size at all at the moment so I would just leave it enabled by default. |
Haha, everything is relative. 20-30 seconds is the time needed to compile the whole Magnum :) Sure, if that's fine, feel free to press the merge button. |
Motivation and Context
This PR enables OpenEXR that's needed for @bigbike's PBR IBL and HDR / depth image export. It adds support for importing and converting OpenEXR files with half-float (for color), float (for depth) and integer (for object ID) channels, including cubemaps and multiple mip levels per file.
Apart from that, the
magnum-imageconverter
tool got extended to make working with cubemap and multi-level EXR files easier. Running--info
will give an overview of what's there:The following will combine 6 2D cube map faces into a single 3D EXR file:
This will make a file that contains several mipmap levels:
And, as the inverse of above, this will extract a single level of a particular face back into a 2D image:
Please check out the full documentation for more information:
OpenExrImporter
OpenExrImageConverter
, note the compression options thereAbstractImageConverter
APIs for saving a file with multiple mip levelsmagnum-imageconverter
Open questions / TODOs:
magnum-imageconverter
. I attempted to implement this as a convenience feature in the tool but abandoned the idea halfway through, as I don't feel it's important enough compared to my other tasks. Use imagemagick for now instead:convert image.jpg image.exr
I have no idea if the OpenEXR library builds on Emscriptenit does, but do we actually want it enabled there (download sizes, etc.)?How Has This Been Tested
Magnum changes tested locally and on my CIs. Habitat build fails due to the above-mentioned CMake requirement.
Types of changes