Quantcast

Jump to content

» «
Photo

[REL|OpenSrc] TxdGen, RW texture converter

60 replies to this topic
El Dorado
  • El Dorado

    If it keeps on rainin' levee's goin' to break

  • Feroci
  • Joined: 07 Nov 2013
  • Brazil

#31

Posted 23 March 2015 - 12:48 AM Edited by El Dorado, 23 March 2015 - 12:50 AM.

Hoping for a all in one tool. You need one program to extract textures, then another to build TXD files, hell... you should talk to DK and team up with him, since he's/was doing similiar work.

  • The_GTA likes this

Concavax
  • Concavax

    Punk-ass Bitch

  • Members
  • Joined: 26 Dec 2013
  • None

#32

Posted 23 March 2015 - 03:48 AM

 

I've used your tool, alpha textures end up completely messed.
This needs work, (...).

I agree! TXD Workshop finally needs a good replacement!

For guys interested in my progress, my tool now successfully supports all mobile TXD formats. Since the RenderWare implementation is pretty new, I need to rewrite tons of code that is incompatible.

When I am done TxdGen is gonna be even better! :)

 

I view this post every day to see if any update. :)

  • The_GTA likes this

The_GTA
  • The_GTA

    revenclaw

  • Members
  • Joined: 27 Dec 2012
  • Germany
  • Modding Milestone [Magic.TXD]

#33

Posted 31 March 2015 - 12:10 AM Edited by The_GTA, 31 March 2015 - 06:43 AM.

Hoping for a all in one tool. You need one program to extract textures, then another to build TXD files, hell... you should talk to DK and team up with him, since he's/was doing similiar work.

The converter has reached an incredible amount of complexity as it is. I want to work on a TXD editor but it will take some time.
 
Teaming up with DK sounds like a good idea.
 

I view this post every day to see if any update. :)

I appreciate your dedication. Thank you! :)

--------------------------------------------------

TxdGen 0.9.8 has just released! :)

This version is written in a completely new RenderWare implementation. With it comes the support for GTA3 mobile TXD files!
You can now generate and convert PowerVR, dxt (mobile), ATC and uncompressed (mobile) textures!

I want to thank Vadim M for providing me the Android TXD files. Without his support this version would not be possible :)

Get it from here: http://en.file-uploa..._0.9.8.zip.html (hotfix)

Because of the PowerVR library that I am using you now need the Visual Studio 2013 runtime, x86 version. You can get it from here!

Have fun, guys! <3
  • Mr. Jago, Reyks and Concavax like this

Concavax
  • Concavax

    Punk-ass Bitch

  • Members
  • Joined: 26 Dec 2013
  • None

#34

Posted 12 April 2015 - 06:08 PM

Hi, any chance to make a good txd extractor?
Because the currents ones makes a bad export with the palette color or alpha channel.


The_GTA
  • The_GTA

    revenclaw

  • Members
  • Joined: 27 Dec 2012
  • Germany
  • Modding Milestone [Magic.TXD]

#35

Posted 12 April 2015 - 06:45 PM

Hi, any chance to make a good txd extractor?
Because the currents ones makes a bad export with the palette color or alpha channel.

 

Chance is pretty slim, for now. Since I am now back in University I have to focus on irl affairs.

 

I got a GUI framework that needs finishing up. When its finished I will debut it with a good TXD manager. It will come with scripting support :)

  • Mr. Jago and Concavax like this

Concavax
  • Concavax

    Punk-ass Bitch

  • Members
  • Joined: 26 Dec 2013
  • None

#36

Posted 12 April 2015 - 07:27 PM

Chance is pretty slim, for now. Since I am now back in University I have to focus on irl affairs.

 

I got a GUI framework that needs finishing up. When its finished I will debut it with a good TXD manager. It will come with scripting support :)

 

This make my day :D

  • The_GTA likes this

Dageron RUS
  • Dageron RUS

  • Members
  • Joined: 28 Apr 2009
  • Belarus

#37

Posted 13 April 2015 - 04:33 AM

Huge thanks for the SA PS2 support :)
  • The_GTA likes this

Concavax
  • Concavax

    Punk-ass Bitch

  • Members
  • Joined: 26 Dec 2013
  • None

#38

Posted 19 April 2015 - 04:16 PM

