3d models skins

A Forum dedicated to the Suggestion, Creation and Editing of XWA Dynamic Link Library Files

Moderator: JeremyaFr

3d models skins

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Fri Dec 25, 2020 7:38 pm

UPDATE

Hello,
I've updated the 32bpp hook.

There is a new feature: Skins.
With skins, you can customize the appearence of the 3d models.

Suppose that the craft is "FlightModels\[Model].opt".
To create a skin named "[Skin1]", create a folder named "FlightModels\Skins\[Model]\[Skin1]\".
To replace a texture, place it in the skins folder with the same name and dimensions of the original texture.
The supported image formats are bmp, png, jpg. Use the png format to get transparency.
See "Skins\XWing\Default\Tex00033.png" for an example for the vanilla X-Wing.

Suppose that the mission is "[MissionDir]\[Mission].tie".
To define a skin for a craft, create a file named "[MissionDir]\[Mission]_Skins.txt" or create a section named "[Skins]" in "[MissionDir]\[Mission].ini".
The format is
CraftOptName = SkinNameA, SkinNameB
CraftOptName_fg_# = SkinName1, SkinName2, SkinName3
# in CraftOptName_fg_# is an integer for the opt color marking index, starting at 0.
The default SkinName is "Default".
See "Skins.txt"

User avatar
Vince T
Fleet Admiral (Administrator)
Posts: 14045
Joined: Fri Apr 27, 2001 11:01 pm
Contact:

Post by Vince T » Fri Dec 25, 2020 7:58 pm

This is a historic day! This new function revolutionizes the way we can create FG colors!

So far we were limited to the FG colors that the authors had baked into the OPTs. Not only did this limit creativity it also bloated up the filesize of the individual OPTs (*cough* VSD, ISD2 *cough*)
Now if you want a ship that is worn AND has certain markings you can just add both of these skins (if available) ontop and you're done :)

Great work Jeremy!
Your ship, Captain. I need a drink. - Vince Trageton
Vince T's X-Wing HQ - where the bad guys get their gear

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Fri Dec 25, 2020 8:24 pm

Thanks
and thank you Forceflow for having the idea.

User avatar
Forceflow
Fleet Admiral (Administrator)
Posts: 7198
Joined: Wed Oct 20, 1999 11:01 pm
Contact:

Post by Forceflow » Fri Dec 25, 2020 8:37 pm

JeremyaFr wrote:
Fri Dec 25, 2020 8:24 pm
Thanks
and thank you Forceflow for having the idea.
:D just really glad it was possible to do at all! Many thanks for getting it up and run into. Cannot wait what the guys will come up with using the new hook.
Murphy was an optimist! I am a pessimist!
And always remember that a smile is cheaper than a bullet! (District 9)
Webmaster of the X-Wing Alliance Upgrade Project

User avatar
Vince T
Fleet Admiral (Administrator)
Posts: 14045
Joined: Fri Apr 27, 2001 11:01 pm
Contact:

Post by Vince T » Sat Dec 26, 2020 12:54 pm

Here's a little peak of what this could mean...

A VSD with the New Republic AND the Damaged skin:
Skins0.jpg
Or something completely different....
Skins.jpg
You do not have the required permissions to view the files attached to this post.
Your ship, Captain. I need a drink. - Vince Trageton
Vince T's X-Wing HQ - where the bad guys get their gear

User avatar
Trevor
Lieutenant JG
Posts: 541
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Sun Dec 27, 2020 1:07 am

Oh wow, so does this mean that some of the FGs baked into eg the x-wing might be removed and replaced with skins leaving FGs to be just FG's (Primary colour groups - red blue etc rather than red 1, red 2, red 5 etc)?

Trev

User avatar
Vince T
Fleet Admiral (Administrator)
Posts: 14045
Joined: Fri Apr 27, 2001 11:01 pm
Contact:

Post by Vince T » Sun Dec 27, 2020 1:36 am

It sure is worth considering. It's the various HD FG colors which bloat up the OPTs in filesize. But we sure won't force-convert everything to skins all of a sudden, just because we can.

I think a good rule of thumb would be: If it had FG colors in vanilla, use default colors and add the rest as skins, if it had no FG colors in vanilla, go for skins right away.

I for my part am definitely going to implement this for the VSDs and ISDs, since those ships are extremely bloated up by those flightgroup colors. The bare VSD is around 17MB rather than the whapping 70MB it currently is.
Your ship, Captain. I need a drink. - Vince Trageton
Vince T's X-Wing HQ - where the bad guys get their gear

