You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm writing a library to decompress BCn textures, and while getting reference from BC4S by decoding through texconv, I noticed the values are not the same between R8_UNORM and RGBA.
Looking at the code it seems that for R8G8B8A8_UNORM you do add the 0.5/255.0 bias, but not for R8_UNORM.
Is this how it's supposed to be, or is this an issue? I couldn't find anything in the documentation, maybe you could provide more insight?
Greetings
Jan
The text was updated successfully, but these errors were encountered:
Hi, thanks for the quick response. I did some testing and it gets even more confusing...
If I run texconv.exe -ft png -f R8_UNORM .\bc4s.dds, it calls ConvertScanline with inFormat DXGI_FORMAT_R8_SNORM and outFormat DXGI_FORMAT_R8_UNORM which ends up going with XMVectorMultiplyAdd(v, g_XMOneHalf, g_XMOneHalf), which seems completely normal. But then the call to StoreScanline ends up in the switch case DXGI_FORMAT_R8_UNORM, which does not have the extra bit bias.
If I run texconv.exe -ft png -f RGBA .\bc4s.dds it does the same until the StoreScanline where it ends up in the DXGI_FORMAT_R8G8B8A8_UNORM branch, which does add the g_8BitBias.
If I do this, it does end up calling the Convert function with what seems to be the same DXGI_FORMAT_R8G8B8A8_UNORM. Except this time the result actually seems to be the steps I follow. Unpack SNORM, do the bc4 signed lerps, and pack snorm to unorm.
I've attached the dds file, and the three results as well.
Hello,
I'm writing a library to decompress BCn textures, and while getting reference from BC4S by decoding through texconv, I noticed the values are not the same between
R8_UNORM
andRGBA
.Looking at the code it seems that for R8G8B8A8_UNORM you do add the
0.5/255.0
bias, but not for R8_UNORM.Is this how it's supposed to be, or is this an issue? I couldn't find anything in the documentation, maybe you could provide more insight?
Greetings
Jan
The text was updated successfully, but these errors were encountered: