Giter Site home page Giter Site logo

Comments (14)

DerPopo avatar DerPopo commented on August 14, 2024

Which game is it from? In order to test it, I need a sample asset (the raw Texture2D asset is enough) + the .resources file (if existant)

from uabe.

delm959 avatar delm959 commented on August 14, 2024

I can send you the asset file if you like and point you to the problematic Texture? Do you have a email or something I can contact you on?

from uabe.

DerPopo avatar DerPopo commented on August 14, 2024

You can also upload the raw data as an attachment here.
Here's a test file with a ETC_RGB4 compressed texture. I found no issues exporting it. If it does have an issue on your system, double-check if you have the Visual C++ 2013 Redistributable installed.
test.zip

from uabe.

delm959 avatar delm959 commented on August 14, 2024

I had no trouble exporting your test asset either, must be something else wrong with it. Looks like I have it installed as well...
image
Below is the asset file. There are a lot of images in there but the one I'm having issues with has the Name 'face_ab' and Path ID '247599808996...'
Assets.zip

from uabe.

DerPopo avatar DerPopo commented on August 14, 2024

Found the bug. It was because the mipmap count was set to -1 because that engine version has no m_MipCount field. The negative value was then passed like a positive value, resulting in the number 4294967295. Theoretically, it might complete somewhen but instead here's a small fix :

TexToolWrap.zip

from uabe.

delm959 avatar delm959 commented on August 14, 2024

Awesome! Thanks mate, you're a legend :)

from uabe.

delm959 avatar delm959 commented on August 14, 2024

I have just noticed an issue with the extracted ETC_RGB4 images though. The backgrounds should be transparent but they are coming out all strange. Here are some examples...

face_ab_121
face_ab_133

Not sure why those strange lines are showing up, I have no issue with the DXT5 textures.
Try a face_ab texture from this file..

CAB-ee7232b2f4b570f5081d9068e0ec5f51.zip

from uabe.

DerPopo avatar DerPopo commented on August 14, 2024

ETC_RGB4 has no alpha channel. I think it also isn't needed because Unity creates sprite meshes so the "transparent" area won't be displayed.
Possibly the meshes are in another bundle or .assets file.

EDIT : There are some _mask files that seem to contain the alpha channel. Open the file from the bundle to know which one is which.

from uabe.

beytrade avatar beytrade commented on August 14, 2024

@DerPopo Hi, This tool is really great! I have one question. The following attached unity3d file should contain a image with color data, but when extracted it's converted to the alpha8 transparent image, and color data is lost.

  • I tried another texture format, but the result did not change.
  • I doubted that sprite has a color table, but I could not convert sprite data to color table.
  • Is this a bug of UABE related to Texture2D?

http://assets.mirror.hekk.org/v3/ios/units/illust/5001_1705630752.unity3d

env: UABE v2.1c, Win7, VC++2013 installed

from uabe.

DerPopo avatar DerPopo commented on August 14, 2024

It does only contain a 8 bit (1 byte) texture. The image size of 2097152 is exactly 2048*1024, so there is not more data than what UABE extracts.
Looking at the texture, it seems like the game has its own way to map the color data on top of the grayscale texture. The left half is a high resolution grayscale and there are three 1/4 size images, likely representing two different color channels (left half) and the alpha channel. The third color channel can be calculated from the grayscale and the two other channels.
As UABE extracts the image data into the alpha channel, I recommend using a tool such as paint.net and adding a black layer behind the extracted .tga or .png to view the grayscales. Editing may become a bit cumbersome as it needs the same data in the alpha channel of the imported texture (and most editing programs aren't able to do that out of a normal grayscale).

from uabe.

beytrade avatar beytrade commented on August 14, 2024

@DerPopo That make sense! It was not a bug. I'm sorry.
I wrote the convert script based on your advice and succeeded in generating colors. But the output image is a little different in color. Please give me a clue 🙏

import cv2

img = cv2.imread('texture2d.png', cv2.IMREAD_UNCHANGED)
height, width = img.shape[:2]

for w in range(0, width):
    for h in range(0, height):
        if w < 1024 and h < 1024:
            G = img[h, w][3]  # left grayscale
            B = img[h/2, 1024+(w/2)][3]  # right top
            R = img[512+(h/2), 1024+(w/2)][3]  # right bottom
            A = img[512+(h/2), 1024+(1024/2)+(w/2)][3]  # alpha
            img[h, w] = [B, G, R, A]

cv2.imshow('image', img)
cv2.waitKey(0)
cv2.destroyAllWindows()

UPDATE: I found out that it was YCbCr. Sorry for off-topic. 🙇 Thanks!!

from uabe.

DerPopo avatar DerPopo commented on August 14, 2024

I couldn't find out the actual method either, the conversion you have is the best I could find so far.

from uabe.

vlademagic avatar vlademagic commented on August 14, 2024

i have issue with UABE with the exporting the textures i get the message "error Unable to create a Texture2d template field"
i followed a youtube tutorial step by step and tried on 2 different games and i get the same error

from uabe.

nlondrovic avatar nlondrovic commented on August 14, 2024

Found the bug. It was because the mipmap count was set to -1 because that engine version has no m_MipCount field. The negative value was then passed like a positive value, resulting in the number 4294967295. Theoretically, it might complete somewhen but instead here's a small fix :

TexToolWrap.zip

Hey, I was having the same problem. I wanted to try your fix but I don't know what to do with .dll file you attatched. Please can you guide me where to put it?

from uabe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.