User avatar
Trevor
Lieutenant JG
Posts: 541
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Sun Dec 27, 2020 12:11 pm

@blue_max @JeremyaFr Will these skins support the materials?
Speaking of materials and rusty VSD's, do you have plans for a future specular map (mapping whats shiny and not by grey values?)

Trev

Bman
Lieutenant Commander
Posts: 1167
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Sun Dec 27, 2020 3:59 pm

Brilliant. Thank you Jeremy and Forceflow! Another great X-mas weekend gift. :-)
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.

User avatar
blue_max
XWAU Member
Posts: 2293
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Mon Dec 28, 2020 2:24 am

Trevor wrote:
Sun Dec 27, 2020 12:11 pm
@blue_max @JeremyaFr Will these skins support the materials?
I haven't really tested this yet, but the material system should work the same since it's based on the name of the texture being loaded. So, as long as the name is also replaced, the materials should keep working.

I have plans to add support for specular and normal maps in the future, but it's going to take a little longer ;)

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Mon Dec 28, 2020 4:48 pm

@blue_max
With the skins feature, "_fg_#" is added to the name of the texture, where # is the color index starting at 0.

User avatar
blue_max
XWAU Member
Posts: 2293
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Mon Dec 28, 2020 8:23 pm

JeremyaFr wrote:
Mon Dec 28, 2020 4:48 pm
@blue_max
With the skins feature, "_fg_#" is added to the name of the texture, where # is the color index starting at 0.
Oh, I see... In that case, new mat files with the corresponding "_fg_#" tokens would need to be added.

User avatar
ArrowLoop
Galactic Empire
Posts: 15
Joined: Thu Jun 04, 2020 7:46 pm
Contact:

Post by ArrowLoop » Tue Dec 29, 2020 6:47 pm

What would be the quickest and easiest way export an OPT's bundled textures to bmp, png, jpg in order to edit them and make your own skins for this hook?

User avatar
Forceflow
Fleet Admiral (Administrator)
Posts: 7198
Joined: Wed Oct 20, 1999 11:01 pm
Contact:

Post by Forceflow » Tue Dec 29, 2020 7:46 pm

ArrowLoop wrote:
Tue Dec 29, 2020 6:47 pm
What would be the quickest and easiest way export an OPT's bundled textures to bmp, png, jpg in order to edit them and make your own skins for this hook?
You can use XwaOptExplorer (bundled in the XwaToolsDownloader which can be found in the downloads section under Additional Files) XwaOptExplorer can export the opt into .obj .3dm and .an8 files. When doing so it will also export the respective textures of the model. That should be a good basis to make your own skins.
Murphy was an optimist! I am a pessimist!
And always remember that a smile is cheaper than a bullet! (District 9)
Webmaster of the X-Wing Alliance Upgrade Project

User avatar
Trevor
Lieutenant JG
Posts: 541
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Wed Dec 30, 2020 11:58 am

Vince T wrote:
Sun Dec 27, 2020 1:36 am
The bare VSD is around 17MB rather than the whapping 70MB it currently is.
Just a thought - Would there be any performance gain from going further and using "default" (64x64?) textures within the opt and then using the skin feature entirely for all FGs/Unique craft?

