Deprecating PNG files for models.
Posted: Sat Jun 14, 2014 3:41 pm
Hi,
So after the post about Pioneer crashing despite not being out of memory I've decided to take a look at some things to do with the DDS loading etc.
Firstly having the "Compress Textures" option enabled within the options screen is a GOOD THING, however it comes with two variable negatives:
However there is a way around the first problem, and of avoiding the worst of the issues for the second:
Generate the DDS files, which are compressed with dxt1 / dxt5, before loading.
This means you can use slow and higher-quality (not perfect but as good as you can get) compressors that are much better than those available on some platforms and drivers. It means that the whole game takes up more space on your Hard disk (~40MB), but LESS space on your GPU than the uncompressed versions.
I have submitted a PR for what I've currently done.
In that PR I have converted all of the PNG files in the models directory to DDS and then deleted the PNGs.
I had to fix a code issue to let patterns be DDS files and everything is compressed as DXT5 (I think) which means there might be room for some of the files being DXT1 and thus smaller.
All of those PNGs are not lost, they should be in pioneer-assets so I've submitted a PR for that too.
The optimisation used probably isn't the best too, I used the version of ImageMagick that I had installed and might go back and try a newer version with a slower and higher quality compressor, or use another tool entirely. This however was a bulk job that I didn't want to do by hand!
So what do people think to doing this?
What are you major objections?
If you have objections what can be done to fix them?
Cheers,
Andy
So after the post about Pioneer crashing despite not being out of memory I've decided to take a look at some things to do with the DDS loading etc.
Firstly having the "Compress Textures" option enabled within the options screen is a GOOD THING, however it comes with two variable negatives:
- It takes longer to load because it must compress the textures as it loads,
- As with all block based S3TC compression schemes it reduces quality and introduces artifacts.
However there is a way around the first problem, and of avoiding the worst of the issues for the second:
Generate the DDS files, which are compressed with dxt1 / dxt5, before loading.
This means you can use slow and higher-quality (not perfect but as good as you can get) compressors that are much better than those available on some platforms and drivers. It means that the whole game takes up more space on your Hard disk (~40MB), but LESS space on your GPU than the uncompressed versions.
I have submitted a PR for what I've currently done.
In that PR I have converted all of the PNG files in the models directory to DDS and then deleted the PNGs.
I had to fix a code issue to let patterns be DDS files and everything is compressed as DXT5 (I think) which means there might be room for some of the files being DXT1 and thus smaller.
All of those PNGs are not lost, they should be in pioneer-assets so I've submitted a PR for that too.
The optimisation used probably isn't the best too, I used the version of ImageMagick that I had installed and might go back and try a newer version with a slower and higher quality compressor, or use another tool entirely. This however was a bulk job that I didn't want to do by hand!
So what do people think to doing this?
What are you major objections?
If you have objections what can be done to fix them?
Cheers,
Andy