Hi, me again. :D

About txdgen, i been test with the game about a week with differents tools. And i have a question, this tool can make anasotropy filter for each texture?

Because other tools when make the txd these textures are more detailed, and with txdgen the final result is a texture more smooth.

So the anasotropy filtering change something or the filters inside of txdgen?


The_GTA
  • The_GTA

    revenclaw

  • Members
  • Joined: 27 Dec 2012
  • Germany
  • Modding Milestone [Magic.TXD]

#39

Posted 20 April 2015 - 05:35 AM

Hi, me again. :D

About txdgen, i been test with the game about a week with differents tools. And i have a question, this tool can make anasotropy filter for each texture?

Because other tools when make the txd these textures are more detailed, and with txdgen the final result is a texture more smooth.

So the anasotropy filtering change something or the filters inside of txdgen?

Good point, friend. I have not implemented Anisotropy generation for textures into TxdGen. I heard that MagicTxd adds Anisotropy if you create a texture with it. Any texture that you create using MagicTxd and then parse using TxdGen will keep its Anisotropy level.

 

Anisotropy itself does not change the content of the texel data. But you can expect a new feature that lets you add Anisotropy automatically in the next version of TxdGen! :)

  • Concavax likes this

Nanda_
  • Nanda_

    Player Hater

  • Members
  • Joined: 23 Jul 2011
  • Indonesia

#40

Posted 20 April 2015 - 09:47 AM Edited by TheDriverWithPlan, 20 April 2015 - 09:49 AM.

When I was messing around with TxdGen, I set mipGenMaxLevel to a big value, like 50. Then I went ahead to mipmap all of my textures - all of them resulted having varying mipmap layers ranging from 8 to 10 when I view them with TXD Workshop.

 

What is the maximum mipmap layer you can have on each texture? Does the max number of mipmap layers depend on some factors from the texture?


The Hero
  • The Hero

    Into TheGame!!!

  • Feroci
  • Joined: 25 Jan 2005
  • Germany
  • Most Helpful Modding 2016 [Honorable mention]
    Best Script or Plugin 2016 [SkyGfx]
    Contribution Award [Mods]

#41

Posted 20 April 2015 - 10:43 AM

Depends on the initial size. For each mipmap the width and height are halved, so if you start with, say, a square tex of 128px width and height, you will have 64px, 32px, 16px, 8px, 4px (idk how far it goes, depending on format there's a limit). So for 50 levels you'd need a texture of dimensions 4503599627370496px or so.
  • Mr. Jago, Nanda_ and The_GTA like this

The_GTA
  • The_GTA

    revenclaw

  • Members
  • Joined: 27 Dec 2012
  • Germany
  • Modding Milestone [Magic.TXD]

#42

Posted 20 April 2015 - 08:36 PM Edited by The_GTA, 22 June 2015 - 08:49 PM.

Calculating mipmap layers heavily depends on the target architecture (PC, Android, PS2, XBOX, etc) and the underlying surface format (raw, DXT, PowerVR, etc). By default we use the Direct3D mipmap layer convention which always generates mipmaps to the layer dimension 1x1.
 
For mipmaps you must distinguish between layer dimensions and surface dimensions. A layer dimension is the actual valid section of the image that will be rendered from in the game. A surface
dimension is the texture data dimension that is required by the surface format. If the image data is raw it is always true that layer dimensions equal surface dimensions. Otherwise in the case of
DXT compression the surface dimensions are the layer dimensions but upward aligned by 4.
 
For example, let's look at two different texture formats.
 
RASTER_8888, 32bit
layer dimms: 256x128, 128x64, 64x32, 32x16, 16x8, 8x4, 4x2, 2x1, 1x1
surf dimms: 256x128, 128x64, 64x32, 32x16, 16x8, 8x4, 4x2, 2x1, 1x1
 
DXT1
layer dimms: 256x128, 128x64, 64x32, 32x16, 16x8, 8x4, 4x2, 2x1, 1x1
surf dimms: 256x128, 128x64, 64x32, 32x16, 16x8, 8x4, 4x4, 4x4, 4x4
 
Here is a naive code I wrote for you that attempts to calculate the amount of mipmap layers for a texture. For that you need to pass it the layer dimensions of your texture.

#include <algorithm>

bool getMipLevelMaxCount( unsigned int texWidth, unsigned int texHeight, unsigned int& mipCount )
{
    if ( texWidth == 0 || texHeight == 0 )
    {
        return false;
    }
    
    unsigned int maxDimm = std::max( texWidth, texHeight );
    
    unsigned int actualMipCount = 0;
    
    while ( maxDimm != 0 )
    {
        maxDimm /= 2;
        
        actualMipCount++;
    }
    
    mipCount = actualMipCount;
    return true;
}

Please note that this code is not a perfect solution. Use it as inspiration only. I left a problem in it for educational purposes. :)

 

