Comments (10)
I'm uploading U8V8 & U16V16 samples for reference. Both are set to +1.0; +1.0 which should show yellow (if B <= 0) or white (if B = 1)
http://www.mediafire.com/download/18b4dx8cgdfhhvq/texconv_UV8V8_U16V16.7z
from directxtex.
Sure, here is a better real world test:
https://www.mediafire.com/?cgu0auubfcdtvge
It's a normal map in U8V8 format, and for comparison its reference in RGB.
It was somewhat popular back then in DX9 days for normal mapping when BC5 was not around and DXT5 hack provided too many artifacts or was too cumbersome; and certain GPU HW could save you the unsigned to signed conversion in the shader.
from directxtex.
I can see the following mappings working, but I only have test content for one case. If you can dig up more, that would be a great help:
D3DFMT_V8U8
->DXGI_FORMAT_R8G8_SNORM
(have your test for this)D3DFMT_Q8W8V8U8
->DXGI_FORMAT_R8G8B8A8_SNORM
D3DFMT_V16U16
->DXGI_FORMAT_R16G16_SNORM
(I have your test for this, but a real-world one would be better)
Note I handle
D3DFMT_Q16W16V16U16
(which was stored as a FourCC of 110) asDXGI_FORMAT_R16G16B16A16_SNORM
I don't think there's a sensible general conversion for the old DDPF_BUMPLUMINANCE
formats, and there's no DXGI equivalent for a mixed format like D3DFMT_A2W10V10U10
. Xbox One does have DXGI_FORMAT_R10G10B10_SNORM_A2_UNORM
which would work for D3DFMT_A2W10V10U10
but again I don't have a test DDS
for this one lying around either.
from directxtex.
Can you please attach some example DDS
files here? Also, do you have any 'real-world' examples rather than just test ones with a single value?
from directxtex.
Note that the DDPF_BUMPDUDV
(0x00080000
) and DDPF_BUMPLUMINANCE
(0x00040000
) are for old specialized bump-mapped formats which don't really apply to modern Direct3D .
DDPF_BUMPDUDV D3DFMT_V8U8, D3DFMT_Q8W8V8U8, D3DFMT_V16U16, D3DFMT_A2W10V10U10
DDPF_BUMPLUMINANCE D3DFMT_L6V5U5, D3DFMT_X8L8V8U8
I'm curious to your usage case for DDS
files in these legacy formats. Are there tools that still generate these old DDS
formats or are you trying to reuse old content?
from directxtex.
Interesting. They were likely associated with normal mapping since that was the primary use for U8V8 format.
But these formats were still useful for tangent space normal mapping (since they were signed formats) and not just the old fixed function bump mapping. These formats map 1:1 to R8G8_SNORM & R16G16_SNORM
There was even a CxU8V8 format that would automatically calculate B = 1 - sqrt( R_R + G_G ) for you. However it was discouraged by vendors because they said they just used a 32-bit texture instead of doing the calculation on the fly; so it was better to do it manually in the shader with a U8V8.
They're quite convenient even today since they can work interchangeable with BC5 (both are signed, both map to RG channels); though admittedly this feature is most useful in texconv for converting old uncompressed assets into BC5.
from directxtex.
Indeed to all of that. There are no more signed formats as far as I know, except for CxU8V8 which is a little more annoying to support because it needs to map to DXGI_FORMAT_R8G8B8A8_SNORM and then manually fill the blue channel with 1 - sqrt( r_r + g_g )
Also it was barely used to be bothered.
I don't see where DDPF_BUMPLUMINANCE in being used, and those mixed formats don't really have a DXGI equivalent (except the Xbox One case you mention).
If you want/need more DDS test cases let me know, I have more.
from directxtex.
D3DFMT_V8U8
is covered with your test case. A real world case for D3DFMT_V16U16
would be great, as would one for D3DFMT_Q8W8V8U8
.
If you happen to have a real-world test of D3DFMT_CxV8U8
, I can look at that conversion but as you note, it was not used much.
D3DFMT_A2W10V10U10
I think is even more problematic because it suffers the same problem asD3DFMT_A2B10G10R10
andD3DFMT_A2R10G10B10
for which D3DX used the wrong pixel format masks. I think it's safe to ignore this one.
I initially ignored all these as legacy, but they are all easy enough to implement as long as I have a way to validate it. D3DX9 would load these formats, but D3DX10 and D3DX11 would not load DDS files that were DDS_DDPF_BUMPDUDV
or DDS_DDPF_BUMPLUMINANCE
which is where I originally took the list from.
from directxtex.
Fixed with commit a121bc5
from directxtex.
Whoa!!! That was fast!!! Thank you!
from directxtex.
Related Issues (20)
- 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
- (Question) Converting BC4 to BMP with texconv 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 4
- Add function to convert a texture to Standard Swizzle and vice versa HOT 1
- UINT and SINT formats in texconv HOT 6
- D3DFMT_X8L8V8U8 support (BumpDuDv/BumpLuminance) HOT 5
- keep getting acess denied HOT 3
- Compression artifacts for BC7_UNORM when compressing on CPU (GPU is fine) HOT 2
- Expose EncodeDDSHeader from DirectXTexXboxDDS.cpp HOT 4
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.