nesrak1 / UABEA

c# uabe for newer versions of unity
MIT License
1.21k stars 152 forks source link

Support for DDS? PNG and TGA are great but don't support mipmaps. #162

Open fuwafoowa opened 2 years ago

fuwafoowa commented 2 years ago

Trying to mod the new yugioh game.

nesrak1 commented 2 years ago

For importing or for exporting? UABE normally generated mipmaps for png and tga files so they didn't have to be included with file when importing. UABEA doesn't support mipmaps at all (even when reimporting) although that will be added soon (hopefully). If you need them for exporting, then that's probably a valid reason for dds, although ImageSharp doesn't support dds right now.

fuwafoowa commented 2 years ago

For the edit texture plugin. Loading textures on the Texture2D type.

nesrak1 commented 2 years ago

Are you okay with uabea generating mipmaps for pngs? That would make things much easier.

fuwafoowa commented 2 years ago

I am I think... I'm not too savvy about any of this. I just know I need mipmaps haha.

Bxaa commented 2 years ago

UABEA doesn't support mipmaps UABE normally generated mipmaps

As far as I remember (I do not have the UABE source code now) All PNG's converted to DDS with DXT compression + mipmaps generating and all it depend on asset's setting for each textures while importing (used PVRTexTool Library) Also DXT1-5 depend on alpha type (may ignore asset's settings) Mip Export or import DXT compressed DDS it makes no sense, because with each DXT recompressing operation the quality will be lost

PNG - the best solution Never use TGA (often editors uses non standard RLE encoding and exiF table) There may be unpredictable consequences when importing targa images

UPD: PVRTexTool Library should build mips by default for PNG->DDS (while importing to assets)

Bxaa commented 2 years ago

UDP (offtop) Possible issue: Need excepting exporting some DDS textures (3d\cube, but stored as 2D) Exporting and reimport will broke this textures.

When I have time, I'll take a look and report what needs (may not need anything)

Bxaa commented 2 years ago

textoolwrap.cpp

crn_mipmap_params mip_params;
mip_params.m_gamma_filtering = true;
mip_params.m_mode = cCRNMipModeNoMips; //cCRNMipModeGenerateMips

Need check for m_mipCount in Asset Data for current texture m_mipCount = 1 then mip_params.m_mode = cCRNMipModeNoMips (no mips) m_mipCount > 1 then mip_params.m_mode = cCRNMipModeGenerateMips (rebuild mips)

Thats all

Ansraer commented 1 year ago

@nesrak1 Hey, sorry for the ping, but is this still a planned feature? Kind of need it for a project, and this issue looks rather stale.

nesrak1 commented 1 year ago

It's definitely a planned feature and I've even started work on it (but not pushed it). I had a few issues with certain texture formats and I haven't touched the code in a few months to fix it. On top of that, I added switch texture support which might complicate things a bit. I'll make the priority on this feature higher (hopefully to make it into next release.)

School has started up again though, so I'll be a little short on time...

Ansraer commented 1 year ago

Thank you, I really appreciate it. It's a really essential feature if you want to mod 3d games :D.