EDIT: thanks to LINK/2012 for resolving the code above. there was no issue to begin with. the contest is over, folks!

  • Mr. Jago and Concavax like this

Voodooman
  • Voodooman

    v00d00m4n

  • Members
  • Joined: 28 Jul 2005

#43

Posted 12 May 2015 - 02:40 PM Edited by Voodooman, 12 May 2015 - 02:58 PM.

can we have precise control on output format and quality please?

I want to output to ARGB8888 or everything to DXT5, can I do that?

Another thing, can we have txd or texture specific ini sections so that once txdgen process texture of this name or txd of this name it would follow sore overrid rules for only this texture or txd?

like this
[main]
main rules here

[particle.txd]
some overrides specific to txd with same name

[wheel_lightvan64]
overrides specific to exact texture of this name.


Please?

Why would I want that? I wanted top add mipmaps globaly to every texture, but I want to skip hud specific txds and few more exact textures that works better without mips.

Also can we have some switch that will only batch unpack all textures with corresponding names of folder like img_name.img\txd_name.txd\texture_name.tga\bmp\png\dds and specified format (probably would be nice if extra controls would allow to select between using same format for all or unpack compressed textures ass dds without recompression and uncompressed textures as tga or png, or bmp if there is no alpha) and routine that will allow to build txds and imgs from such folders with dds\bmp\png\tga files inside?

After using txdgen no other txd tools works properly and I don't want to compromise quality of textures just to make txd workshop work, also its UI is quite slow and clunky and counter productive anyway and it would be way more comfortable to edit textures if txdgen can unpack them all into generic formats for easy edit in any editor, so that tools like txd workshop would not be needed anymore (until someone wants to save space on hdd and cant unpack all textures).


One mor thing - I cant find any info on mipgenmode other than default, is there anything else? any documentation on this please?
  • The_GTA and Concavax like this

Markuza
  • Markuza

  • Members
  • Joined: 20 Jan 2013
  • None

#44

Posted 26 May 2015 - 07:05 PM Edited by Markuza97, 27 May 2015 - 01:04 PM.

Z1QKdau.png

 

Very good tool. SRt3 + GTA IV Style Radar + Styled Weapon Icons installed. (Requires GTA3_1.img patching)

 

Can you do something similar for DFF files? PC to PS2 DFF converter?

  • The_GTA likes this

Silent
  • Silent

    Chief Vision™ Alterer

  • GTA Mods Staff
  • Joined: 01 Feb 2010
  • Poland
  • Most Helpful [Modding] 2016
    Contribution Award [Mods]
    Best Script/Plugin 2014 [SilentPatch]
    Most Respected 2014
    Most Helpful [Mods] 2014
    Most Helpful [GTA] 2013
    Most Helpful [Mods] 2013
    Most Talented [Modding] 2013
    Best Map 2013 [ViceCityStories PC Edition]
    Best Vehicle 2013 [III Aircraft]
    Most Helpful [Mods] 2012
    Modder of the Year 2012

#45

Posted 27 May 2015 - 03:54 PM

Don't PC DFFs work straight away? They are using a generic, cross-platform format.
  • The_GTA likes this

The_GTA
  • The_GTA

    revenclaw

  • Members
  • Joined: 27 Dec 2012
  • Germany
  • Modding Milestone [Magic.TXD]

#46

Posted 27 May 2015 - 06:35 PM Edited by The_GTA, 27 May 2015 - 06:46 PM.

can we have precise control on output format and quality please?

(...)

Please?

(...)

Sure! But please give me some lee-way. I want to provide a very great tool at next version. So I am working real hard on it. :)

 

The framework I need for the next version is looking good so far, just a few more features need coding.

 

