Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Uncolored Textures Problem

Get your graphics formats figures out here! Got details for others? Post here!
Post Reply
fierce
advanced
Posts: 41
Joined: Mon Jul 16, 2012 12:18 pm
Has thanked: 14 times

Uncolored Textures Problem

Post by fierce »

Hello,

I'm building a Noesis script to extract the contents from the game Naruto Shippuden: Ultimate Ninja Storm.
I've been able to extract the models successfully but I'm having a problem with the textures.
On each set of object I have 3 files that represent the level of detail (sa 00 aa lod 0/1/2), 0 being the highest level of detail.
The problem is that some textures are grey.
I don't have any experience with how textures work but my guess would be that the color inputs are swapped as I read somewhere. (Maybe red with alpha or something like that).
If that's the case, how can I turn them into how the actual texture should look like?

Here is the texture sheet for this set of objects:
Image


Thank you in advance for any help.

Edit: Sample texture added
You do not have the required permissions to view the files attached to this post.
MrAdults
Moderator
Posts: 1007
Joined: Mon Mar 23, 2009 2:57 am
Has thanked: 44 times
Been thanked: 505 times

Re: Uncolored Textures Problem

Post by MrAdults »

You can use rapi.imageDecodeDXT to decode raw DXT data in any supported format to RGBA32, and from there you can do whatever you want with the pixel data, such as swapping and deriving channels. You can also use rapi.imageNormalSwizzle on your RGBA32 data to perform a variety of common normal map swapping/derivation techniques.
fierce
advanced
Posts: 41
Joined: Mon Jul 16, 2012 12:18 pm
Has thanked: 14 times

Re: Uncolored Textures Problem

Post by fierce »

I tried using:

Code: Select all

data = rapi.imageDecodeDXT(data, imgWidth, imgHeight, noesis.FOURCC_DXT5)
texture = NoeTexture(id, imgWidth, imgHeight, data, NOESISTEX_DXT1)
texList.append(texture)
material = NoeMaterial("ntxr_"+str(tid), "")
material.setTexture(tid)
matList.append(material)

mdl.setModelMaterials(NoeModelMaterials(texList, matList))
But I always get:
WARNING: Could not parse texture attributes!

Maybe I'm doing something wrong or inputing the wrong amount of data for the texture. I'm not inputing the header on the data.
What data do I need to input?
How do I know for example how much bytes should a 64x64 texture have?

Edit: repr output: (NoeTexture: w:64 h:64 p:5 f:0 n:0)
chrrox
Moderator
Posts: 2602
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1422 times

Re: Uncolored Textures Problem

Post by chrrox »

you should look at the bullet witch example included with noesis.
rapi.imageDecodeDXT returns a plain rbga texture
so the format after that is
texFmt = noesis.NOESISTEX_RGBA32
example
data = rapi.imageUntile360DXT(rapi.swapEndianArray(data, 2), imgWidth, imgHeight, 8)
data = rapi.imageDecodeDXT(data, imgWidth, imgHeight, noesis.FOURCC_DXT1NORMAL)
texFmt = noesis.NOESISTEX_RGBA32
return NoeTexture(entry.name, imgWidth, imgHeight, data, texFmt)
fierce
advanced
Posts: 41
Joined: Mon Jul 16, 2012 12:18 pm
Has thanked: 14 times

Re: Uncolored Textures Problem

Post by fierce »

chrrox wrote:you should look at the bullet witch example included with noesis.
rapi.imageDecodeDXT returns a plain rbga texture
so the format after that is
texFmt = noesis.NOESISTEX_RGBA32
example
data = rapi.imageUntile360DXT(rapi.swapEndianArray(data, 2), imgWidth, imgHeight, 8)
data = rapi.imageDecodeDXT(data, imgWidth, imgHeight, noesis.FOURCC_DXT1NORMAL)
texFmt = noesis.NOESISTEX_RGBA32
return NoeTexture(entry.name, imgWidth, imgHeight, data, texFmt)
I did look at that example, and I did try that, and a lot of other different options, but I always get:
WARNING: Could not parse texture attributes!
The materials appear on the Data Viewer, but not the textures

Edit: Attached the sample. 64x64. Size of the data that I'm inputting: 2728
Edit2: Sometimes using rapi.swapEndianArray(data, 2) makes my Noesis crash
Edit3: I think I found what the problem was, I was using 0,1,2,3.. on the texture ID, tried prefixing it with a name and its working now
You do not have the required permissions to view the files attached to this post.
fierce
advanced
Posts: 41
Joined: Mon Jul 16, 2012 12:18 pm
Has thanked: 14 times

Re: Uncolored Textures Problem

Post by fierce »

Hello again,

I've tried working with all or at least almost all Noesis functions regarding image handling and I got nowhere on those grey textures, the further I went is to have a colored texture, but its always one color, like light red instead of grey.
The grey textures fit the UV's perfectly but I also thought there could be the same exact textures on some other file on the same folder but I didn't find any textures similar to those grey ones.

Can any one give me an explanation on what those textures are and if they are indeed supposed to be normal textures?

Thank you in advance for any help.
Acewell
VIP member
VIP member
Posts: 1330
Joined: Wed Nov 05, 2008 12:16 pm
Has thanked: 2710 times
Been thanked: 884 times

Re: Uncolored Textures Problem

Post by Acewell »

They look like your typical diffuse, specular and bump maps to me. :think:
fierce
advanced
Posts: 41
Joined: Mon Jul 16, 2012 12:18 pm
Has thanked: 14 times

Re: Uncolored Textures Problem

Post by fierce »

Are you saying that its not a "real" texture?

They are textures for objects and buildings. I'm new to 3D design but from reading:
Diffuse map = A normal, flattened texture
Specular map = A map that represents where the texture should be more shinny/highlighted
Bump map = A map of effects to add to the texture, like rust or dirt
Am I right? If those are just specular/bump maps the "real" texture should be somewhere, but I cant seem to find it. I'm going to search more and see if I can come up with something.

Thank you for the help
Acewell
VIP member
VIP member
Posts: 1330
Joined: Wed Nov 05, 2008 12:16 pm
Has thanked: 2710 times
Been thanked: 884 times

Re: Uncolored Textures Problem

Post by Acewell »

They're all real textures, just with a different purpose. They are combined at runtime in the game engine to produce the final rendered result. The diffuse(color) texture is your main one.
fierce
advanced
Posts: 41
Joined: Mon Jul 16, 2012 12:18 pm
Has thanked: 14 times

Re: Uncolored Textures Problem

Post by fierce »

I think I just figured everything out.
I wasn't finding a texture because I was thinking that the specular map UVs were the diffuse map UVs. And also because each mesh is separated by groups and I was putting the UV maps all together (they didnt seem to make sense), I tried each group UVs separately and now they make sense and I found the textures that are supposed to go there.

Thank you for the help
Post Reply