-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
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
EXRExporter: introduces EXR exporter, initial draft. #19764
Conversation
The current state of this PR does not include an I would like to include one in the final PR, something like exporting PMREMGenerator output or rendered scene HDR snapshot. I'm open to suggestions regarding which workflows to highlight 😄 |
No need to do the |
Oh, I keep forgetting that. Will remove |
@lokiiarora this is pretty much good to go. I've been running some tests and haven't found any problems related with utilizing the exporter, I'll include a proper example between today/tomorrow, but no changes will be made to the exporter. So if you want to incorporate the current state of the exporter in your current workflow, feel free to do so. The PMREM inconsistency has already been handled on #19765 and it should be working properly with all methods. |
@sciecode Should we merge this? The PR is still marked as draft. |
} | ||
|
||
// http://gamedev.stackexchange.com/questions/17326/conversion-of-a-number-from-single-precision-floating-point-representation-to-a/17410#17410 | ||
function encodeFloat16( val ) { |
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.
Please use DataUtils.toHalfFloat() here.
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.
Will do.
There are still some adjustments I would like to make, and I should probably update the Deflate usage as discussed on #20941 (comment). I'll do my best to work on it next weekend, sorry for the long delay. |
/ping @DavidPeicho You can use this to export PMREMs in .exr format. |
@sciecode This would be a really nice feature since envMaps are so hard to edit. Not only could you create them from scenes, but you could also do simple things like downsample them based on the minimum roughness in your scene. A nice follow-on would be HDR export. Are you still working on this? |
Yes, I've been getting a few requests to resume development on this exporter. Sorry it took this long, wasn't my intention. I'll focus on rebasing the commit and making sure the exporter is properly working on both Linear and perceptual sRGB input render targets, just so we can get an initial version of the exporter live. I should have PR ready by the weekend. |
Initial draft of OpenEXR file format exporter.
Relies internally on WebGL
gl.readPixels
for retrieving render target pixel data information. So it is subject to all of its limitations as well, but it does offer a good support for regular use-cases by default.OpenEXR expects the pixel data in linear representation, so we are required to apply EOTF ( Electro-Optical Transfer Function ) before exporting the pixel data. It is also in the best interest to decode encoded data ( e.g RGBEEncoding ), currently the supported texture encodings are mentioned below, If requested, I will expand the encoding support.
EXRExporter Documentation
EXRExporter Example
Observation: In working on this pull request I noticed a small inconsistency with
PMREMGenerator
, when generating a PMREM from a LDR input texture, the result RGB channels will be correct, however the alpha channel will be set to 0 for all pixels. This bears no effect when the output PMREM is used as an envmap, but once you export this to an .exr file, depending on the viewer you might just see an entirely black/transparent image. I'll be addressing this issue in a separated PR. It is a very simple fix.