Seeing that much feedback is amazing. You can be sure that every single point will make it into the design of next version ;)

 

Very good tool. SRt3 + GTA IV Style Radar + Styled Weapon Icons installed. (Requires GTA3_1.img patching)

 

Can you do something similar for DFF files? PC to PS2 DFF converter?

I appreciate to see that you enjoy the PlayStation 2 pipeline of my tool! Yes, I will eventually take a look at PS2 DFF instancing aswell, not that it is a complete necessity. The performance of loading the map should increase dramatically tho, as well as I will learn more about to-the-metal graphics processing.

 

But yea, please be patient aswell... :)

 

Don't PC DFFs work straight away? They are using a generic, cross-platform format.

I believe that is true. I am currently unaware of any special PS2 DFF native data specialties, but seeing how TXDs have them there sure should be some. Will be interresting to see what I can find out.

 

In a different context, DFFs do rely on the RenderWare version, so being able to switch that version should be pretty useful ;)

  • Markuza likes this

rollout
  • rollout

    Outlaw

  • Members
  • Joined: 02 Aug 2010
  • Portugal

#47

Posted 11 June 2015 - 01:02 AM

Can someone help me?

When I'm using TxdGen on SRt3 textures, in more than one file, this error appears:

 

error.png

 

What does this error means?

I really don't understand what it wants to say...  :panic:


The_GTA
  • The_GTA

    revenclaw

  • Members
  • Joined: 27 Dec 2012
  • Germany
  • Modding Milestone [Magic.TXD]

#48

Posted 13 June 2015 - 09:33 AM Edited by The_GTA, 15 June 2015 - 06:18 PM.

Can someone help me?
When I'm using TxdGen on SRt3 textures, in more than one file, this error appears:

-- BROKEN IMAGE LINK --

What does this error means?
I really don't understand what it wants to say...  :panic:

The texture "LODcrkfactdem" has no texture data inside of it. This can have multiple reasons, like damaged texture data size or just zero mipmaps specified. If this game will load this texture, it will display garbage data. Please fix this TXD archive or remove it.

Omicida
  • Omicida

    Player Hater

  • New Members
  • Joined: 14 Jun 2015
  • Russia

#49

Posted 14 June 2015 - 07:13 PM

Hi, guys, i have one problem. Look, i install SRT3, then 2048.cs, then 2DFX. But when i start play SA:MP, it whrite me many many Warring like "**** dont load at time", and crash, or all textures gone.


The_GTA
  • The_GTA

    revenclaw

  • Members
  • Joined: 27 Dec 2012
  • Germany
  • Modding Milestone [Magic.TXD]

#50

Posted 15 June 2015 - 06:29 PM

Look, i install SRT3, then 2048.cs, then 2DFX. But when i start play SA:MP, it whrite me many many Warring like "**** dont load at time", and crash, or all textures gone.

Hello there! :)

You seem to have problems with the SRt3 mod in combination with SA:MP and other mods.
Have you tried contacting the 2DFX or SRt3 guys for solving your issue? How exactly is TxdGen related to stuff?

Since you cannot use the messaging system, I have to debunk this with you here. Hopefully we can get this sorted out for you,
even though I believe it is not directly related to TxdGen. ;)

Omicida
  • Omicida

    Player Hater

  • New Members
  • Joined: 14 Jun 2015
  • Russia

#51

Posted 16 June 2015 - 01:18 PM

Yeap. I read about yours upgrade of .txd in SRT3 with yours TxdGen. And try it too, but have some question with settings of .ini file. 


Nexment
  • Nexment

    Player Hater

  • New Members
  • Joined: 10 Jan 2016
  • Brazil

#52

Posted 10 January 2016 - 12:46 AM

That's a really useful tool, i'm gonna use a lot.  :D
Is there any way to convert txd from another platform to pc ?

The_GTA
  • The_GTA

    revenclaw

  • Members
  • Joined: 27 Dec 2012
  • Germany
  • Modding Milestone [Magic.TXD]

#53

Posted 15 January 2016 - 09:48 PM

 

That's a really useful tool, i'm gonna use a lot.  :D
Is there any way to convert txd from another platform to pc ?

 

I am glad you like it!

 

http://www.gtamoddin..._Andreas_for_PC

 

