Quantcast

Jump to content

» «
Photo

[III|VC|SA|REL]DDS2TXD & WTD2TXD

49 replies to this topic
_DK
  • _DK

    gta3 cleo

  • Members
  • Joined: 12 Apr 2009
  • None

#1

Posted 03 May 2013 - 09:11 AM Edited by _DK, 29 April 2014 - 01:42 PM.

DDS > TXD
Supported games: GTA SA

This .asi plugin generates .txd files from .dds images separated with folders.
The advantage of this using is that you can setup image properties, mipmap levels and compression type directly in image editor (DDS plugin for PS).
Notice it's not an application tool, that's a plugin for a game. This means, you need to launch-exit game and then you'll see the result.
So use this if you really know that you really need this smile.gif
  • Now I'll explain how its working.
    First - you need to create a folder named 'txd' in GTA SA root folder.
    Second - create folders inside the 'txd' folder if you want to build some txd archives separately.
    Third - inside these folders create folders with names for new .txd arhcives.
    Fourth - put .dds files inside these folders.
    For example:
    GTA SA
    --txd
    ----vehicles
    ------admiral
    --------body.dds
    --------wheel.dds
    --------glass.dds
    ------banshee
    --------body.dds
    --------wheel.dds
    ----general
    ------mytxd
    --------test.dds

    So, the code will generate admiral.txd, banshee.txd files inside 'vehicles' folder and mytxd.txd file in 'general' folder.
    Fifth - open/close your game.
  • If you want to work with .dds textures, there's NVIDIA DDS plugin for PS.
    While exporting an image, select the "DDS" format and then choose image compression/format type (For example DXT1 for image without alpha, DXT3/DXT5 for image with alpha. You can also try with other formats) and select an option for using prepared mipmaps/generated mipmaps.
  • You can open created .txd file with TXD Workshop, but don't click 'Save' then. You can't edit these archives with other tools anymore. If you want to edit it, you can just replace files inside your folders and re-generate archives with the plugin.
=DOWNLOAD=

WTD > TXD
Supported games: GTA 3, GTA VC, GTA SA

Last night I did some small tool, maybe someone will find it useful.
It's called WTD2TXD, actually, a converter of GTA IV and Max Payne 3 PC texture dictionaries into GTA SA PC txd's.

kqkq.png 9wwj.png
 
I need this! (click to download from mediafire : version 0.5 with 3/VC/SA support)
 
I didn't create a new thread for it because it is very similar to DDS2TXD tool.

Building
Put the .exe file into the folder with .wtd files and launch it. The code will scan all files in that folder and also files in internal folders. Created .txd files will have same names as .wtd files.

Log file
After building, the log file will be generated. It will show you which textures was renamed (due to texture name size limit in RenderWare) and also skipped textures (if skipping options are enabled).

Configurations
There's an .ini file where you can set up some parameters.

Target
Game version. GTA3, GTAVC or GTASA.

Filtering
Filtering is the process used to determine how the texture object selects and displays individual MIP levels.
FilterMode is a mode for textures without mip-mapping. Available values are


rwFILTERNAFILTERMODE
rwFILTERNEAREST
rwFILTERLINEAR
FilterMipMode is a mode for textures with mip-mapping. Available values are
rwFILTERNAFILTERMODE
rwFILTERMIPNEAREST
rwFILTERMIPLINEAR
rwFILTERLINEARMIPNEAREST
rwFILTERLINEARMIPLINEAR
From RWG docs,
a3vf.png
 
Anisotropy filtering
From wikipedia, anisotropic filteringis a method of enhancing the image quality of textures on surfaces of computer graphics that are at oblique viewing angles with respect to the camera where the projection of the texture.
It could improve view of mip-mapped textures.
j2ng.png

The value you need to set is a max level of AF. You can check the max value that is supported on your system with this CLEO script:
{$CLEO}
0000:
while true
    wait 0
    0AA7: call_function 0x748F20 num_params 0 pop 0 0@
    0B10: 0@ = 0@ AND 0xFF
    0AD1: show_formatted_text_highpriority "Max supported anisotropy: %d" time 100 0@
end
Also, if you will set graphics settings to 'high' in game options, all textures that has AF enabled will use the maximum AF level that is available with your system.
 
Texture addressing
Addressing modes define the process used to determine a particular texel color. These modes define how the indexing along the texture map's U and V axes behaves when the edge of the texture map is reached.
Available values are
rwTEXTUREADDRESSWRAP
rwTEXTUREADDRESSMIRROR
rwTEXTUREADDRESSCLAMP
rwTEXTUREADDRESSBORDER
From RWG docs, 
8aij.png
 
