Xanashi / Icaros

Official issue tracker and download location for Icaros Shell Extensions
720 stars 8 forks source link

[Feature Request] Support for DDS BC7 #71

Open EV3RGR33N opened 1 year ago

EV3RGR33N commented 1 year ago

Hello there, First of all thank you for this program!

I'd like to ask if it's possible to support BC7 compression for DDS files. I'm dealing with large dumps of game textures (Modding Resident Evil games), Icaros deals with DXT1 and DXT5 just fine but not BC7, one of the newer and increasingly popular compression methods.

I've found two ways to generate thumbnails for DDS BC7, both have a GitHub repo that may or may not be of help to you:

  1. Set Paint.net as the main "Open With..." program for DDS files. Has a plugin for handling DDS bundled by default. It does work, but I can't use it as it's unwieldy for previewing purposes. DDSFileType Plus Plugin

  2. Use XMH Tools, which has a ShellExtension that generates thumbnails. A solution that almost fits my needs, if it wasn't for the fact that it is very slow (no offense to the author!). I would much prefer a one-stop-shop solution like Icaros. :) XMHTools

Here's a DDS file that is BC7 should you need it. Note: it is a normal map but its alpha channel is not transparency, rather, it's a "Roughness" map. I don't know what would be the best way to deal with that - a setting to control whether or not Alpha is used a Transparency perhaps? b1_wall01_test_nrmr.zip

Have a nice day!

Xanashi commented 1 year ago

Hi EV3RGR33N,

Icaros supports the DDS file format through FFmpeg. So to support BC7 in DDS, it would have to be implemented in the FFmpeg DDS decoder.

I took a little look at what it would require, and the biggest impediment seems to be adding the BPTC texture decompression functions in texturedsp.c. Here is an example of a BC7 decompressor.

I'm personally not knowledgeable enough to implement something like that (at least right now :D) in FFmpeg, but perhaps someone else would enjoy the challenge. You could try and create a ticket in the FFmpeg issue tracker.

In the meantime I will definitely keep this issue in mind, and see if I can implement a solution when I have some more time on my hands.

EV3RGR33N commented 1 year ago

Hey there,

I understand, thanks for having taken a look at it anyways! I'll try my luck and submit a ticket on FFmpeg's issue tracker and will let you know if it they add BC7 decompression. Should I cose this feature request or leave it open?

Thanks again for the program and for your time, have a nice day!

Xanashi commented 1 year ago

You can leave it open. I like it as a reminder, both to check the FFmpeg development, and in case I find another solution later down the line.

Thank you for using Icaros, and I hope you have a wonderful day as well.