Jump to content


Photo

tga2tpc

TGA TPC texture Tool tool

  • Please log in to reply
5 replies to this topic

#1 ndix UR

ndix UR

    Jedi Padawan

  • Members
  • PipPipPip
  • 72 posts
  • Locationca, usa

Posted 08 October 2017 - 11:32 PM

http://deadlystream.com/forum/index.php?app=downloads&module=display&section=screenshot&id=1152

 

File Name: tga2tpc

File Submitter: ndix UR

File Submitted: 08 Oct 2017

File Category: Modding Tools

 

tga2tpc

============================================================

Author: ndix UR
Release: October 2017
Version: 1.2.0


============================================================

Convert TGA images to TPC format for use in KotOR and TSL.

TPC files contain the information from a TXI file (so the TXI file is no longer needed when a TPC file is used), and can be uncompressed or compressed with either DXT1 or DXT5.

Advanced features like animation and cubemap layering are initiated by the presence of specific TXI directives like cube 1 and proceduretype cycle.

For some reason, the game really wants normal maps to be in TPC format. This will let you create and use full color normal maps without having to make them into simple height maps.

The tool is free, open source, and cross-platform. Code is available at https://github.com/ndixUR/tga2tpc

The app is written in javascript, built on Electron using three.js, jquery, bootstrap.

============================================================

How do I set it up?
Windows: unzip the package, run tga2tpc.exe

Mac: unzip the package, move tga2tpc.app to /Applications, run it
* This is not a signed application, so you have to do whatever is required to run non-MAS applications on your MacOS version.

How do I use it?
Drag files in and hit start. There shouldn't be much more to it than that. Using square and/or power of 2 sized textures is a good idea (sometimes required), TXI information is optional, and the settings are pretty much self-explanatory.

============================================================

Features

  • Create cubemaps
  • Create animated textures
  • DXT1/5 Compression available (requires 2^n texture size)
  • Horizontal/Vertical flip, for those pesky wrongly oriented TGA files
  • Bicubic downsampling for mipmaps (precomputed small versions of the texture, part of the TPC format)

Known Issues
  • Cannot create uncompressed animated textures.
  • Only for converting from TGA to TPC. For TPC to TGA, use Kotor Tool or xoreos-tools.
  • Progress bar doesn't update as often as you might want.
  • Bicubic downsample is slow. I recommend only using it for final conversions, not testing.
  • The package size is large. This is the cost of easy cross-platform GUI support. All electron applications are large like this.

============================================================

Thanks
DarthParametric for inciting the creation of this tool, and doing the testing.
DrMcCoy and all the contributors to xoreos, whose TPC decoding implementation provided the basis for the TPC library herein.
bead-v for moral support.

 

Click here to download this file



#2 Malkior

Malkior

    Jedi Master

  • Members
  • PipPipPipPipPip
  • 1,098 posts

Posted 09 October 2017 - 02:15 AM

These recent tools are amazing!

In one motion you apparently made TXI files obsolete and Photoshop unecessary for animations. I am looking forward to trying these out.
____________________________
|_______________________>>___\
....But I digress....
__________________________
|____________>>_______>>__/

#3 ndix UR

ndix UR

    Jedi Padawan

  • Members
  • PipPipPip
  • 72 posts
  • Locationca, usa

Posted 09 October 2017 - 03:20 AM

This is why good things happen when Tools 'leave the nest' and go into the world.

 

Actually, in this version, the app expects a big multi-frame TGA image like the kind we normally make for animated textures. I could (somewhat) easily make it handle an input set of images (one per frame) though, and that sounds like it could be an improvement for some workflows, so cheers!



#4 LiliArch

LiliArch

    Jedi Master

  • Members
  • PipPipPipPipPip
  • 418 posts

Posted 13 October 2017 - 11:21 AM

I've been wondering why there's no TGA to TPC converter, and this seems to be more than I was hoping for. Nice work.
BFix0.gif
Lady Arch, the Carrier of Northern Nights, the Harbinger of Iriaz and the Dark Lord of Orth.

#5 DarthParametric

DarthParametric

    Dark Lord of the Sith

  • Members
  • PipPipPipPipPip
  • 1,178 posts
  • LocationOz

Posted 06 December 2017 - 05:46 PM

There appears to be an issue when processing a series of textures one after the other. After the 3rd or 4th texture, the program shows a red "compression failed" message. It's not a problem with the texture, as after closing the program and restarting it, the texture is processed with no issue. I got the error twice whilst converting a batch of 14 textures.

#6 ndix UR

ndix UR

    Jedi Padawan

  • Members
  • PipPipPip
  • 72 posts
  • Locationca, usa

Posted 06 December 2017 - 06:52 PM

Interesting. I will look into it. I am assuming that these are all 4K textures? DXT1 or 5 (and does this change the behavior)?

 

EDIT: Reproduced the issue, I think I've got it sorted. Next release will be fixed. Turns out that it is good to free malloc'ed heap memory copied into (and out of) emscripten compiled libraries (if only someone had told the dxt-js author :)).







Also tagged with one or more of these keywords: TGA, TPC, texture, Tool, tool

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users