craftablescience / VPKEdit

A CLI/GUI tool to create, read, and write several pack file formats.
https://developer.valvesoftware.com/wiki/VPKEdit
MIT License
260 stars 20 forks source link

Alpha channel not detected for some textures #157

Closed vrad-exe closed 4 months ago

vrad-exe commented 5 months ago

Describe the Bug

Some textures appear to not have their alpha channel detected correctly, causing the checkbox to be unavailable when it should be. An example of this is tf2_textures.vpk/materials/overlays/no_entry.vtf from TF2. Extracting it from the VPK shows that it has an alpha channel, but this doesn't show up in VPKEdit.

To Reproduce

  1. Open the texture I referred to above
  2. Try to turn on alpha

Operating System

Tested on Windows 10

craftablescience commented 5 months ago

I believe this is happening now because of the new vtf library basically saying if the format is compressed pretend it has no alpha channel, which is plain wrong for DXT5, DXT1+Alpha, BC7, ATI1N, ATI2N - honestly there's more compressed formats that support it than ones that don't