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

DDS: various improvements #3573

Merged
merged 1 commit into from
Oct 2, 2022
Merged

DDS: various improvements #3573

merged 1 commit into from
Oct 2, 2022

Commits on Oct 2, 2022

  1. DDS: various improvements

    - If a DDS pixel format header contains "this is a normal map" flag
      set, then handle that properly (#3525):
      - For a DXT5, this means it's a "DXT5nm" format. Normal X & Y
        components are in green and alpha channel respectively. Compute Z
        component from those, and the result is a 3-channel tangent space
        normal map.
      - For ATI2/BC5 format that also has a "normal map" flag set, compute
        the Z component automatically too, and result is a 3-channel image.
        However a bunch of ATI2/BC5 normal maps out there in the wild do
        not have that bit set, so also have a global "dds:bc5normal"
        attribute to optionally turn this on.
    - Fix support of R10G10B10A2 format - was producing garbage data due to
      code assumption that truncation down to 8 bits never needs to happen.
    - Fix bit expansion ("too dark") of very low-bit formats, e.g. R3G3B2.
      Code was simply shifting the bits, instead of properly repeating
      the high bits into new low bit positions (i.e. a 3-bit "111" needs
      to become an 8-bit "11111111" and not a "11100000").
    - Support "RXGB" (DXT5, with red & alpha swapped) as well as "BC4U"
      and "BC5U" formats (the latter two are just BC4 and BC5, produced by
      some older tools).
    - Support alpha-only (e.g. A8) formats.
    
    All this mostly prompted by doing DDS improvements in Blender, and
    wanting to get Cycles renderer (which uses OIIO) to the same feature
    parity. See https://developer.blender.org/T101405 and
    https://developer.blender.org/D16087.
    aras-p committed Oct 2, 2022
    Configuration menu
    Copy the full SHA
    deb1414 View commit details
    Browse the repository at this point in the history