ConverterPIX - Game formats to middle formats

Post any tutorial and tools you might find it useful for other creators.
User avatar
Smarty
Beta tester
Posts: 2164
Joined: 30 Jun 2015 01:56
Location: Ontario, Canada
Contact:

Re: ConverterPIX - Game formats to middle formats

#11 Post by Smarty » 15 Aug 2016 19:41

I've noticed one bug/error so far:

Converted .tobjs for UI icons come out as follows:

Code: Select all

map 2d
     /material/ui/accessory/kenworth_w900/bumper_02.dds
addr
     clamp_to_edge
     clamp_to_edge
nomips
usage tsnormal
They should come out like this:

Code: Select all

map	2d	bumper02.tga
addr	clamp_to_edge	clamp_to_edge
nomips
nocompress
color_space linear
The key difference is that the converter is confusing the 'nocompress' and 'color_space linear' flags with the 'tsnormal' flag somehow.
Image

User avatar
mwl4
Posts: 104
Joined: 25 Dec 2012 16:06
Location: Poland
Contact:

Re: ConverterPIX - Game formats to middle formats

#12 Post by mwl4 » 15 Aug 2016 20:34

I haven't got confirmed tobj structures, so there can be mismatches. I will look in it, perhaps I will fix that.

EDIT:
I investigated some, and these tobjs:

Code: Select all

map   2d   concrete_over_01.dds
addr   clamp_to_edge   clamp_to_edge
nomips
color_space linear

Code: Select all

map   2d   concrete_over_01.dds
addr   clamp_to_edge   clamp_to_edge
nomips
usage tsnormal
after convert by scs soft tool are same. So there is no way to recognize what there should be in text file.
Perhaps some SCS dev can explain me, how should I read them?
Last edited by ohaha on 15 Aug 2016 20:58, edited 1 time in total.
Reason: Quote removed - don't quote preceding message. don't quote entire message.

User avatar
Smarty
Beta tester
Posts: 2164
Joined: 30 Jun 2015 01:56
Location: Ontario, Canada
Contact:

Re: ConverterPIX - Game formats to middle formats

#13 Post by Smarty » 15 Aug 2016 22:46

Interesting. Now that I think about it, these flags may have more to do with Conversion Tools and how it selects the format when converting the associated Targa image to .dds. If I'm not mistaken, the nocompress flag would output an 8.8.8 (RGB) or 8.8.8.8 (ARGB), whereas the usage tsnormal would output DXT5_NM (XY) or, in combination with nocompress, 8.8 (XY). To reconstruct the flags accurately, you could interpret the resource format of the dds for each tobj, as well as its usage in the material.

It would be extraordinarily unlikely that 8.8.8.8 or 8.8.8 — and relatively unlikely that nomips — would be used for tsnormal. It's likewise unlikely for 8.8 to be anything other than tsnormal + nocompress or to find any tsnormal resources in \\material\ui\. Hopefully this helps to build a case structure.

Of course, I don't think these flags are necessary for resources that won't be converted. They would be helpful for anyone who intends to replace or copy such resources if they are to be processed by the conversion tools. I'm not sure how much we can expect modders to understand how all of these files interact through the conversion process.
Image

User avatar
mwl4
Posts: 104
Joined: 25 Dec 2012 16:06
Location: Poland
Contact:

Re: ConverterPIX - Game formats to middle formats

#14 Post by mwl4 » 16 Aug 2016 00:23

I was thinking about it, and I got the same point. You must be right, because DDS files in base have different formats. What I will do is just loading dds header and read format + mipmaps existence + other stuff, and from it I will restore tobj.

User avatar
50keda
SCS Software
Posts: 2708
Joined: 07 Dec 2012 11:59

Re: ConverterPIX - Game formats to middle formats

#15 Post by 50keda » 16 Aug 2016 05:24

Just a tip here: tobjs for UI should look like:

Code: Select all

map 2d texture_name.dds
addr clamp_to_edge clamp_to_edge
usage ui
nomips + colors_space linear + nocompress = usage ui ;)

User avatar
Smarty
Beta tester
Posts: 2164
Joined: 30 Jun 2015 01:56
Location: Ontario, Canada
Contact:

Re: ConverterPIX - Game formats to middle formats

#16 Post by Smarty » 16 Aug 2016 05:30

Touché. I'll have to find something to do with all the typing time that saves. :?
Image

User avatar
davidzoli
Posts: 3228
Joined: 22 Jun 2014 10:08
Location: Budapest, Hungary
Contact:

Re: ConverterPIX - Game formats to middle formats

#17 Post by davidzoli » 16 Aug 2016 10:34

This. Is. Awesome.
Thank you for this! Is there any donation link? :D
Image

User avatar
mwl4
Posts: 104
Joined: 25 Dec 2012 16:06
Location: Poland
Contact:

Re: ConverterPIX - Game formats to middle formats

#18 Post by mwl4 » 16 Aug 2016 10:59

^ donation link added in first post.

User avatar
davidzoli
Posts: 3228
Joined: 22 Jun 2014 10:08
Location: Budapest, Hungary
Contact:

Re: ConverterPIX - Game formats to middle formats

#19 Post by davidzoli » 16 Aug 2016 11:44

Thanks! :D

For the UI... I hope Cadde will be interested in this project :)

I've tested it on New Actros interior anim: PERFECT.
Tool of the year!
Image

User avatar
mwl4
Posts: 104
Joined: 25 Dec 2012 16:06
Location: Poland
Contact:

Re: ConverterPIX - Game formats to middle formats

#20 Post by mwl4 » 16 Aug 2016 20:47

New version is available on https://github.com/mwl4/ConverterPIX
- tobj conversion fixed
- added dds debug print (-d param)

What could be useful in understanding how converter recognizes tsnormal & ui usage:

Code: Select all

default:
 - tga (32 bits) -> DXT5
 - tga (24 bits) -> DXT1

usage tsnormal:
 - tga -> ATI2
 - png (nocompress) -> R16G16    # png is required

nomips:
 - tga -> DXT5/DXT1

color_space linear:
 - tga -> DXT5/DXT1

nocompress:
 - tga (32 bits) -> A8R8G8B8
 - tga (24 bits) -> R8G8B8

usage ui    # (nomips + color_space linear + nocompress)
 - tga (32 bits) -> A8R8G8B8
 - tga (24 bits) -> R8G8B8

Post Reply

Return to “User Tutorials & Tools”

Who is online

Users browsing this forum: No registered users and 1 guest