Skipping options
You can skip normal map, bump map, specular map textures if you convert wtd archive directly from GTA IV. See parameters in SKIPPING OPTIONS section.

TXD Workshop
TXD Workshop is very old tool and it has many issues. It can't recognize DXT5, A8R8G8B8 and X8R8G8B8 correctly. So don't panic if you see incorrect images there. Check your txd in-game, it must work.

OpenIV
I recommend to use OpenIV for creating .wtd files. You can generate mipmaps there for non-dds images and also set up pixels format manually.
  • Wesser, Mr. Jago and Johnny_D like this

elMarcoPL
  • elMarcoPL

    Tronco

  • Members
  • Joined: 14 Mar 2011

#2

Posted 03 May 2013 - 11:11 AM Edited by xXaerooff2Xx, 03 May 2013 - 11:28 AM.

Yeah! Really good job. Gonna test it soon.

#edit - It works, but crashes when there is a texture with really long strenth, as:
nj5_shrubthing_rubbish2nj5bushdead1a.dds (GTA IV's texture)

_DK
  • _DK

    gta3 cleo

  • Members
  • Joined: 12 Apr 2009
  • None

#3

Posted 03 May 2013 - 11:38 AM Edited by DK22Pac, 03 May 2013 - 11:57 AM.

Ok, give me few mins to fix this...
Edit: Updated.

direstraits
  • direstraits

  • Members
  • Joined: 08 Mar 2011
  • Portugal

#4

Posted 03 May 2013 - 06:15 PM

Works perfectly. icon14.gif

You should add suport for DXT5

_DK
  • _DK

    gta3 cleo

  • Members
  • Joined: 12 Apr 2009
  • None

#5

Posted 03 May 2013 - 09:32 PM Edited by DK22Pac, 18 May 2013 - 01:10 PM.

DXT5 is supported. But TXD Workshop doesn't recognize it.

Ηeath
  • Ηeath

    Just Do It.

  • Members
  • Joined: 08 Feb 2011

#6

Posted 18 May 2013 - 05:35 AM

I would love to try this, but your account seems to be suspended. tounge.gif Mind re-uploading it again? smile.gif

_DK
  • _DK

    gta3 cleo

  • Members
  • Joined: 12 Apr 2009
  • None

#7

Posted 18 May 2013 - 01:19 PM

Reuploaded.

damiann69
  • damiann69

    He he

  • Members
  • Joined: 01 Feb 2011
  • Poland

#8

Posted 30 June 2013 - 08:47 AM Edited by damiann69, 30 June 2013 - 02:24 PM.

Hi. Plugin works very well, but I tried DXT save formats and they caused crashes SA after installing txd file to img archieve.
I tried with other (X.8.8.8 for example) formats and game runs good, but mipmaps don't seem to work. Texture is still grainy. I edited textures on original player model. Maybe game doesn't support mipmaps on this model. I don't know. Any ideas?

_DK
  • _DK

    gta3 cleo

  • Members
  • Joined: 12 Apr 2009
  • None

#9

Posted 30 March 2014 - 03:52 AM Edited by _DK, 20 April 2014 - 11:58 AM.

Moved to first post.
  • Methical, fastman92, LINK/2012 and 4 others like this

_DK
  • _DK

    gta3 cleo

  • Members
  • Joined: 12 Apr 2009
  • None

#10

Posted 11 April 2014 - 12:26 AM Edited by _DK, 11 April 2014 - 12:27 AM.

WTD2TXD was updated to version 0.5

Changes list:

-Added GTA3 target support;

-Added GTAVC target support;

-Anisotropy could be used with GTAVC target.

 

MipMaps in GTA 3 ;)

 
  • Silent, TJGM, MasterHK and 1 other like this

TJGM
  • TJGM

    James May is the best May!

  • Feroci Racing
  • Joined: 14 Jun 2011
  • Ireland

#11

Posted 11 April 2014 - 02:23 AM Edited by TJGM, 20 April 2014 - 12:08 PM.

Awesome stuff DK! Managed to mipmap a lot of III HD with this, if anyone is interested in the files, let me know.
  • Mr. Jago likes this

riquenunes
  • riquenunes

    Soldier

  • Members
  • Joined: 28 Apr 2008
  • Brazil

#12

Posted 20 April 2014 - 04:39 AM Edited by riquenunes, 20 April 2014 - 04:50 AM.

