Jump to content

[REL|OpenSrc] TxdGen, RW texture converter


Recommended Posts

TxdGen is a RenderWare texture conversion toolchain that I have been working on since December. It started out with my idea to mod the PlayStation 2 version of GTA:San Andreas but I decided to go full-on and add support for all kinds of RenderWare TXD formats (PC, PS2, XBOX).

 

It supports every known Rockstar Games TXD archive.

 

Visit the GTA Modding wiki page for all the details!

 

Release page on GTAGarage.

 

Similar tool by The Hero/aap. I have forked his old codebase and done heavy research on the PlayStation 2 textures so that I could generate working ones from scratch. If everything goes well I will contribute my research back to his codebase. Without his open source work, I would have been set back by some time while trying to develop my own RenderWare toolchain, so give this guy a heads up :)

 

Direct download (1.0, 17.10.2016 00:06): OneDrive

 

Supported is Windows XP SP3 and above. No runtime libraries required anymore.

 

How to use TxdGen

First, you have to get some TXD files that you want to convert (from the modding scene or official Rockstar discs). Put all of the TXD files into the "txdgen_in/" folder that is located by the tool. Now edit the "txdgen.ini" file that comes with the tool so that it converts the TXDs how you want it to. Then simply double click on "txdgen.exe". A command line window will open and tell you about conversion progress and debug info. By default (in 0.8) your new TXDs should be located in a new "txdgen_out/" folder. Put those TXDs into your custom game and enjoy!

 

Could you not follow these steps? Visit the wiki or watch the tutorial video below!

 

Media

(tutorial, HQ download)

(tutorial, HQ download)

 

Credits

This was my first tool release ever. Thank you so much for considering my tools!

 

Best wishes,

- Martin

Edited by The_GTA
Link to comment
https://gtaforums.com/topic/764498-relopensrc-txdgen-rw-texture-converter/
Share on other sites

This tool support dxt5?

DXT1, DXT3, DXT4, DXT5

 

What more could you wish for :)

 

For compatibility reasons, it does not output in DXT5. I could improve that in future versions. But if you convert from PC to XBOX, it should preserve your DXT5 compressed textures.

 

Added a D3DFORMAT compatibility list to the wiki page.

Edited by The_GTA
looks really good, does it support mipmaps? also, could you put a mirror up by any chance?

Yes, it extracts mipmaps from all platforms. In version 0.8 there is a bug where it extracts zero sized mipmaps of XBOX textures. That is fixed in the latest revision. The latest revision will also add XBOX GTAIII and GTA Vice City IMG decompression support.

 

Mirror (0.8): http://en.file-upload.net/download-10233594/txdgen_0.8.zip.html

Mirror (0.8.1): http://www.file-upload.net/download-10249862/txdgen_0.8.1.zip.html

 

NOTE: compressing textures for PlayStation 2 hardware may remove its mipmaps. This can be prevented by setting compressionQuality to 1.0.

 

Alright guys, 0.8.1 is out now! Now you can convert GTAIII and GTA Vice City XBOX textures to PC :)

Edited by The_GTA

Thanks, i try your tool with a txd compress in DXT5, and can convert Dxt5 Pc to Pc. Really a pretty good tool. Please i hope this awesome project dont die. Thank you, again. :)

what your "txdgen.ini" setting to convert pc txd to pc?. i want compress txd for gta3.

Any chance to built txd files with this tool in the future? I mean, conversion (TxdPC to TxdXbox) and build(Png, tar, etc to Txd).

Yes, I have plans to release a seperate tool that uses the same toolchain. I guess it will be called "TxdBuild". :)

 

what your "txdgen.ini" setting to convert pc txd to pc?. i want compress txd for gta3.

To compress PC format TXD files, just put them (or the .img containers they are in) into the "txdgen_in/" folder. Then set "compressTextures" to "true". If you want to enable DXT5 compression (for better alpha), then set "compressionQuality" to "1.0". To target the GTAIII engine, set "targetVersion" to "GTA3". Also, set "targetPlatform" to "PC".

 

Important to note is that already compressed textures will not be recompressed.

 

