Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Processing RGBA4444 #68

Open
moesoha opened this issue Feb 2, 2018 · 12 comments
Open

Processing RGBA4444 #68

moesoha opened this issue Feb 2, 2018 · 12 comments

Comments

@moesoha
Copy link

moesoha commented Feb 2, 2018

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.

snipaste_2018-02-02_13-56-41

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.

@jleclanche
Copy link
Member

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?

@moesoha
Copy link
Author

moesoha commented Feb 2, 2018

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

@jleclanche
Copy link
Member

@moesoha What's the texture name/address in question?

@moesoha
Copy link
Author

moesoha commented Feb 2, 2018

@jleclanche Just 10050, assets/i6/icon_s/10050.png in apk file.

@UlyssesWu
Copy link

It's about big endian and little endian. Apparently here it uses little endian so the RGBA became ABGR.

@moesoha
Copy link
Author

moesoha commented Feb 2, 2018

@UlyssesWu Oops, seems right.
But how to judge which endian it is? This should be a property in the bundle.

@UlyssesWu
Copy link

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.

@moesoha
Copy link
Author

moesoha commented Feb 2, 2018

@UlyssesWu That's really annoying... Do you have any big endian bundle files?

@UlyssesWu
Copy link

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...

@moesoha
Copy link
Author

moesoha commented Feb 2, 2018

Same problem appears when unpacking Hearthstone. So there must be something about the environment.

snipaste_2018-02-02_17-11-43

w/o swapping channels

snipaste_2018-02-02_17-12-43

w/ swapping channels

@jleclanche
Copy link
Member

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.

@moesoha
Copy link
Author

moesoha commented Feb 3, 2018

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants