XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Tue Oct 23, 2018 8:04 am

All times are UTC + 1 hour


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: How to edit .TEX files from 50 Cent Bulletproof PS2
PostPosted: Sat Jan 20, 2018 2:58 am 
Offline
n00b

Joined: Wed Dec 13, 2017 5:50 am
Posts: 10
Has thanked: 7 times
Have thanks: 0 time














You can make the ads go away by registering

So, basically i want to convert this format to any image to modify and re convert to .TEX

tried some tools around the web and only texture finder give me some result.

TextureFinder preview.
Image

TEX file samples
http://www.mediafire.com/file/cb86158u7zsa9t0/LEGAL_EN.TEX
http://www.mediafire.com/file/nro1nafpt3j515j/PGRBRDR.TEX
http://www.mediafire.com/file/q6lbrgofajblh4f/FAIL.TEX

Thankies!! :] :]

_________________
The life without music and games is a truly mistake.


Top
 Profile  
 
 Post subject: Re: How to edit .TEX files from 50 Cent Bulletproof PS2
PostPosted: Sat Jan 20, 2018 6:18 am 
Offline
VIP member
VIP member
User avatar

Joined: Wed Nov 05, 2008 12:16 pm
Posts: 1107
Has thanked: 2227 times
Have thanks: 629 times

all 3 samples use the same settings
i've never done a Noesis python script for ps2 images but i may give it a try later. :D


Attachments:


You do not have the required permissions to view the files attached to this post. Register to gain access.


_________________
Noesis
Hex2obj
QuickBMS
Asset Studio
TextureFinder


Top
 Profile  
 
 Post subject: Re: How to edit .TEX files from 50 Cent Bulletproof PS2
PostPosted: Sat Jan 20, 2018 7:14 pm 
Offline
n00b

Joined: Wed Dec 13, 2017 5:50 am
Posts: 10
Has thanked: 7 times
Have thanks: 0 time
AceWell wrote:

all 3 samples use the same settings
i've never done a Noesis python script for ps2 images but i may give it a try later. :D


OMG!!! thank you so much, that program works like a charm :D, actually ive downloaded noesis and loaded some scripts from forum but none of them working in this .TEX, maybe was only for a specific game that already posted :P

edit: i got lost to convert back my edited image to .TEX, i have to use the same program?

once again thank you for helping me!!!

_________________
The life without music and games is a truly mistake.


Last edited by TjVatio on Sun Jan 21, 2018 3:02 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: How to edit .TEX files from 50 Cent Bulletproof PS2
PostPosted: Sun Jan 21, 2018 2:49 am 
Offline
VIP member
VIP member
User avatar

Joined: Wed Nov 05, 2008 12:16 pm
Posts: 1107
Has thanked: 2227 times
Have thanks: 629 times
TjVatio wrote:
so, i got lost to convert back my edited image to .TEX, i have to use the same program?

no, you have to break it back down to paletted data and retwiddle to rebuild it, i can't help with this.
i tried making a Noesis python script to open the TEX files but i can't get the result like the one in "Console Texture Explorer". :(

_________________
Noesis
Hex2obj
QuickBMS
Asset Studio
TextureFinder


Top
 Profile  
 
 Post subject: Re: How to edit .TEX files from 50 Cent Bulletproof PS2
PostPosted: Sun Jan 21, 2018 7:48 pm 
Offline
veteran

Joined: Fri Oct 16, 2015 8:05 pm
Posts: 131
Has thanked: 2 times
Have thanks: 68 times
AceWell wrote:
TjVatio wrote:
so, i got lost to convert back my edited image to .TEX, i have to use the same program?

no, you have to break it back down to paletted data and retwiddle to rebuild it, i can't help with this.
i tried making a Noesis python script to open the TEX files but i can't get the result like the one in "Console Texture Explorer". :(


i don't like sad pals. you forgot something. ;) i borrowed some code from there and unshuffled this bitch, ps2 style. :] you gotta do the pointer dance. :D

Code:
from inc_noesis import *
import noesis
import rapi

def registerNoesisTypes():
   handle = noesis.register("50cent Bulletproof TEX Textures", ".tex")
   noesis.setHandlerTypeCheck(handle, TEXCheckType)
   noesis.setHandlerLoadRGBA(handle, TEXLoadRGBA)
   #noesis.logPopup()
   return 1

def TEXCheckType(data):
   return 1

