UnityPack
UnityPack copied to clipboard
Processing RGBA4444
I met a problem when i'm unpacking textures formatted with RGBA4444
. The unpacked images have a color problem obviously.
When I swapping the color channels from RGBA
to ABGR
, the problem solved.
I don't know the definition of RGBA4444
. I don't know the swapping channel just appears in the game I unpacked or Unity defines it in this way. So I prefer to open an issue rather than open a pr.
I fix the problem in my fork moesoha/UnityPack:fix-rgba4444.
Thanks for the heads up.
@andburn or @Mischanix might correct me on this but I think there's a couple of RGBA4444 textures in Hearthstone which work the way it's implemented right now. Would have to compare to see...
Which game did you try? Can you link the raw texture binary somehow?
The game is a hot RPG game in China. It's Chinese name is “恋与制作人”, and it has no English name.
The Android package name is com.papegames.evol
.
And here is the Unity Asset file i used above. 10050.zip
@moesoha What's the texture name/address in question?
@jleclanche Just 10050
, assets/i6/icon_s/10050.png
in apk file.
It's about big endian and little endian. Apparently here it uses little endian so the RGBA
became ABGR
.
@UlyssesWu Oops, seems right. But how to judge which endian it is? This should be a property in the bundle.
I don't really know about Unity's implementation.
In my case (Kirikiri PSB / FreeMote), you can only identify big/little endian by platform - in a Windows game, RGBA8
uses little endian; while in a WebGL game, the same description RGBA8
uses big endian instead.
@UlyssesWu That's really annoying... Do you have any big endian bundle files?
I think there's a couple of RGBA4444 textures in Hearthstone which work the way it's implemented right now. Would have to compare to see...
Same problem appears when unpacking Hearthstone. So there must be something about the environment.
w/o swapping channels
w/ swapping channels
Unity3d files have multiple places where they declare endianness. At the file/bundle level, and at the asset level. It's a bit of a mess and not always consistent. But afaik unitypack handles all that.
@jleclanche I read the codes and did some test. I believe UnityPack parsed endianess properly of assets, but the image unpacked still have a wrong channel order. You said UnityPack works with Hearthstone's RGBA4444 texture, but i failed in the last comment.