EXRLoader: support single channel luminance - RedFormat #23007
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addresses #20195 (comment)
I noticed a difference between our implementation and OpenEXR's in trying to decompress a block only if input-data is actually smaller than the expected data-size. This PR standardizes this issue and makes equivalent to OpenEXR implementation.
It also initially includes support for luminance - single channel files
HalfFloatType / FloatType
.Luminance images are treated as
RedFormat
- WebGL2 only context.Updated
textureData
header info to include specification flags, to help identify if problematic files contain lack of supported features like Deep-Image, Multi-Part or Tiled image files.I largely tested these changes, but would appreciate further testing - @Mugen87, @WestLangley
--
Currently we fail to support
.setDataType( THREE.UnsignedByteType )
on Luminance maps.setDataType
is properly followed even in cases where there is an underlying mismatch between input-type and output-types.( e.g like a float32b input file transformed into a half16b texture ). When we set the output-type to
UnsignedByteType
on a RGB/RGBA files we also encode the output-texture asRGBEEncoding
and transform the data appropriately.However transforming a luminance map of 32/16 type to an uint8 type is not yet specified, should I explicitly allow that transformation? If so, should I then change the texture format to
LuminanceFormat
in order to support WebGL1 contexts?