Nice tool, DK!

 

I used it to replace every TXD file from GTA3.img with new versions of them containing textures with mip maps, as Rockstar seems to have forgotten to add them to some textures.

 

Before:

http://i.imgur.com/eYCrCvI.png

 

After:

http://i.imgur.com/OY1VORn.png

  • TJGM and Concavax like this

Concavax
  • Concavax

    Square Civilian

  • Members
  • Joined: 26 Dec 2013
  • None

#13

Posted 22 April 2014 - 01:50 AM

Nice tool, DK!

 

I used it to replace every TXD file from GTA3.img with new versions of them containing textures with mip maps, as Rockstar seems to have forgotten to add them to some textures.

 

Before:

http://i.imgur.com/eYCrCvI.png

 

After:

http://i.imgur.com/OY1VORn.png

How you do it????


riquenunes
  • riquenunes

    Soldier

  • Members
  • Joined: 28 Apr 2008
  • Brazil

#14

Posted 24 April 2014 - 01:02 AM Edited by riquenunes, 24 April 2014 - 01:27 AM.

 

Nice tool, DK!

 

I used it to replace every TXD file from GTA3.img with new versions of them containing textures with mip maps, as Rockstar seems to have forgotten to add them to some textures.

 

Before:

http://i.imgur.com/eYCrCvI.png

 

After:

http://i.imgur.com/OY1VORn.png

How you do it????

 

 

Well...

 

I extracted every TXD file from GTA3.img, then I created a little program to extract the textures from the TXDs using TXD workshop's command line interface. After that, the program would call a tool from Nvidia to convert the texture files from TGA to DDS, generate mipmaps and compress them to DXT5. With all the DDS files in hand, I just let DK22's tool do its work and generate the TXD files back for me.

 

I could provide all TXD files with mipmaps with people are interested, but keep in mind that you won't be able to edit them anymore as, as far as I know, there aren't any TXD editors that support DXT5 compression.

  • Lacrix84 and Concavax like this

TJGM
  • TJGM

    James May is the best May!

  • Feroci Racing
  • Joined: 14 Jun 2011
  • Ireland

#15

Posted 24 April 2014 - 10:36 PM Edited by TJGM, 24 April 2014 - 10:36 PM.

Any chance you could upload them? :)

Concavax
  • Concavax

    Square Civilian

  • Members
  • Joined: 26 Dec 2013
  • None

#16

Posted 26 April 2014 - 01:43 AM Edited by Concavax, 27 April 2014 - 02:54 PM.

 

 

Nice tool, DK!

 

I used it to replace every TXD file from GTA3.img with new versions of them containing textures with mip maps, as Rockstar seems to have forgotten to add them to some textures.

 

Before:

http://i.imgur.com/eYCrCvI.png

 

After:

http://i.imgur.com/OY1VORn.png

How you do it????

 

 

Well...

 

I extracted every TXD file from GTA3.img, then I created a little program to extract the textures from the TXDs using TXD workshop's command line interface. After that, the program would call a tool from Nvidia to convert the texture files from TGA to DDS, generate mipmaps and compress them to DXT5. With all the DDS files in hand, I just let DK22's tool do its work and generate the TXD files back for me.

 

I could provide all TXD files with mipmaps with people are interested, but keep in mind that you won't be able to edit them anymore as, as far as I know, there aren't any TXD editors that support DXT5 compression.

 

Sure! Upload! Please. :), you make a litle program? Is a batch file?

I really like it :D

 

If try this metod.

http://gtaforums.com...-dxt5-textures/

 

I guess


riquenunes
  • riquenunes

    Soldier

  • Members
  • Joined: 28 Apr 2008
  • Brazil

#17

Posted 29 April 2014 - 12:54 AM

I manage to compress it to 193 MB, but even so it's gonna take a long time to upload at these speeds:

 

http://www.speedtest...sult/3468562834

 

Hurray, Brazil!

 

I'll try to upload from work tomorrow, or something.

  • Concavax likes this

Methical
  • Methical

    Gramps

  • Members
  • Joined: 23 May 2008
  • New-Zealand

#18

Posted 29 April 2014 - 05:57 AM

Wouldn't it be easier to upload your tool then? And, I guess the tool only works for Nvidia users?


Lacrix84
  • Lacrix84

    Sorry for my English

  • Members
  • Joined: 15 Apr 2013
  • Ukraine

#19

Posted 30 April 2014 - 10:06 PM

 

 

