Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!   (85,209 visits to this link)

    2. News

    1. GTA Online

      1. Find Lobbies & Players
      2. Guides & Strategies
      3. Vehicles
      4. Content Creator
      5. Help & Support
    2. Crews

      1. Events
      2. Recruitment
    1. Grand Theft Auto Series

    2. GTA Next

    3. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    4. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    5. GTA Chinatown Wars

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    9. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    12. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption 2

    2. Red Dead Redemption

    3. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Forum Support

    2. Site Suggestions

The_GTA

[REL|OpenSrc] TxdGen, RW texture converter

Recommended Posts

El Dorado

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

Share this post


Link to post
Share on other sites
Concavax

 

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

Share this post


Link to post
Share on other sites
The_GTA

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

Share this post


Link to post
Share on other sites
Concavax

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

Share this post


Link to post
Share on other sites
The_GTA

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

Share this post


Link to post
Share on other sites
Concavax

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

Share this post


Link to post
Share on other sites
Dageron RUS

Huge thanks for the SA PS2 support :)

Share this post


Link to post
Share on other sites
Concavax

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?

Share this post


Link to post
Share on other sites
The_GTA

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

Share this post


Link to post
Share on other sites
Nanda_

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

Share this post


Link to post
Share on other sites
The Hero

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.

Share this post


Link to post
Share on other sites
The_GTA

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

Share this post


Link to post
Share on other sites
Voodooman

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

Share this post


Link to post
Share on other sites
Markuza

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?

Edited by Markuza97

Share this post


Link to post
Share on other sites
Silent

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

Share this post


Link to post
Share on other sites
The_GTA

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

Share this post


Link to post
Share on other sites
rollout

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:

Share this post


Link to post
Share on other sites
The_GTA

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

Share this post


Link to post
Share on other sites
Omicida

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.

Share this post


Link to post
Share on other sites
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. ;)

Share this post


Link to post
Share on other sites
Omicida

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.

Share this post


Link to post
Share on other sites
Nexment
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 ?

Share this post


Link to post
Share on other sites
The_GTA

 

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

Share this post


Link to post
Share on other sites
Jinx.

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.

Share this post


Link to post
Share on other sites
The_GTA

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

Share this post


Link to post
Share on other sites
Mrch0

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.

Share this post


Link to post
Share on other sites
The_GTA

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

Share this post


Link to post
Share on other sites
gts.

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.

Share this post


Link to post
Share on other sites
Reyks

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.

Share this post


Link to post
Share on other sites
The_GTA

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

Share this post


Link to post
Share on other sites

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

×

Important Information

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