Jump to content

Some DDS files fail to load (examples included)


Recommended Posts

The following error is consistently displayed by Paint.NET 3.5.8 when loading some DXT-compressed files (ones with the DDS extension), even though tools such as Nvidia's ReadDXT and ATI's The Compressonator can read them just fine:

"There was an unspecified error while opening the file."

I've attached a couple of example files that produce the error (with three different S3TC formats: DXT1, DXT3 and DXT5).

It seems that other users previous also reported similar issues, as mentioned in:

* Problem with *some* .DDS files

http://forums.getpai...some-dds-files/

* DDS File Support for Paint.NET now available [link was okay earlier today, but is now gone]

http://forums.getpai...-now-available/

Hopefully the examples would help to find a cause, since a lot of my DDS files have this problem.

Thanks in advance for any help, and also for the great software that Paint.NET is!

example-dds-files.zip

Link to comment
Share on other sites

Hmm, that's no good. Do you know what format those DDS images are saved in? I only recently found out (because I don't watch The Daily DirectX News* apparently!) that there are new formats in Direct3D 11 which Paint.NET certainly doesn't support. Those formats are "BC6" and "BC7".

* I made that TV show up

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

Hmm, that's no good. Do you know what format those DDS images are saved in? I only recently found out (because I don't watch The Daily DirectX News* apparently!) that there are new formats in Direct3D 11 which Paint.NET certainly doesn't support. Those formats are "BC6" and "BC7".

* I made that TV show up

The header on those files is written incorrectly, everything in the DDS_PIXELFORMAT except the dwFourCC member and anything after it is set to zero.

PdnSig.png

Plugin Pack | PSFilterPdn | Content Aware Fill | G'MICPaint Shop Pro Filetype | RAW Filetype | WebP Filetype

The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait

 

Link to comment
Share on other sites

Hmm, that's no good. Do you know what format those DDS images are saved in? I only recently found out (because I don't watch The Daily DirectX News* apparently!) that there are new formats in Direct3D 11 which Paint.NET certainly doesn't support. Those formats are "BC6" and "BC7".

* I made that TV show up

These examples were generated by Unreal Engine 2.5 (Unreal Tournament 2004), so they're unlikely to use the new Direct3D 11 formats.

The header on those files is written incorrectly, everything in the DDS_PIXELFORMAT except the dwFourCC member and anything after it is set to zero.

If the headers are written incorrectly, I suppose it is a bug of Unreal Technology that has been around for a while. The Nvidia and ATI tools probably have better fault-tolerant logic than Paint.NET, since they can handle the files; I wonder how they do it? Would it be possible to make an educated guess about the missing DDS_PIXELFORMAT data, perhaps using other DDS_HEADER info (if any) and total file size, or something like that?

Link to comment
Share on other sites

These examples were generated by Unreal Engine 2.5 (Unreal Tournament 2004), so they're unlikely to use the new Direct3D 11 formats.

If the headers are written incorrectly, I suppose it is a bug of Unreal Technology that has been around for a while. The Nvidia and ATI tools probably have better fault-tolerant logic than Paint.NET, since they can handle the files; I wonder how they do it? Would it be possible to make an educated guess about the missing DDS_PIXELFORMAT data, perhaps using other DDS_HEADER info (if any) and total file size, or something like that?

Those other tools probably just check the dwFourCC field for a valid compressed texture without checking the dwFlags field for the DDPF_FOURCC flag.

The textures load fine in Paint.NET if the DDPF_FOURCC flag is set with a hex editor. :)

PdnSig.png

Plugin Pack | PSFilterPdn | Content Aware Fill | G'MICPaint Shop Pro Filetype | RAW Filetype | WebP Filetype

The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait

 

Link to comment
Share on other sites

Those other tools probably just check the dwFourCC field for a valid compressed texture without checking the dwFlags field for the DDPF_FOURCC flag.

The textures load fine in Paint.NET if the DDPF_FOURCC flag is set with a hex editor. :)

Yes, indeed, the main problem seems to be with the dwFlags value of the DDS_PIXELFORMAT structure. I also noticed the remarks in the MSDN documentation about both dwFlags and dwCaps from the DDS_HEADER structure, saying "when you read a .dds file, you should not rely on the [...] flags being set because some writers of such a file might not set these flags". I suppose, for a similar reason, one could follow a more lenient approach with readers for the dwFlags in the DDS_PIXELFORMAT structure, and, when loading DDS files, also accept files that have dwFourCC set to an expected value (such as, DXT1, DXT3, DXT5 or DX10).

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...

Speaking of 3.5.9: http://forums.getpaint.net/index.php?/topic/22706-paintnet-v359-beta-build-4278/

The 3 sample files above now load in Paint.NET. Please try it out on any others you have had trouble with.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

  • 3 weeks later...

Alright, we'll see if 3.5.9 will fix this for you. It's 1 line of code.

Speaking of 3.5.9: http://forums.getpai...eta-build-4278/

The 3 sample files above now load in Paint.NET. Please try it out on any others you have had trouble with.

Thank you, Rick! I tested Paint.NET version 3.5.9 with several hundreds of DDS files -- it works much better. Only two failed to load (same error message), but these files are included with two other commercial products (such that I won't attach the files on the forum). I'd guess the two problematic files have other weirdness with their headers. (Compressonator can read both, but ReadDXT also fails on one.)

However, all the Unreal DDS files load fine in the new Paint.NET version. Thanks again!

Edited by Oxyzarium
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...