mcraiha / libktxsharp

Managed C# library for handling KTX File Format
The Unlicense
9 stars 3 forks source link

KTX ETC1S #2

Open Chromum opened 6 months ago

Chromum commented 6 months ago

Hi!

When the KTX loader works perfectly fine when loading a KTX file thats not encoded with ETC1S... does this loader just not support that type or is it broken!?

It errors out on

System.InvalidOperationException: 'Endianness info in header is not valid!'

at line 178 in KtxHeader.cs

mcraiha commented 6 months ago

There are two possible valid endianness values. Either 0x04, 0x03, 0x02, 0x01 or 0x01, 0x02, 0x03, 0x04, and I assume the KTX file you have doesn't contain either of those.

Chromum commented 6 months ago

Odd, i converted it with the Kronos toktx cmd tool, if i remove the ETC1S encode it works fine but if i turn it on it errors

mcraiha commented 6 months ago

Are you sure it is KTX 1.0 file? So if you use hex editor to open the file, it starts with 0xAB, 0x4B, 0x54, 0x58, 0x20, 0x31, 0x31, 0xBB, 0x0D, 0x0A, 0x1A, 0x0A ?

Chromum commented 6 months ago

Ah yes just realised it is a KTX 2 file... sorry!

mcraiha commented 6 months ago

No worries, I will add special error message for that one when I have some extra time.

Chromum commented 6 months ago

I think just changing the git read me to say KTX 1.0 files would suffice... thanks for your help anyways i found another repo that worked for me

mcraiha commented 6 months ago

I did some changes for this issue. Readme and description have been updated. Also I updated an error message to give some guidance to people.