Norbyte / lslib

Tools for manipulating Divinity Original Sin and Baldur's Gate 3 files
MIT License
760 stars 141 forks source link

[BG3] Support for re-packing GTS virtual texture sets #172

Open hallatore opened 1 year ago

hallatore commented 1 year ago

I noticed this commit https://github.com/Norbyte/lslib/commit/262890bcaa4db5987d3afb21e77b5dd26f8d5d6c by @Norbyte.

This is more of a question/request than an issue. I'm wondering how much work needs to be done to support re-packing virtual textures sets.

I'm testing out 2x upscaling dds files. But a lot of the texture are virtual, which I can only unpack. But as far as I know there isn't much we can use these unpacked textures for without packing them back to virtual textures sets first?

ghost commented 1 year ago

Oh hey I am also working on this, I have a solution that is jank af, which is reassigning all the materials to read the extracted textures, and redirecting the materials to use non-vtex shaders. But it would be much better to be able to repack to VTEX.

https://github.com/emarron/bg3_xml_editor Basically some trash chatGPT scriplets to rename the spaghetti names to intelligible names and then reassigns the material files to read my extracted textures instead. Main issue is that some of the shaders that use VTEX don't have a version for non-packed textures (Cloth Shaders) so I just used the closest one I could find. Without rewriting a few dozen shaders this is as far as I've been able to get.

The labeled names are under modder resource here if you don't want to run my sh*t code yourself.

https://github.com/emarron/bg3_xml_editor

this is an example of vtex to tex, which forces all female armour textures to read from the labeled names under directory (Baldurs Gate 3\Data\Generated\Public\Shared\Assets\kartoffels_clubhouse\Textures*)

vtex_to_tex.zip