Conversation
@lexaknyazev please let me know your opinion on this as soon as possible. Rich plans to release his code very soon. We need to decide the representation in a .ktx2 file before then. |
|
A version of https://github.com/BinomialLLC/basis_universal/wiki/UASTC-HDR-Texture-Specification-v1.0 needs to be incorporated into the Data Format Specification. That document has two parts: a description of the UASTC HDR subset of ASTC and a description of transcoding to BC6H. I think for simplicity and ease of use whole thing should be incorporated into KDFS but an argument could be made for putting the subset description in KDFS and the transcoding description into the KTX spec. |
The unreleased KDFS version of the original UASTC spec contains both the bitstream and the transcoding steps. I think UASTC HDR should follow the same path. |
|
@richgel999 says we need to save in the file the scale used to scale the maximum value from .exr/.hdr down to what BC6H/ASTC can handle, "roughly ~65k". We'll need to add a new standard metadata item for this. He promised me a reference to a similar field in the .exr standard. Once I have that to refer to I'll draft a description of the item. |
|
The range for BC6H/ASTC HDR is EXR supports three data types: HDR (Radiance) range is |
|
So my proposal would be to add a metadata entry with an 8-byte payload containing two
It's important to multiply first so that decoders could use a single FMA instruction to apply the scale and the offset at once. |
Let me make sure I have this correct. During encoding the "sampled" value will be calculated as |
|
Yes, that's correct. Exact choice of Whether |
How about |
I was going to email this, but this is as good a place as any... I agree that describing both is ideal. I've been making decent progress in merging everything for a 1.3.2 release and should have something reviewable over the weekend, but we had stalled at the point of folding in UASTC before, and I wanted clarification on the thing that had previously made me hesitate: There was a comment that "to get 32-bpp data from a UASTC texture, it's recommended to first transcode to ASTC, then decode that by following the ASTC specification and any applicable extensions", and I don't think I ever had clarification on whether this meant to remove the entire "Decoding process" section (which describes individual pixel colour values). Is that the intent, or should I preserve both, with the note that they're supposed to be identical and that decoding via ASTC is still recommended? |
If you're using BasisU's transcoder, you can transcode UASTC LDR to basist::cTFRGBA32 (or another uncompressed LDR format, like cTFRGB565 etc.). Internally this would skip the ASTC block packing step, and be faster. It will decode the UASTC blocks to a logical format and then immediately decode these block pixels to 32bpp. |
as decided in Khronos/Binomial conference call.
Draft of language to add support for UASTC HDR. KDFS and all KDFS references need updating before this can be considered ready for merge.
Draft says to use
colorModelKHR_DF_MODEL_UASTC_HDR(= 167) together withvkFormatVK_FORMAT_ASTC_4x4_SFLOAT_BLOCK(= 1000066000). Any issues with that?