StrataSource / vtex2

A VTF converter and editor
MIT License
44 stars 8 forks source link

[Feature] Handling compressed BGRA8888 HDR textures #24

Open SirYodaJedi opened 1 year ago

SirYodaJedi commented 1 year ago

Vanilla Source 1, being as it predates the BC6H format for compressed HDR textures, uses a custom format for compressing HDR skyboxes in games like HL2 and TF2, wherein the Alpha channel is used as a multiplicand for converting to BGRA16161616F (the algorithm for this is on VDC's page for the VTF file format). While the OG Vtex can create such textures, there is currently no tool I am aware of that can decompress the textures back to a normal format most tools just treat them regular 32-bit VTFs.

I propose Vtex2 be able to convert to and from the esoteric format, as the tool aims to be a complete replacement for Valve's Vtex.

JJL772 commented 1 year ago

As of right now, Chaos doesn't support BC6H, but I think that'd be good to implement eventually.

Thanks for the feature request, these are all good ideas!

SirYodaJedi commented 1 year ago

Update: Apparently no_vtf can decompress compressed HDR and output to EXR or TIFF. Its code can't be ported here because it's an incompatible license (and uses a completely different language anyway), but I figured I'd mention it here since the way it autodetects that a 32-bit VTF is HDR based upon its file name is a neat idea that I've found useful.