TUTORIAL 02_ SImple vertex color masking from blender to substance painter
In video games one key element is to keep materials on game object less as possible: if you have game objects that shares the same material you can really improve performances, especially when it comes to mobile platforms. Here a really simple workflow that you can follow in order to paint your model using the same material for different parts.
PLEASE NOTE: the following example just create an extremely simple shape, the focus is NOT the modelling techniques but the vertex color masking from blender to substance painter
1. Model your base asset
Just start modeling your first asset.
2. UV Unwrap it
Now, just mark the seams and UV unwrap the model (you can find the function in EDIT MODE - Shading/UVs panel).
3. RESIZE UVS
Ok, now let's think that this model is the base of our asset, and we will add another one as upper elements. They will share the same material, so we must spread the UVs between both the models. We will apply transformations to this model in order to be sure that the editing will be calculated in the unwrapping procedure (just go to OBJECT MODE -> ctrl A -> Apply Rotation, Scale, Position for Mac) and we will resize and translate the UVS (in the UV editor page, you can find the commands inside UV window menu and Transformations).
4. VERTEX PAINTING TOOL
Now, here the key passage... Let's think to Vertex painting as the Chroma-key of video technique (do you know Green-Screen? )... We will choose the part of the model to selectively paint inside Substance Painter thanks to the color that we assign here in the Vertex Painting Tool. So, let's open the "VERTEX PAINT" view (you can find it in the Object and Edit Mode selector)... In the down corner you can see a square symbol that indicate the face selection mode; click on it and with A you can select ALL the faces of this base model. Choose a color gradation and press SHIFT + K (or select the option in the PAINT menu to apply the same color to all the faces)... If you prefer you can also manually paint each vertex.
5. Repeat the process for the upper mesh
Model, apply transformations and UV Unwrap a second model, then Vertex paint it with a different color. When you scale UVs pay attention to not overlap the one of this model with the one of the previous one, as they will share the same material.
6. ADD THE MATERIAL AND EXPORT
In Blender, go to the Material screen and create a new material, then assign it to both the models. Then, export to FBX.
7. IMPORT IN SUBSTANCE PAINTER AND SETUP THE PROJECT
Substance Painter it's an amazing tool, also easy to use together with Unity standard shader workflow. When you start the project, just choose the model .fbx that you just selected, a Unity 5 Standard Metallic Workflow as template and remember to choose an higher resolution; don't worry, you can resize it also directly into Substance Painter, but inject into Unity a better quality file and then resize and compress it inside the editor, so you can assure a better quality import process.
9. BAKE MAPS
Now the next important step is to Bake the maps, including the color ID. In the central menu (this can change according to your layout) you can find the "Texture Settings" pad: here scroll down and choose "Bake Texture" option. From the next menu you can tweak the settings for the best result, however let's keep everything as it is... Just put attention that the color ID map will be produced.
10. Apply materials filtering with color masks
Now you can paint and apply materials on the two different parts just using a color mask. Select the "Configuration Mask" option and choose "Color Mask". Then in the menu just select "Pick Color" and your model will display the original vertex color. Pick one of the two color in order to apply the layer just on it. Here we are :)
11. EXPORT TO UNITY AND IMPORT INTO YOUR SCENE
Now, just choose Export Textures and select Unity 5 Standard Metallic workflow. Then, import FBX and texture into Unity, tweak size and compression, find the "Dente" material associate to the fbx and assign the textures. Change the albedo color multiplication to full white. If you have metallic elements, remember to setup the reflections otherwise they can look dark.
THAT's just the beginning
Now that you saw a simple way to choose vertex color in order to paint selectively some parts of a model, you can go deep into that. You can find amazing tutorials on Allegorithmic's website, some beautiful courses on Udemy about creating game assets together with Blender and Substance Painter for Unity platform and remember, this was just a starting point :)