Would this allow (if XWA doesn't already) different texture sizes to be used for lesser machines?
eg, base folder is your highest res textures, then for n levels you scale down.
if a user chokes on hi-res, then can rename a folder (or babu can) to select a lower res folder

Trev

User avatar
Forceflow
Fleet Admiral (Administrator)
Posts: 7198
Joined: Wed Oct 20, 1999 11:01 pm
Contact:

Post by Forceflow » Wed Dec 30, 2020 12:41 pm

Trevor wrote:
Wed Dec 30, 2020 11:58 am
Vince T wrote:
Sun Dec 27, 2020 1:36 am
The bare VSD is around 17MB rather than the whapping 70MB it currently is.
Just a thought - Would there be any performance gain from going further and using "default" (64x64?) textures within the opt and then using the skin feature entirely for all FGs/Unique craft?

Would this allow (if XWA doesn't already) different texture sizes to be used for lesser machines?
eg, base folder is your highest res textures, then for n levels you scale down.
if a user chokes on hi-res, then can rename a folder (or babu can) to select a lower res folder

Trev
That's something that @JeremyaFr has to answer, but as far as I understand it the replacing texture must have the same size as the existing texture as it would otherwise mess up the UV mapping.
Murphy was an optimist! I am a pessimist!
And always remember that a smile is cheaper than a bullet! (District 9)
Webmaster of the X-Wing Alliance Upgrade Project

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Wed Dec 30, 2020 2:46 pm

Trevor wrote:
Wed Dec 30, 2020 11:58 am
Just a thought - Would there be any performance gain from going further and using "default" (64x64?) textures within the opt and then using the skin feature entirely for all FGs/Unique craft?
Would this allow (if XWA doesn't already) different texture sizes to be used for lesser machines?
Hello,
I don't think that reducing textures size will have a significant performance improvement. It has impact on the total memory consumption.

User avatar
Vince T
Fleet Admiral (Administrator)
Posts: 14045
Joined: Fri Apr 27, 2001 11:01 pm
Contact:

Post by Vince T » Wed Dec 30, 2020 5:18 pm

I've actually tested it at some point, if the replacement texture is larger than the original, you'll only see a part of it which maches the original's size.
Your ship, Captain. I need a drink. - Vince Trageton
Vince T's X-Wing HQ - where the bad guys get their gear

Prime
XWAU Member
Posts: 94
Joined: Sun Jul 16, 2006 11:01 pm

Post by Prime » Wed Dec 30, 2020 11:43 pm

This is an amazing new feature. Can't wait to play with it!

Bman
Lieutenant Commander
Posts: 1167
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Thu Dec 31, 2020 9:12 am

Does this new hook apply to textures for LOD meshes too ?
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.

User avatar
Vince T
Fleet Admiral (Administrator)
Posts: 14045
Joined: Fri Apr 27, 2001 11:01 pm
Contact:

Post by Vince T » Thu Dec 31, 2020 9:37 am

Likely, in the OPT format LOD Textures are treated as any other texture.
Your ship, Captain. I need a drink. - Vince Trageton
Vince T's X-Wing HQ - where the bad guys get their gear

CatMouthwash
Cadet 4th Class
Posts: 11
Joined: Sat Jul 11, 2020 9:10 pm

Post by CatMouthwash » Thu Dec 31, 2020 4:19 pm

So I think I must be doing something wrong. I'm not seeing any changes when I try what JeremyaFr outlined in the first post. It's been over a decade since I've done anything with editing skins in XWA and I need to take some time and look through the forum and tutorials on OPTing. But as an example I'm trying out a skin for the YT-1300. (I'd love to see some FG colors for the YT series ships =] )

So the craft is "FlightModels\CORELLIANTRANSPORT2.opt".
I edited a few of the pngs that I extracted from the opt and placed them as follows: "FlightModels\Skins\CORELLIANTRANSPORT2\CORELLIANTRANSPORT2[TEX*****].png"
The files in the skins folder have the same name and dimensions of the original texture. I did change the color mode from Indexed to RGB, would that cause problems?

I recall when I last tried this with the original Xwing that I had a hard time finding which textures to edit. Is it that I have not done the Cockpit and Exterior opts yet?

I wanted to look over the example but I don't see "Skins\XWing\Default\Tex00033.png" anywhere in my directory. Just to be safe I reinstalled the latest update to the Mega Pack today and looked again, but still not there.

User avatar
Trevor
Lieutenant JG
Posts: 541
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Thu Dec 31, 2020 6:13 pm

Vince T wrote:
Wed Dec 30, 2020 5:18 pm
I've actually tested it at some point, if the replacement texture is larger than the original, you'll only see a part of it which maches the original's size.
@JeremyaFr Can the UV's be made relative (-...0-1...+) so any res can be used?

Trev

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Thu Dec 31, 2020 7:25 pm

Trevor wrote:
Thu Dec 31, 2020 6:13 pm
Can the UV's be made relative (-...0-1...+) so any res can be used?
Hello,
The skins feature doesn't replace the UVs.

User avatar
Trevor
Lieutenant JG
Posts: 541
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Thu Dec 31, 2020 11:47 pm

JeremyaFr wrote:
Thu Dec 31, 2020 7:25 pm
Trevor wrote:
Thu Dec 31, 2020 6:13 pm
Can the UV's be made relative (-...0-1...+) so any res can be used?
Hello,
The skins feature doesn't replace the UVs.
hmm, I assume that XWA uses "texel" mapping (lets say a UV of (0.5,0.75) on a 64x64 = s32,t48) so, could s and t's be hooked and replaced by original texture / st * new texture (hope that math is right :P )

Trev

Post Reply