Just try the settings from there. I think you have to change the game version if you want to convert to III or VC. :)


Jinx.
  • Jinx.

    certified forklift driver

  • Facade
  • Joined: 15 Dec 2010
  • Romania
  • Best WIP Mod 2014 [Grand Theft Auto 3D]

#54

Posted 15 January 2016 - 09:56 PM

For some reason, whenever I want to convert a mobile car texture from GTA 3 Mobile to GTA 3 PC, they don't get converted properly. Characters textures get converted properly though.

The_GTA
  • The_GTA

    revenclaw

  • Members
  • Joined: 27 Dec 2012
  • Germany
  • Modding Milestone [Magic.TXD]

#55

Posted 15 January 2016 - 10:11 PM

For some reason, whenever I want to convert a mobile car texture from GTA 3 Mobile to GTA 3 PC, they don't get converted properly. Characters textures get converted properly though.

If you encounter a TXD conversion problem and can nail it down to a certain TXD, please send me the original, the converted and maybe a result TXD of how it is supposed to be.

 

Conversion could have succeeded but the format of the TXD could be different on mobile (texture names, etc).


Mrch0
  • Mrch0

    Player Hater

  • New Members
  • Joined: 18 Jul 2016
  • Bosnia-and-Herzegovina

#56

Posted 18 July 2016 - 01:49 PM

When I download my TxdGen, extract it in one folder on the desktop and run txdgen.exe this pops up:

wdynUXJ.png

 

I've installed Visual Studio 2013 redistributable, x86 version as you can see here:

ROohpMW.png

 

But still it doesn't matter, I can't run txdgen.exe without error. I someone could help me out with this It would be much appreciated.


The_GTA
  • The_GTA

    revenclaw

  • Members
  • Joined: 27 Dec 2012
  • Germany
  • Modding Milestone [Magic.TXD]

#57

Posted 19 July 2016 - 06:15 AM Edited by The_GTA, 19 July 2016 - 06:18 AM.

I think the problem is that I broke XP compatibility somewhere. A new version of TxdGen is in the works that will share RenderWare core with Magic.TXD. In fact, I worked on it yesterday.

Codebase repository: https://app.assembla...rsion-19/source

TxdGen will be meant for people that still want to convert TXDs but cannot use Magic.TXD because legacy OS, such as Windows XP.
  • Mrch0 likes this

gts.
  • gts.

    Gangsta

  • Members
  • Joined: 20 Jun 2015
  • United-States

#58

Posted 05 September 2016 - 07:34 AM

I'm mipmapping all GTA SA textures (gta3.img) with this tool so... it's recommended apply it to the interior textures too (gta_int.img)? Since I've never seen any mod with interior textures mipmapped, so I wanted to ask that.

  • Inadequate and The_GTA like this

Reyks
  • Reyks

    Valar Morghulis

  • Feroci
  • Joined: 18 May 2012
  • Brazil
  • Helpfulness Awards [Mods]

#59

Posted 07 September 2016 - 06:06 PM

I'm mipmapping all GTA SA textures (gta3.img) with this tool so... it's recommended apply it to the interior textures too (gta_int.img)? Since I've never seen any mod with interior textures mipmapped, so I wanted to ask that.

Yes you should mipmap every .img directory, then extract the .txd files into a folder with the same names as the .img if you use modloader.

  • The_GTA likes this

The_GTA
  • The_GTA

    revenclaw

  • Members
  • Joined: 27 Dec 2012
  • Germany
  • Modding Milestone [Magic.TXD]

#60

Posted 16 October 2016 - 10:40 PM

eXLqOPg.png

TxdGen 1.0 has been released!
This is the most stable release yet. It shares the codebase with the Magic.TXD tool so that all improvements from it also affect TxdGen. A much wanted feature from my userbase was Windows XP support, so here it is!

UyrYJeYm.png

New native texture formats have been added: Gamecube and PSP (legacy)! This adds modding to even more commercial games, both ripping and creating new assets. If you enjoy TxdGen I recommend using Magic.TXD aswell, if you are using Windows 7 and above.

Recently I created a IDB to PDB symbol embedding framework. If that rings a bell and you are a GTA engine developer please check it out!

I will be taking a break from programming now.

Take care,
- Martin
  • Silent, LeonTheKiller, Reyks and 1 other like this




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users