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

Added support for uncompressed DDS #2201

Merged
merged 1 commit into from
Sep 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions backend/src/nodes/impl/dds/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,11 @@
"DXT5",
}

PREFER_DX9: Set[DDSFormat] = {
"R8G8B8A8_UNORM",
"B8G8R8A8_UNORM",
}


def to_dxgi(f: DDSFormat) -> DxgiFormat:
if f in LEGACY_TO_DXGI:
Expand Down
4 changes: 4 additions & 0 deletions backend/src/nodes/properties/inputs/generic_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,10 @@ def TileSizeDropdown(
("DXT1", "DXT1 (4bpp, Linear, 1-bit Alpha, Legacy)"),
("DXT3", "DXT3 (8bpp, Linear, 4-bit Alpha, Legacy)"),
("DXT5", "DXT5 (8bpp, Linear, 8-bit Alpha, Legacy)"),
("R8G8B8A8_UNORM_SRGB", "RGBA (32bpp, sRGB, 8-bit Alpha)"),
("R8G8B8A8_UNORM", "RGBA (32bpp, Linear, 8-bit Alpha)"),
("B8G8R8A8_UNORM_SRGB", "BGRA (32bpp, sRGB, 8-bit Alpha)"),
("B8G8R8A8_UNORM", "BGRA (32bpp, Linear, 8-bit Alpha)"),
]


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
BC7_FORMATS,
BC123_FORMATS,
LEGACY_TO_DXGI,
PREFER_DX9,
WITH_ALPHA,
DDSFormat,
to_dxgi,
Expand Down Expand Up @@ -234,7 +235,7 @@ def save_image_node(
img = to_uint8(img, normalized=True)

# remap legacy DX9 formats
legacy_dds = dds_format in LEGACY_TO_DXGI
legacy_dds = dds_format in LEGACY_TO_DXGI or dds_format in PREFER_DX9

save_as_dds(
full_path,
Expand Down