ConverterPIX - Game formats to middle formats

Post any tutorial and tools you might find it useful for other creators.
User avatar
Takahashi
Posts: 13
Joined: 05 Jun 2015 14:50
Location: Japan

Re: ConverterPIX - Game formats to middle formats

#81 Post by Takahashi » 16 Mar 2017 18:13

... Wow... I spent my whole summer trying to convert my truck to the middle format, and I only got the interior fully done. With this tool, I seamlessly converted the interior and exterior in ten minutes... :cry: (even though the emoji looks sad, these are tears of happiness lol).

Thank you very much for this tool! :mrgreen: If this forum were to have a post-liking capability, I would like this thread too.

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

EDIT: I do have a question though. When I import my middle-format truck into Blender, I notice that there are no lamp materials. Is ConverterPIX supposed to convert the lamp materials, or no? I have my hookup and material.db in my base directory, and set in my Blender Tools.
ah, is it morning already?
[ external image ][ external image ]
Attempted update of Hino Profia from years ago. One could call it my first mod.
User avatar
mwl4
Posts: 86
Joined: 25 Dec 2012 16:06
Location: Poland
Contact:

Re: ConverterPIX - Game formats to middle formats

#82 Post by mwl4 » 22 Mar 2017 23:22

New version is available on https://github.com/mwl4/ConverterPIX

Changelog:
- Fixed loading bones (names doubling, empty names, parent on themselves)
- Improved errors/warnings/messages
San
Posts: 17
Joined: 14 Dec 2015 05:34

Re: ConverterPIX - Game formats to middle formats

#83 Post by San » 23 Mar 2017 17:46

Hi Mwl4! You can would you put the versions in convertpix (example: ConverterPix1.27.2)? Sorry bad inglish, God Bless!!!
User avatar
MandelSoft
Beta tester
Posts: 788
Joined: 23 Aug 2013 18:55
Location: Zoetermeer [NL]
Contact:

Re: ConverterPIX - Game formats to middle formats

#84 Post by MandelSoft » 24 Mar 2017 17:54

Hey mwl!

I don't know if you are aware of it, but every time I convert a model with your tool, the values for the specular levels are not the same as in the material files. The values of the specular levels are always closer to 1 than the materials they are based upon. For instance, a material with specular levels [1.6 1.6 1.6] has after conversion only a specular level of [1.24 1.24 1.24]. This works the other way around to (lower values end up higher). It seems that we're dealing with a non-linear effect. All other material values are copied appropriately however...

Could you investigate what goes wrong here?
╔═══╗────╔═╗╔═╗────╔╗
║╔═╗║────║║╚╝║║────║║
║╚═╝╠═╦══╣╔╗╔╗╠══╦═╝╠══╗
║╔══╣╔╣╔╗║║║║║║╔╗║╔╗║══╣
║║──║║║╚╝║║║║║║╚╝║╚╝╠══║
╚╝──╚╝╚══╩╝╚╝╚╩══╩══╩══╝
Don't ask us for a release date; we don't know either.
User avatar
50keda
SCS Software
Posts: 1699
Joined: 07 Dec 2012 11:59

Re: ConverterPIX - Game formats to middle formats

#85 Post by 50keda » 24 Mar 2017 18:05

and mind you, that MAT files are using linear color space where PIT files are using sRGB color space. And there is more! This only applies on values representing colors. For example "shininnes" and "add_ambient" attributes are not part of this.
User avatar
Smarty
Beta tester
Posts: 1983
Joined: 30 Jun 2015 01:56
Location: Ontario, Canada
Contact:

Re: ConverterPIX - Game formats to middle formats

#86 Post by Smarty » 24 Mar 2017 18:12

Yup. If you convert that back to binary format via SCSCT, the material values should come out correctly (± some amount of floating point conversion error). It confused me at first too. Still not as bad as how long it took me to realize that the UI colours are in ABGR. :lol:
User avatar
mwl4
Posts: 86
Joined: 25 Dec 2012 16:06
Location: Poland
Contact:

Re: ConverterPIX - Game formats to middle formats

#87 Post by mwl4 » 24 Mar 2017 19:37

As the predecessors wrote, converter converts linear color space to srgb for "ambient", "diffuse", "specular", "tint", "env_factor", (also there should be water aux converted, however I am not sure how exactly it should be).

Here are conversion functions:

Code: Select all

/**
 * @brief: Converts srgb to linear color space
 * 
 * @param[in] x The srgb value
 * @return @c The linear value
*/
static float s2lin(float x)
{
	const float a = 0.055f;
	return ((x <= 0.04045f) ? (x * (1.f / 12.92f)) : (pow((x + a) * (1.f / (1.f + a)), 2.4f)));
}

/**
 * @brief: Converts linear to srgb color space
 *
 * @param[in] x The linear value
 * @return @c The srgb value
*/
static float lin2s(float x)
{
	const float a = 0.055f;
	return ((x <= 0.0031308f) ? (x * 12.92f) : ((1.f + a) * pow(x, 1.f / 2.4f) - a));
}
if you want to convert values for some reason (it might be useful when you want to put some mat values into blender).
User avatar
Pendragon
Posts: 881
Joined: 14 Mar 2014 21:23
Location: Bulgaria

Re: ConverterPIX - Game formats to middle formats

#88 Post by Pendragon » 03 Apr 2017 06:42

Is there a log file somewhere?
[ external image ][ external image ] Sorry for my bad English
User avatar
mwl4
Posts: 86
Joined: 25 Dec 2012 16:06
Location: Poland
Contact:

Re: ConverterPIX - Game formats to middle formats

#89 Post by mwl4 » 03 Apr 2017 15:11

Not in the current version. Program print results on stdout. You can redirect it:
converter_pix -b "C:\example_base" -m "/model/example" >log.txt
User avatar
Pendragon
Posts: 881
Joined: 14 Mar 2014 21:23
Location: Bulgaria

Re: ConverterPIX - Game formats to middle formats

#90 Post by Pendragon » 03 Apr 2017 20:41

Thanks!
[ external image ][ external image ] Sorry for my bad English
Post Reply

Return to “User Tutorials & Tools”

Who is online

Users browsing this forum: No registered users and 1 guest