Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Handling compressed BGRA8888 HDR textures #24

Open
2 tasks
SirYodaJedi opened this issue Dec 12, 2022 · 2 comments
Open
2 tasks

[Feature] Handling compressed BGRA8888 HDR textures #24

SirYodaJedi opened this issue Dec 12, 2022 · 2 comments

Comments

@SirYodaJedi
Copy link

SirYodaJedi commented Dec 12, 2022

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.

  • Be able to convert a BGRA8888 VTF to BGRA16161616F and BC6H, when told by user that the texture uses Source 1 compressed HDR. This will allow proper user-editing of such textures, as well as reduced VRAM footprint in P2CE (as BC6H is a quarter the size of BGRA8888).

  • Be able to convert a BGRA32323232F PFM or EXR to Source 1 compressed HDR format, using optional dithering to mitigate color banding. This will bring feature parity to OG Vtex, as well as be higher quality than OG Vtex's implementation (for use in games other than P2CE and Momentum Mod).

@JJL772
Copy link
Member

JJL772 commented Jan 25, 2023

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
Copy link
Author

SirYodaJedi commented Jul 10, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants