How to Define or add ColorMats

Your forum for all discussions around Modding.
User avatar
wolfnut70
Posts: 6
Joined: Wed Mar 30, 2022 4:17 pm

How to Define or add ColorMats

Post by wolfnut70 »

I can see the color mats in the Editor, How Do I know what has been defined so I can call them in my xml? How can I define new ones?
Thanks
User avatar
Vector Man
Posts: 93
Joined: Wed Oct 16, 2019 7:34 pm
Location: Deutschland
Contact:

Re: How to Define or add ColorMats

Post by Vector Man »

Hey,

The colors of a vehicle in the editor is defined in the Custom Shader part of the material. If you haven't done it yet, pin the material window to your editor. Scroll down to the Custom Shader part. There, the "vehicleShader" is selected. With "colorMat0", "colorMat1", ... you can define the colors. For the xml, take a basegame vehicle as a reference. Take a vehicle that has non-standard colors, for example the MAN TGS semi that has this mint green color by default. The "baseMaterialConfigurations" part is what you're looking for. You can copy that in your xml. There should be a line with "value=MAN_GREEN1" or something similar. You can change that to "value="yourColor.red yourColor.green yourColor.blue". The "material="0"" stands for the type of material. 0 = metal, 1 = plastic, ...
The material you're defining colors for must be referenced in the baseMaterial part of the xml.
Vector Man
Virtual, in Real Life or Somewhere in Between

🎥 Mod previews, Real Life videos and more:
https://youtube.com/c/VectorManModding

🐦 News:
https://twitter.com/vmModding

📷 Some interesting photos:
https://instagram.com/vmmodding

📘 Facebook:
https://www.facebook.com/vectormanmodding
User avatar
wolfnut70
Posts: 6
Joined: Wed Mar 30, 2022 4:17 pm

Re: How to Define or add ColorMats

Post by wolfnut70 »

Thanks. I have figured out how to find the ones that exits. Say for example I want to paint the rear wheel wells, Gas tank, and or the tank behind the cab. how do I make those pain table and add a new colormat with a new or existing. I have figured out how to make sure tgs_vis is defined in the xml with the Index Path of 0>0|10|8|0 with Material tgs18500_mat and I can use the colormat0 and colormat1. How do I add additional new paint able material and or use up to colormat7 for existing materials?
User avatar
Vector Man
Posts: 93
Joined: Wed Oct 16, 2019 7:34 pm
Location: Deutschland
Contact:

Re: How to Define or add ColorMats

Post by Vector Man »

As far as I understood that, you want to make parts of the vehicle paintable that are in a fixed color by default, right?
That can only be done in a 3D-Software like Blender or Maya. The position of the UV map tells the shader what type of material to apply. To make a part paintable with colorMat0-7, the UV map of this part must have the position y = -1. The x position tells the shader which of the colorMats0-7 to apply. For example: The UV map of a part has the position 0/-1; In that case, the part has the colorMat0 applied. Or you have the position 5/-1; then, the part has the colorMat5 applied.
Vector Man
Virtual, in Real Life or Somewhere in Between

🎥 Mod previews, Real Life videos and more:
https://youtube.com/c/VectorManModding

🐦 News:
https://twitter.com/vmModding

📷 Some interesting photos:
https://instagram.com/vmmodding

📘 Facebook:
https://www.facebook.com/vectormanmodding
User avatar
wolfnut70
Posts: 6
Joined: Wed Mar 30, 2022 4:17 pm

Re: How to Define or add ColorMats

Post by wolfnut70 »

Ok now I understand. Thanks for explaining This.
Post Reply