Nice tool, DK!

 

I used it to replace every TXD file from GTA3.img with new versions of them containing textures with mip maps, as Rockstar seems to have forgotten to add them to some textures.

 

Before:

http://i.imgur.com/eYCrCvI.png

 

After:

http://i.imgur.com/OY1VORn.png

How you do it????

 

 

Well...

 

I extracted every TXD file from GTA3.img, then I created a little program to extract the textures from the TXDs using TXD workshop's command line interface. After that, the program would call a tool from Nvidia to convert the texture files from TGA to DDS, generate mipmaps and compress them to DXT5. With all the DDS files in hand, I just let DK22's tool do its work and generate the TXD files back for me.

 

I could provide all TXD files with mipmaps with people are interested, but keep in mind that you won't be able to edit them anymore as, as far as I know, there aren't any TXD editors that support DXT5 compression.

 

 

Maybe you will share your little program with other people? I (and a lot of people too, I guess) have a lot of different texture mods in III and would like to make mipmaps for every texture.

  • Concavax likes this

riquenunes
  • riquenunes

    Soldier

  • Members
  • Joined: 28 Apr 2008
  • Brazil

#20

Posted 01 May 2014 - 03:23 AM Edited by riquenunes, 01 May 2014 - 04:32 PM.

Here it goes:

 

https://dl.dropboxus...784/TXD2DDS.zip

 

Just extract the contents from the zip file, put the TXD files you want to convert the textures from inside "extraction" folder, run TXD2DDS.exe and wait until it's finished. There will be some folders with the same names as the TXD files with all of their textures inside in DDS format, with mipmaps and compressed to DXT5.

 

It requires dot net framework 2.0 to work, if you use Vista or a newer Windows version it's already installed, I think. If you, for some shady reason, still use XP, you might want to check that out first.

 

It's very important that you force anisotropic filtering in your SA by using AMD/Nvidia control panel, or ENB series, otherwise you'll have the black roads bug everywhere. I'm not sure if it's needed for VC or III, I haven't tested with those.

 

@methodunderg: I don't think so. The tool itself just generate the DDS files, there's no reason for them not work on AMD cards.

  • Alt, Speccy, Methical and 5 others like this

Lacrix84
  • Lacrix84

    Sorry for my English

  • Members
  • Joined: 15 Apr 2013
  • Ukraine

#21

Posted 01 May 2014 - 11:52 AM Edited by Lacrix84, 01 May 2014 - 02:24 PM.

@riquenunes. Thanks. Very useful tool. Too bad that it won't work for creating GTA III mipmap textures.


riquenunes
  • riquenunes

    Soldier

  • Members
  • Joined: 28 Apr 2008
  • Brazil

#22

Posted 01 May 2014 - 04:30 PM

Why not? What happens?


Lacrix84
  • Lacrix84

    Sorry for my English

  • Members
  • Joined: 15 Apr 2013
  • Ukraine

#23

Posted 01 May 2014 - 06:27 PM Edited by Lacrix84, 01 May 2014 - 06:28 PM.

When I've replased original generic.txd file with new, the game started normally, but all the textures was white. Look at the picture http://www.picturesh...ges/76019_1.jpg

Anisotropic filtering was forced to 16x in Nvidia control panel.

Maybe it's because DDS-TXD is for SA only. 


TJGM
  • TJGM

    James May is the best May!

  • Feroci Racing
  • Joined: 14 Jun 2011
  • Ireland

#24

Posted 01 May 2014 - 06:30 PM Edited by TJGM, 01 May 2014 - 06:30 PM.

When I've replased original generic.txd file with new, the game started normally, but all the textures was white. Look at the picture http://www.picturesh...ges/76019_1.jpg

Anisotropic filtering was forced to 16x in Nvidia control panel.

Maybe it's because DDS-TXD is for SA only. 

DDS2TXD is for SA only, so you're basically using a broken .txd. Just mipmap your textures in generic.txd with WTD2TXD, its pretty simple.


Lacrix84
  • Lacrix84

    Sorry for my English

  • Members
  • Joined: 15 Apr 2013
  • Ukraine

#25

Posted 01 May 2014 - 06:43 PM

Actually, not pretty simple 'cause I can't install OpenIV (the installanion closed automaticly after downloading required fires from internet, then windows asks was the program installed correctly - even if I answer no and reinstall it nothing changing). That's why I can create DDS files with mipmaps using Riquenunes program, but can't create new WTD file with this new images. So there is nothing to convert with WTD2TXD program. But even if it was possible, it's too much time needed to convert all the textures in III. I only hope that DK will add support for III in his plugin (or create new for III). After that all the work can be done automaticly and pretty fast.