def TEXLoadRGBA(data, texList):
   bs = NoeBitStream(data)
   filename = bs.read("32B")
   hash = bs.readInt()
   width = bs.readUShort()
   height = bs.readUShort()
   #dummy1 = bs.readUByte()
   size_bmapdata = width * height #bs.readUInt()
   #print(str(size_bmapdata))
   #dummy2 = bs.readUByte()
   #ofs_palette = bs.readUInt()
   bs.seek(0x40, NOESEEK_ABS)
   texData = bs.readBytes(size_bmapdata)
   #bs.seek(ofs_palette + 0x40, NOESEEK_ABS)
   palData = []
   for x in range(8):
      for p in range(32):
         read = bs.readUByte()
         palData.append(read)
      bs.seek(32, NOESEEK_REL)
      for p in range(32):
         read = bs.readUByte()
         palData.append(read)
      bs.seek(-64, NOESEEK_REL)
      for p in range(32):
         read = bs.readUByte()
         palData.append(read)
      bs.seek(32, NOESEEK_REL)
      for p in range(32):
         read = bs.readUByte()
         palData.append(read)

   palData = bytearray(palData)
   pic = rapi.imageUntwiddlePS2(texData, width, height, 8)
   pic = rapi.imageDecodeRawPal(pic, palData, width, height, 8, "r8g8b8a8")
   texList.append(NoeTexture(str(filename), width, height, pic, noesis.NOESISTEX_RGBA32))

   return 1


butchered and commented out are data pointer safeguards. assuming the layout is always aligning the image followed by the pallette without padding.

reversing is not possible like that. you'd need to explicit export a indexed bitmap with a palette. tga does that. and you gotta reshuffle the palette the same way. the twiddlePS2 should work as it is tho.


Top
 Profile  
 
 Post subject: Re: How to edit .TEX files from 50 Cent Bulletproof PS2
PostPosted: Mon Jan 22, 2018 5:31 am 
Offline
VIP member
VIP member
User avatar

Joined: Wed Nov 05, 2008 12:16 pm
Posts: 1107
Has thanked: 2227 times
Have thanks: 629 times
episoder wrote:
and unshuffled this bitch, ps2 style. :] you gotta do the pointer dance.

ah yes that works great! thanks :D
it seems i didn't do that palette unshuffle thing and was getting some pixelated areas,
is that a standard procedure in parsing PS2 textures? :)

_________________
Noesis
Hex2obj
QuickBMS
Asset Studio
TextureFinder


Top
 Profile  
 
 Post subject: Re: How to edit .TEX files from 50 Cent Bulletproof PS2
PostPosted: Mon Jan 22, 2018 6:02 am 
Offline
veteran

Joined: Fri Oct 16, 2015 8:05 pm
Posts: 131
Has thanked: 2 times
Have thanks: 68 times
AceWell wrote:
episoder wrote:
and unshuffled this bitch, ps2 style. :] you gotta do the pointer dance.

ah yes that works great! thanks :D
it seems i didn't do that palette unshuffle thing and was getting some pixelated areas,
is that a standard procedure in parsing PS2 textures? :)


i assume yes. and it's only on 8-bit textures. the texture finder seems to always do it. those i scripted, needed it. gits, resident evil dead aim, onimusha3. all of them shuffled. i could check dmc too, but this got more block size fuckery in some of it's files. later maybe. :)


Top
 Profile  
 
 Post subject: Re: How to edit .TEX files from 50 Cent Bulletproof PS2
PostPosted: Tue Jan 23, 2018 5:28 am 
Offline
n00b

Joined: Wed Dec 13, 2017 5:50 am
Posts: 10
Has thanked: 7 times
Have thanks: 0 time
episoder wrote:
AceWell wrote:
episoder wrote:
and unshuffled this bitch, ps2 style. :] you gotta do the pointer dance.

ah yes that works great! thanks :D
it seems i didn't do that palette unshuffle thing and was getting some pixelated areas,
is that a standard procedure in parsing PS2 textures? :)


i assume yes. and it's only on 8-bit textures. the texture finder seems to always do it. those i scripted, needed it. gits, resident evil dead aim, onimusha3. all of them shuffled. i could check dmc too, but this got more block size fuckery in some of it's files. later maybe. :)


Wow!!! you guys rock!!!! 8) 8) now noesis work fine loading this .TEX file
also when i export from preview and i choose tga or png, it save with transparency by default, there's a way to change this?

and with ConsoleTextureExplorer i followed your advices AceWell and the only way that program import the edited texture succesfully into the .TEX, is doing with .TM2 format image, this gives an almost none support, the only Proprietary software that let me save it in that format is one calling OPTPiX iMageStudio. :shame:

Edit: digging more, i found one program calls Rainbow that support saving .tm2 and does the trick :] the against on this. is too much work around to get this working, AceWell will you plain to do some changes in noesis to fully support this? saving maybe into tm2? or back to .TEX? im being too much greedy? :D :D

many many thanks @AceWell and @episoder!!!!!

_________________
The life without music and games is a truly mistake.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group