By the way, I just uploaded a hotfix (0.8.2) that fixes conversion of PS2 textures to raw PC format (without DXT compression). 0.8.1 and prior have a little oversight that put out invalid TXD containers.

 

Mirror (0.8.2): http://en.file-upload.net/download-10253109/txdgen_0.8.2.zip.html

Edited by The_GTA
  • Like 3

what your "txdgen.ini" setting to convert pc txd to pc?. i want compress txd for gta3.

To compress PC format TXD files, just put them (or the .img containers they are in) into the "txdgen_in/" folder. Then set "compressTextures" to "true". If you want to enable DXT5 compression (for better alpha), then set "compressionQuality" to "1.0". To target the GTAIII engine, set "targetVersion" to "GTA3". Also, set "targetPlatform" to "PC".

 

Important to note is that already compressed textures will not be recompressed.

 

i did compressed all txd in gta3.img and rebuilt after but the game stuck at loading screen what's wrong.

 

Any chance to built txd files with this tool in the future? I mean, conversion (TxdPC to TxdXbox) and build(Png, tar, etc to Txd).

Yes, I have plans to release a seperate tool that uses the same toolchain. I guess it will be called "TxdBuild". :)

:cookie::cookie::cookie::cookie::cookie::cookie::cookie::cookie:

I hope this come true :)

i did compressed all txd in gta3.img and rebuilt after but the game stuck at loading screen what's wrong.

It turns out that I forgot to update the Direct3D texture native struct header, so that the game probably rejected the TXD archives (for a good reason). Then I forgot to add IMG archive version 1 creation support. Also, there was another crash when building IMG archives, due to me restructuring that code in 0.8.1. You guys really know how to put work into my hands :D

 

Anyway, time for another hotfix release!

 

Mirror (0.8.3): http://en.file-upload.net/download-10255544/txdgen_0.8.3.zip.html

 

I recommend that anyone who has converted textures using prior versions lets this tool "fix" them by passing them through it. ;)

 

I tested this tool by compressing the GTA3 textures to DXT. In return I got faster loading times.

 

Time to sleep now :lol:

Edited by The_GTA
  • Like 2

 

i did compressed all txd in gta3.img and rebuilt after but the game stuck at loading screen what's wrong.

It turns out that I forgot to update the Direct3D texture native struct header, so that the game probably rejected the TXD archives (for a good reason). Then I forgot to add IMG archive version 1 creation support. Also, there was another crash when building IMG archives, due to me restructuring that code in 0.8.1. You guys really know how to put work into my hands :D

 

Anyway, time for another hotfix release!

 

Mirror (0.8.3): http://en.file-upload.net/download-10255544/txdgen_0.8.3.zip.html

 

I recommend that anyone who has converted textures using prior versions lets this tool "fix" them by passing them through it. ;)

 

I tested this tool by compressing the GTA3 textures to DXT. In return I got faster loading times.

 

Time to sleep now :lol:

 

thanks for the quick fix now it workin well

 

bug- dodo's rotor has no texture converting gta3 ps2 txd to pc

Edited by 4NT1R3KL4M4
  • Like 2

thanks for the quick fix now it workin well

 

bug- dodo's rotor has no texture converting gta3 ps2 txd to pc

 

not a bug, the ps2 model just has the rotor mapped to the one in "dodoalpha64" instead of getting its own dedicated texture

 

also I LOVE THIS TOOL, I made a txd with dds2txd then converted it to vice city with no problemo, mip-maps and all

 

 

 

edit: just noticed that magic txd builder came out, praise the lords for the bountiful tools

Edited by Mr. Jago

I expect great things from you after posting this wonderful melody. :lol:

 

After a quick test I gotta say that Magic.TxdBuilder works quite well. I dunno whether I still need to make a TXD building toolchain, other than for competetive purposes kappa.png?w=545.

 

I recommend using DK22Pac's tool with TxdGen. When you have created your TXD files, you can easily convert them to another game by setting the "gameRoot" directory to the output directory of Magic.TxdBuilder. Then set the "outputRoot" folder to "txdout_vicecity_pc/" or something.

 

