Comments (1)
The default decompress format for BC4 maps to DXGI_FORMAT_R8_UNORM
which is a single red channel (BC4 encodes just one channel). When DXGI_FORMAT_R8_UNORM
is passed to the WIC writer, the default format for WIC maps to GUID_WICPixelFormat8bppGray
. For the .BMP codec, this is written as a BI_RLE8
which is a palette mode, and the BMP palette is the identity (0-255 maps to greyscale colors 0-255).
The default decompress format for BC5 maps to DXGI_FORMAT_R8G8_UNORM
which is a two channel format (BC5 encodes two channels). When DXGI_FORMAT_R8G8_UNORM
is passed to the WIC writer, there is no WIC format that exactly matches so that writer fails. Therefore, you have to provide the target format you want to use.
With that out the way, when you provide -f rgba
the target format for the conversion becomes DXGI_FORMAT_R8G8B8A8_UNORM
. The tool first decompresses BC4 to R8, then converts from R8 to R8G8B8A8. The default behavior for such conversions is to do a 'greyscale expansion' as you see to set the RED channel to R, GREEN channel to R, and BLUE channel to R, and the ALPHA channel to 1.
If on the other hand you provide a BC5, then it decompresses to R8G8, then converts R8G8 to R8G8B8A8. The default behavior for such conversions is to copy R to red, G to green, and set B to zero, and A to 1.
From my understanding of your question, you want BC4 to write out to R8G8B8A8 where R is red, G is 0, B is zero, and A is 1. You can do this with the -swizzle
option. In your case -swizzle r001
which will copy the red channel and then set the other channels to fixed values.
from directxtex.
Related Issues (20)
- Build /mt failed HOT 1
- Legacy DDS files with a DDS_HEADER size of 24
- Texconv.exe can not handle whitespaces in output path HOT 5
- -flist keep structure HOT 1
- Integrate Xbox functionality in the Auxiliary folder
- FAILED (80004005: Unspecified error ) HOT 2
- Move PPM/PFM I/O functions to the library HOT 1
- WIC loading is different from D3DX loading of WIC textures HOT 9
- GPU-compressed `BC7_UNORM_SRGB` textures contain red streaks when using texconv.exe under wine HOT 1
- Does DirectXTex directly depend on ZLIB? HOT 3
- Can't compile ddsdump HOT 2
- gcc Warnings in Linux -Wstringop-overflow HOT 4
- Does DirectX support direct reading of compressed textures? HOT 1
- Use fixed width integers for underlying enum types HOT 1
- I need pre-compiled shaders HOT 3
- Allow user to convert single lat-long hdri into cubemap HOT 1
- Low quality DXT compression HOT 3
- Add function to convert a texture to Standard Swizzle and vice versa HOT 1
- UINT and SINT formats in texconv HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from directxtex.