Jump to content

[REL|OpenSrc] TxdGen, RW texture converter


Recommended Posts

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.

Edited by El Dorado

 

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

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-upload.net/download-10488437/txdgen_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

Edited by The_GTA
  • Like 3
  • 2 weeks later...

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 :)

  • Like 2

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

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?

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! :)

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?

Edited by TheDriverWithPlan

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.

  • Like 3

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!

Edited by The_GTA
  • Like 2
  • 3 weeks later...

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?

Edited by Voodooman
  • Like 2
  • 2 weeks later...

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

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 ;)

Edited by The_GTA
  • 2 weeks later...

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. Edited by The_GTA

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

  • 6 months later...

 

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.gtamodding.com/wiki/TxdGen/Mipmapping_San_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. :)

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.

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

  • 6 months later...

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.

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.com/spaces/green-candy/subversion-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.

Edited by The_GTA
  • 1 month later...

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.

  • Like 2

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.

  • 1 month later...

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 0 User Currently Viewing
    0 members, 0 Anonymous, 0 Guests

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.