You are here

[Tool] GibbedTools - TDX Texture converter

Pages

Trent's picture
I was in the War!
Community VIPKickstarter BackerCompetition Winner
Posts: 2951
[Tool] GibbedTools - TDX Texture converter
#1 Submitted: Tue, 08/04/2014 - 14:07

GibbedTools

This is a modified version of the GibbedTools package created by the Magic The Gathering modding community, I added support for Carmageddon: Reincarnation textures and normal maps.

Download it here: http://trent.incarnated.co.uk/downloads/GibbedTools.zip

Instructions

Installation
Extract the RAR file to a folder somewhere, it doesn't matter where.

Decompiling TDX files
Drag the TDX file onto Gibbed.Duels.TdxConvert.exe and it will automagically make a PNG image of the same name. When you open the PNG it will probably be mostly transparent, this is because the transparency controls how reflective the surface is. In Photoshop you can use Layer->Layer Mask->From Transparency to create an alpha channel from the image's opacity, you can then fill the alpha channel with white to make it opaque. However, it is a good idea to copy the contents of the alpha channel into a new layer so you can put it back into the alpha channel after you've finished editing the texture.

Compiling Textures to TDX files
Most textures can be compiled by dragging the PNG file over CompressDXT5.bat, which will create a TDX file of the same name using DXT5 compression.

However if you're compiling a Normal Map you must use CompressNormals.bat instead as Normal Maps require their own compression algorithm.

Source Code

The source code for the GibbedTools is provided, you can open the Gibbed.Duels.TdxConvert.sln in Visual Studio (you can use VS Express) and edit it to your heart's content. It is written in C# so it's fairly easy to understand. You can probably tell which bits of code are mine by how bad they are (e.g. everything in BC5Unorm.cs)

Edited by: Trent on 22/05/2014 - 13:56

Deamon's picture
Cunning Stunt Licker
Kickstarter Backer
Posts: 306
Submitted: Sat, 19/04/2014 - 01:19

Thanks for the tool! Found some cool images in the tdx files, and some interesting unused stuff too :)

Carmageddon UNlimited Team For all your wrecking needs!
"All prey keep left. Fellow raptors keep up."
TDR2000 MAX-Pack A community add-on pack.

HEX1GON's picture
Cunning Stunt Licker
Posts: 261
Submitted: Fri, 16/05/2014 - 11:58

When converting an iOS TDX it causes it to crash :(

Trent's picture
I was in the War!
Community VIPKickstarter BackerCompetition Winner
Posts: 2951
Submitted: Fri, 16/05/2014 - 12:25

HEX1GON wrote:
When converting an iOS TDX it causes it to crash :(

Yeah iOS uses a completely different compression method. I've tried to implement support for it but haven't managed to get it working. I ended up just using Noesis for batch exporting iOS TDX files. Grab it from here: http://oasis.xentax.com/index.php?content=downloads

HEX1GON's picture
Cunning Stunt Licker
Posts: 261
Submitted: Fri, 16/05/2014 - 15:14

Perfect! Thanks. Now if only the wheel positioning wasn't such a pain in the ass. :P

Glumok's picture
Fluffy Bunny
Posts: 39
Submitted: Thu, 22/05/2014 - 13:45

EDIT: I've seen your post here, could it be related?
.

Hey Trent, it seems there is something wrong with the converter, with generated .png with Photoshop. My modified texture is always fucked up, so I did some tests, to see where the problem comes from. I tested with both vanilla texture by Stainless and modified texture by me.

My 3 tests :
- vanilla texture, NOT opened in Photoshop:
converted .tdx to .png with "Gibbed.Duels.TdxConvert.exe", then directly reconverted to .tdx with "CompressDXT5.bat" and the result is ok (texture is not fucked up in game).

- vanilla texture opened in Photoshop, saved as .png:
converted .tdx to .png, openend .png into Photoshop, directly saved as .png and the result is not ok (see pic 1 below).

- vanilla texture opened in Photoshop, converted to .tif:
converted .tdx to .png, opened .png into Photoshop, directly saved as .tif and the result is not ok (see pic 2 below).

So, in conclusion, I guess it has something to do with how Photoshop export .png (with or without compression). Any idea about how "CompressDXT5.bat" could deal with generated .png file with Photoshop?

PIC 1 - TDX > PNG (photoshop) > TDX:

PIC 2 - TDX > PNG > TIF (photoshop) > TDX:

Edited by: Glumok on Thu, 22/05/2014 - 13:50

Trent's picture
I was in the War!
Community VIPKickstarter BackerCompetition Winner
Posts: 2951
Submitted: Thu, 22/05/2014 - 13:55

Try using the updated version: http://trent.incarnated.co.uk/downloads/GibbedTools.zip

I have literally no idea why it's doing that as I've extracted, edited and recompiled numerous textures without a single problem. The TIF isn't working because TIF is not a supported format. Can you post the actual texture? Original, edited and converted back from TDX after you ran it through CompressDXT5.bat?

Glumok's picture
Fluffy Bunny
Posts: 39
Submitted: Thu, 22/05/2014 - 14:12

Well, I did test with .tif because it keeps transparency too and it seems to be converted with DXT5 compression (the texture is about the whole car, not only the interior).

I give a try to the new version of your tool and will post my result here! :)

EDIT: you can't drag and drop the .png onto "CompressDXT5.bat" with the new version? It used to work before.
I edited the "CompressDXT5.bat" by replacing "%~dp0\Gibbed.Duels.TdxConvert.exe --d5 "%1"" with the old "Gibbed.Duels.TdxConvert.exe --d5 %1" and drag and drop works again, I get a .dxt output, but "CompressDXT5.bat" doesn't quit...

Edited by: Glumok on Thu, 22/05/2014 - 14:25

Trent's picture
I was in the War!
Community VIPKickstarter BackerCompetition Winner
Posts: 2951
Submitted: Thu, 22/05/2014 - 14:28

Glumok wrote:
Well, I did test with .tif because it keeps transparency too and it seems to be converted with DXT5 compression (the texture is about the whole car, not only the interior).

I give a try to the new version of your tool and will post my result here! :)

EDIT: you can't drag and drop the .png onto "CompressDXT5.bat" with the new version? It used to work before.

PNGs keep their transparency too. The car's body work material uses that transparency for shininess and reflectivity though, not actual transparency.

You should have no problems dragging a png onto the CompressDXT5.bat in this version either. I have just uploaded another version as it seems I left in a debug line which held the window open until you press a button so I'd advise grabbing it again.

Edit: Yes the difference in the BAT file is to allow it to compress the files to the folder their in instead of to the GibbedTools folder.

Edited by: Trent on Thu, 22/05/2014 - 14:29

HEX1GON's picture
Cunning Stunt Licker
Posts: 261
Submitted: Thu, 22/05/2014 - 14:31

I have no issues either and I've even made a skin recently which still keeps transparency.

Make a shortcut and add this to the end
--d5 FILENAME.png

I tried making a bat but it just wouldn't work, probably lack of cmdline skills but I haven't had issues ever with this method.

Glumok's picture
Fluffy Bunny
Posts: 39
Submitted: Thu, 22/05/2014 - 14:32

Yes I was already aware about transparency with .png and the effect of it in game. ;)
Is the latest latest version here http://trent.incarnated.co.uk/downloads/GibbedTools.rar ?

Pages