ZModeler3 Guide: Converting vehicle paint materials - pnwparksfan/vms-doc GitHub Wiki
VMS uses emissive liveries with the vehicle_paint4_emissive
shader, which conflicts with the typical vehicle paint/template materials used on many original game models and custom dev models. vehicle_paint2
, vehicle_paint3
, and other vehicle paint materials conflict, and cannot be used when vehicle_paint4_emissive
is in use. In order to avoid this, all paint materials on a vehicle being developed for VMS should be converted to vehicle_paint1
, which does not support liveries and therefore does not conflict. This means you will not have multi-livery support on the vehicle, but it will work with VMS.
It is possible to use
vehicle_paint3_lvr
to achieve a multi-livery effect on the secondary livery while also usingvehicle_paint4_emissive
, but converting a vehicle to use those materials is difficult and outside the scope of this guide. That material also has some issues which make it not ideal for certain vehicles. I will add a separate guide for that method in the future.
The most common paint material found on most vehicles, vehicle_paint3
, has the details on UV#2 and the dirt/spec map on UV#1. Unfortunately, vehicle_paint1
is the opposite: detail is on UV#1 and dirt/spec is on UV#2. Therefore, you need to swap the UV map between channel 1 and channel 2. There is no quick way to just swap them; this guide walks you through the steps.
Overview of approach
The approach is to switch all meshes with paint materials temporarily to a material which has 3 UV channels (vehicle_paint8
), use the UV Map tool to swap the UV maps around, then set the new vehicle_paint1
material onto those meshes.
1: Identify materials which need to be changed
Look in the Material Browser for any material which has Adapt vehicle_paintX
, where X
is any number other than 1. The most common will be vehicle_paint3
. On simple models you may only have one such material; more complex models may have multiple.
2: Create a temporary material
Create a new material, name it vehicle_template_3UV
or something else that makes sense to you, and set it to vehicle_paint8
material type. Create one of these for every existing paint material that needs to be converted. If you do have multiple, make sure to name them clearly so you don't get confused in later steps.
3: Swap the materials
Drag and drop the temporary material onto the original material it will replace. You will get a pop-up with several options; choose "Swap in scene". You should see the vehicle change to a white color in the 3D or Perspective view.
Make sure to check all LODs to ensure the materials have been swapped properly.
4: Select affected materials
Go back to L0, and make sure you are in Object mode. Use the Select tab to select All objects.
Enter Polygon mode with all objects selected. Once you are in Polygon mode, make sure that nothing is selected yet, then click the Select By Material icon on the selection tab.
Select your temporary material(s) in the Select by Material window, then click Select.
You should now see all meshes with paint materials selected on L0.
5: Convert UV maps on selected materials
Make sure in the Material Browser window that the ONLY materials in the
Scene Selection
are your temporary materials you created in step 2. You should still be in Polygon mode, with the meshes with paint materials selected only on L0.
Unclick any active selection mode icon on the Selection tab, so that you can right-click on the model. Right-click anywhere and select Mapping > Edit UV
. You will see the Edit UV Mapping
window.
We are going to take the following steps, in this order:
- Copy UV#1 → UV#3
- Copy UV#2 → UV#1
- Copy UV#3 → UV#2
In the Edit UV Mapping
window, set the mode to Generate New
, set the source to Copy from channel #
, and set the Edit UV Channel map #
and Copy from channel #
options accordingly. Click OK on the UV mapping window, then re-open the UV mapping window again by right-clicking and choosing Edit UV Mapping
again. Repeat until all 3 conversions are finished.
6: Create the new final material
Now, for each of your original paint materials, make a copy, and give it an appropriate name.
Set the new material to use vehicle_paint1
.
The new material may not copy over the correct texture selection for the DETAIL
section. If necessary, open the Material Properties window, and change the Texture Map
under DETAIL
to the correct original texture (typically something like template
or something ending in _sign_1
).
7: Apply the new material to the selected polys
Once you have the new material, click and drag it to overwrite the temporary material in the Scene Selection pane. Make sure that if you are converting multiple materials, that you replace the correct temporary material with the correct new material that matches the original material.
You should now see your vehicle with the correct mappings in the 3D or Perspective view.
Make sure that the dirt/specmap UV channel was converted correctly by enabling Dust
on the Structure
tab. If the dirt or the main texture looks messed up (and it was good to begin with), you may not have converted the channels correctly.
8: De-select all polys before continuing
Before continuing to the next LOD, MAKE SURE that you DESELECT everything in Polygon view on the current LOD you are working with.
9: Repeat for additional LODs
Repeat steps 4-8 for each additional LOD. Skip step 6 (creating the new materials) for any materials that you have already created a new copy of.
Conclusion
That's it! Once you've converted all materials for all LODs, your model is ready. Load it in game and set the vehicle to be dirty using your trainer to make sure everything got converted correctly.