Happy modding! :panic:

  • Like 2

 

 

I expect great things from you after posting this wonderful melody. :lol: After a quick test I gotta say that Magic.TxdBuilder works quite well. I dunno whether I still need to make a TXD building toolchain, other than for competetive purposes kappa.png?w=545. I recommend using DK22Pac's tool with TxdGen. When you have created your TXD files, you can easily convert them to another game by setting the "gameRoot" directory to the output directory of Magic.TxdBuilder. Then set the "outputRoot" folder to "txdout_vicecity_pc/" or something. Happy modding! :panic:

 

That is the soul of modding. :cookie: (And Life)

Well...looks like DK always knows when to step on the scene, and make everyone happy.

Ideas are what drive this world, man. Only fools give them up early. Things have to surface at the right time, with the right attitude ;)

  • Like 2
  • 2 weeks later...

Hey, I didn't notice this thread till now. Cool work. This will sure be useful for librw. Why don't you come back on irc?

Hey, I didn't notice this thread till now. Cool work. This will sure be useful for librw. Why don't you come back on irc?

Yo :)

 

Now that I have version 0.9 out, I feel like I have a major milestone set. After a quick unshaking I will come over :D

 

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

 

Version 0.9 has just released! With it come two new tutorials that demonstrate the potential of TxdGen!

 

(HQ download)

(HQ download)

 

Step up your game, brothers. San Andreas is much more enjoyable with mipmaps. :cookie::cookie::cookie:

 

Anyone who previously experienced problems with San Andreas textures with this tool: they are no more! I made important bug fixes after heavy testing sessions which have paid off. There of course are limitations of the engine that you still have to keep in mind tho. ;)

 

New in this version is fixed XBOX swizzling! I am no longer using the deprecated swizzling code. This means that you can convert all of XBOX GTA3 textures to PC. I am pretty sure that TxdGen supports all of the official Rockstar Games TXD files now. If you find any which do not work, please report to me in this thread.

 

Happy modding!

 

NOTE to people converting XBOX textures:

Please do not use TXD Workshop for viewing the TXD archives after you have converted them to PC. TXD Workshop is seriously outdated and does not understand DXT4 not DXT5 compression. The community needs a new tool.

 

If you just want to take a look at the output textures, download Sage Thumbs and set the "outputDebug" property in "txdgen.ini" to true.

Edited by The_GTA

This is the most easy to use tool since txd workshop, a few questions

 

 

Textures with alpha channels should be DXT5, right? What about textures without alpha channel?

This tool automatically sets the right level of compression to the textures?

Edited by format c:

This is the most easy to use tool since txd workshop, a few questions

 

 

Textures with alpha channels should be DXT5, right? What about textures without alpha channel?

This tool automatically sets the right level of compression to the textures?

Yea, it does. DXT2-5 add nothing quality-wise if there is no alpha. So they are always DXT1.

 

Currently it completely relies on the user to switch between DXT3 and DXT5. If "compressionQuality" is equal or greater than "1", then it always compresses using DXT5. Otherwise it goes for DXT3.

 

Isn't DXT5 better than DXT3 anyway? :^:

 

Thank you for the compliment, btw!

 

(working on 0.9.1 now... should clean up some things)

Edited by The_GTA

Should I deal with "texture has an invalid raster format"? Converting textures from SRT.

The textures are automatically fixed for you. The only moment you have to act is if instead of "OK", it says "error: (...)". :)

Any chance of a new txd workshop? I mean, a graphical interface and all...

Maybe! I am currently rewriting my RenderWare implementation. When things are matured out I can release a tool with a GUI, preferably written in Lua.

 

That tool would replace TXD Workshop.

 

 

Maybe I don't know how to read, but what do I have to do if I want to edit or replace a specific texture inside a txd?

TxdGen itself cannot currently insert textures, as it is not part of the featureset. The implementation is perfectly capable of doing it, though.

Edited by The_GTA
  • 2 weeks later...

I've used your tool, alpha textures end up completely messed.

This needs work, and why the hell would someone use PS2 as an output? PC is much better in many ways.

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

Edited by The_GTA
  • Like 3

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.