Methical
  • Methical

    Gramps

  • Members
  • Joined: 23 May 2008
  • New-Zealand

#26

Posted 02 May 2014 - 12:53 AM Edited by methodunderg, 02 May 2014 - 01:15 PM.

Here it goes:
 
https://dl.dropboxus...784/TXD2DDS.zip


Will give this a test later on Project RoSa.
I created my own .bat script which automated the mipmapping through G-TXD.
But since G-TXD is buggy, its of no use to anyone.

 

@EDIT

Just been testing your tool on Project RoSa (all parts)

Every time your tool calls upon TXD Workshop to extract the textures from the .txd, this splash screen pops up for a split second (was hard to capture)

 

http://gyazo.com/077...b2ca9ff0716eb14

 

But it appears TXD Workshop is doing its job though, as it extracts the textures to TGA, and they are then converted by the nvidia plugin to dds.

 

http://gyazo.com/a57...bc341d76e2c1b02

 

So far so good. Took about an hour and a half to do Project RoSa 1.2 (Los Santos).

 

Still trying to work out DK's tools to remake the TXD's. I'm following instructions, and then starting my game; nothing seems to happen. No log, no nothing.

I will talk to DK when he is online next.

 

@EDIT2

It seemed something was conflicting with the plugin with my modded installation.

Worked fine on a clean installation. If I find the culprit, then I'll let you know.

 

Thanks DK22 and riquenunes


Concavax
  • Concavax

    Square Civilian

  • Members
  • Joined: 26 Dec 2013
  • None

#27

Posted 02 May 2014 - 07:00 PM Edited by Concavax, 03 May 2014 - 12:12 AM.

Here it goes:

 

https://dl.dropboxus...784/TXD2DDS.zip

 

Just extract the contents from the zip file, put the TXD files you want to convert the textures from inside "extraction" folder, run TXD2DDS.exe and wait until it's finished. There will be some folders with the same names as the TXD files with all of their textures inside in DDS format, with mipmaps and compressed to DXT5.

 

It requires dot net framework 2.0 to work, if you use Vista or a newer Windows version it's already installed, I think. If you, for some shady reason, still use XP, you might want to check that out first.

 

It's very important that you force anisotropic filtering in your SA by using AMD/Nvidia control panel, or ENB series, otherwise you'll have the black roads bug everywhere. I'm not sure if it's needed for VC or III, I haven't tested with those.

 

@methodunderg: I don't think so. The tool itself just generate the DDS files, there's no reason for them not work on AMD cards.

Thanks man, really i apreciate your work. I try this metod,I hope it works out.

 

PD: I need photoshop?

 

Edit. Of course no.

 

Edit: This pluguin didnt work DDS2TXD, start the game and create the log. Only show: Scanning "Name of carpet".

And not work. 

 

I try in a clean game.

Whats wrong?


Lacrix84
  • Lacrix84

    Sorry for my English

  • Members
  • Joined: 15 Apr 2013
  • Ukraine

#28

Posted 03 May 2014 - 06:24 AM

Concavax, try to create one more folder in "txd". For example - folder "txd" in SA root, folder "asdf" inside folder "txd", folder "carpet" inside folder "asdf", and put your dds in folder "carpet". Then launch the game.

  • Concavax likes this

Concavax
  • Concavax

    Square Civilian

  • Members
  • Joined: 26 Dec 2013
  • None

#29

Posted 04 May 2014 - 12:40 AM Edited by Concavax, 04 May 2014 - 08:02 PM.

I try, but didnt work, its so frustated!

 

Edit:

Sorry, for last post. This time work!!!! Is f*cking awesome! Thanks a lot!!!! :D

 

How fix this?

 

10259736_675614679154629_371005172277668

 

10175951_675614372487993_288695601541111

-Minimum Draw Distance

-Low efects

 

I know this "bug" fix it when you select efects: Very High, but i want to play in low setting and i see normal the game.

 

10171918_675613385821425_178014636022070


riquenunes
  • riquenunes

    Soldier

  • Members
  • Joined: 28 Apr 2008
  • Brazil

#30

Posted 05 May 2014 - 03:31 AM

Don't forget the anisotropic filtering part. Also, Memory Stream Fix may be needed depending on the size of the new files. I know I needed it.

  • Concavax likes this




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users