bluescan / tacentview

An image and texture viewer for tga, png, apng, exr, dds, pvr, ktx, ktx2, astc, pkm, qoi, gif, hdr, jpg, tif, ico, webp, and bmp files. Uses Dear ImGui, OpenGL, and Tacent. Useful for game devs as it displays information like the presence of an alpha channel and querying specific pixels for their colour.
ISC License
339 stars 33 forks source link

Mali Texture Compression Tool -- ETC2 -- PKM format support ? #91

Closed denghe closed 1 year ago

denghe commented 1 year ago

please, thanks ! more information here: https://github.com/axmolengine/axmol/blob/dev/core/base/etc2.cpp

bluescan commented 1 year ago

Hi Denghe. I took a look. I'm not sure yet TBH. That code above may be a little copyright-encumbered (there are 6 copyright lines without conditions, and then a 7th that states 'All Rights Reserved' which would be in direct contradiction to a 'BSD-Style' license). I did manage to find:

https://arm-software.github.io/opengl-es-sdk-for-android/etc_texture.html

and

https://arm-software.github.io/opengl-es-sdk-for-android/advanced__samples_2common__native_2inc_2_e_t_c_header_8h_source.html

under MIT, but the specification is a bit vague. The header is referred to as 16 bits, which I assume means 16 bytes, but the MailSDK::ETCHeader only seems to have 8 bytes -- and things like the internalFormat is not there in any obvious form (maybe it's stored with the texture data?)

I'll leave the issue open for now -- in case it becomes clearer at some point ;)

bluescan commented 1 year ago

Found some reference code under Apache 2.0 that looks promising: https://android.googlesource.com/platform/frameworks/native/+/master/opengl/include/ETC1/etc1.h

https://android.googlesource.com/platform/frameworks/native/+/master/opengl/libs/ETC1/etc1.cpp

bluescan commented 1 year ago

As of 66e6a92a0af072f8e9cbfb92b03fa63b5c2d025c Tacent View can now load PKM files with all supported ETC encodings: EACR11, EACR11-Signed, EACRG11, EACRG11-Signed, ETC1, ETC2RGB, ETC2sRGB, ETC2RGBA, ETC2sRGBA, ETC2RGBA1, and ETC2sRGBA1.