Substance Painter 2019 - How to export Textures - Part II: custom Presets
This is the second of two tutorials, created with reference to the 2019 version of Substance Painter, on the export of Textures from this program to various destinations: from other 3D software (such as Unity, Unreal, V-Ray and others), to set of Generic textures for the PBR (Physically Based Rendering) paradigm.
In this tutorial we will see how to define our own custom export Preset, so as to export the Textures that interest us and, among other things, create them with a custom naming scheme, using the Substance macro variables; we will also see how to create our own Template, with the settings we intend to have for all our new projects.
Unlike what happens with most of my tutorials on Substance Painter, the Assets (3D models and other resources) used in this tutorial are NOT available; however, you can follow the tutorial and learn without having to replicate the operations with these particular objects!
Ok, given these premises, let's start!
- HOW TO CREATE A NEW EXPORT PRESET
- DUPLICATING THE UNITY METALLIC PRESET
- CREATING AN OUTPUT MAP: GRAY, RGB, R + G + B, RGB + A, R + G + B + A
- THE TEXTURES NAME SCHEME: HOW TO USE SUBSTANCE MACROS
- LET'S INSERT THE UNREAL MAPS IN THE UNITY + UNREAL PRESET
- HOW TO RENAME THE TEXTURES OF OUR EXPORT PRESET
- CREATION OF A CUSTOMIZED TEMPLATE FOR NEW PROJECTS
- TO RECAP ...
The creation of a new custom export preset, to be found also in the subsequent sessions of Substance Painter, is actually a rather simple operation.
First, click on Export Textures in the File menu (shortcut: CTRL SHIFT E), then we move to the Configuration tab in the Export Document window that will appear on the screen.
Here we can perform three operations: we can create a new completely blank Preset, by clicking on the + symbol in the left column, or remove a Preset by clicking on the symbol - after selecting the Preset to be eliminated or, finally, duplicating an existing Preset, selecting it and clicking on the Copy icon, top left.
The Copy operation is very useful if, for example, you intend to create a Preset to export the Textures in one shot for multiple rendering engines; in this tutorial we will see just one such example, exporting Textures for both Unity and Unreal.
First, select the "Unity 5 Metallic" Preset from the left column, then click on the copy icon at the top to duplicate it.
The new Preset will have the same name as the original with the addition of the suffix "copy"; double click on this name in the left column, then rename the Preset to "Unity + Unreal".
From the previous tutorial we know that it is possible to export Textures by creating color images (RGB), possibly with transparency (channel A), and that it is also possible to export grayscale images (GRAY) because some information channels, such as Metallic or Roughness, actually express linear intensity values, which are represented by grayscale images, not in color.
Looking at the "Output Maps - Create" row and the buttons there, we can guess something: Substance Painter allows us to define an RGB type Texture, possibly with Alpha, specifying in a separate way the information to be inserted in the RGB channels with R + G + B or with R + G + B + A: these channels will then be treated as intensity channels to pack more information into a single image, which the destination program can then separate and be used properly. This happens for example in Unreal and that's why I chose that destination, for the example of this tutorial.
To add a Texture to the list of Textures to export, then, first of all we must have in mind what kind of image we want to generate. In this case, to know which Textures are needed for Unreal 4, I will take a peek at the existing Preset, present in the left column in Configuration ...
For Unreal 4, Substance Painter includes 4 Textures:
- one of the RGB + A type, for the Base Color and transparency, obtained by Input Map - Base Color and Input Map - Opacity;
- one of type R + G + B, with the three channels used individually as grayscale maps to store, in order, the Ambient Occlusion map (from Converted Map - Mixed AO), the Roughness map (from Input Maps - Roughness) and the Metallic map (from Input Maps - Metallic);
- then we have an RGB type map for the Normal channel, taken from Converted Maps - Normal DirectX, so it will include both the information of the Normal channel and those of the Height channel of Substance Painter;
- finally, an RGB map for the Emissive channel, taken from Input Maps - Emissive.
Comparing the two Presets, Unity 5 Metallic and Unreal Engine 4, we note that in reality there is no need to recreate, in our custom Preset, the Base Color and Emission maps, because they are substantially the same as those of the Unity 5 Metallic Preset we duplicated; the Normal maps are different, because Unity 5 Metallic uses Converted Normal OpenGL, while Unreal 4 uses Converted Normal DirectX.
Before proceeding to insert Unreal 4 Output Maps into our Preset, we open a small parenthesis on the names of the Textures to be created and on the Substance Painter macros usable to create "patterns" of names for Textures.
In the textual field present for each Texture we can insert a text that will be used as the name of the file to be generated, so for example for a Texture of the Emissive channel we could write "Emission", while for Normal Map OpenGL we could write "Normal_OpenGL", for to distinguish them from "Normal_DirectX", but we have not finished yet: Substance gives us the possibility to use three keywords, identified with the dollar symbol, which will be automatically transformed into project, mesh or Texture Set names in use at the time of creation of Textures files.
These keywords or "Macros", which can be called up by clicking on the dollar symbol next to the text field where to insert the name of the Texture, are:
A couple of practical examples, made using the "rwb" project, the three meshes present here ("carabiner", "rwb" and "small split ring") and the Texture Sets, which have the same names as the meshes:
- $mesh_$textureSet_Emissive will generate three images, called "rwb_rwb_Emissive", then "carabiner_carabiner_Emissive" and "small_split_ring_small_split_ring_Emissive";
- "Unreal_$textureSet_Emissive" will generate, in this project, three images, called "unreal_carabiner_Emissive", then "unreal_rwb_Emissive" and finally "unreal_small_split_ring_Emissive";
which means that you can place these keywords before or after others as you like: the important thing is to remember the dollar symbol and to be careful in small and capital letters, especially in textureSet.
Ok, with all this information we can insert the Unreal Textures in our "Unity + Unreal" Preset, created by copying the Unity 5 Metallic Preset; we said that, in reality, Base Color and Emissive are identical, so we only add Occlusion Roughness Metallic and Normal DirectX in this way:
- let's create a new RGB type texture calling it for example $project_ $textureSet_Unreal_Normal, then click on Converted Maps - Normal DirectX and drag on the RGB box of the Texture, releasing and choosing RGB Channels in the menu that will appear on the screen;
- let's create a new Texture of type R + G + B calling it for example $project_$textureSet_Unreal_ORM (the abbreviation ORM will remind users to associate the three RGB colors to the three channels Occlusion, Roughness and Metallic, inside Unreal), so let's click and drag to associate the map "Converted Map - Mixed AO" to channel R, the map "Input Map - Roughness" to channel G and the map "Input Maps - Metallic" to channel B, choosing in all three cases "Gray Channel "(ie the intensity channel) in the menu that will appear on the screen.
Let's now provide a uniform naming scheme, for the Textures to be generated with our customized Preset, using the scheme just defined with the two new maps, for which we rename the existing maps in:
- $project_$textureSet_Color_and_Transparency, for Base Color (or Albedo) and Opacity, which is fine for both Unity and Unreal;
- $project_ $textureSet_Unity_Metallic_Smoothness, for Metallic and Smoothness;
- $project_ $textureSet_Unity_Normal, for the Converted - OpenGL Normal Map, which is good for Unity;
- $project_ $textureSet_Emission, which is fine for both Unity and Unreal.
Our Preset is ready, stored and can be chosen, in the Export tab, as Export Preset, in the Config menu, before clicking on Export.
Before closing this tutorial, let's see how to create a custom Template in order to find some settings, such as information channels, in future projects.
Actually, the operation is very simple: with an open project, after having set the features you want to find in the Template, open the File menu, choose "Save as Template" and enter the name of the customized Template, which will be saved in the folder Documents / Allegorithmic / Substance Painter / Shelf / Templates (so in a user's folder, as seen in the tutorial on saving groups of Layers by creating Smart Materials).
Among the information that Substance will store there are the aforementioned information channels for the Texture Sets, the initial resolution of the project, some settings regarding the illuminating background of the 3D View and also the viewpoint of the camera and the channel to be shown in the 3D View (typically, Material).
The Template will be available immediately for new projects: just click on New Project and open the Template menu to find it.
Small side note: the overwriting of a Template file seems to give some problems (which is a euphemism for saying that it does not work properly, in some cases), so if for example we later realize that we want to save a different setting (for example, the initial resolution of the document, which we want to set to 2048 instead of 1024), let's proceed in this way:
- in the New Project tab, let's select the Template to modify;
- let's change the resolution of the project in 2048, so we create a new project with any 3D file;
- eventually, let's modify other settings in the project, such as the point of view of the virtual camera;
- from the File menu, let's choose "Save As Template" and save the Template in a new file, without overwriting the previous one.
To do some cleaning, we can remove the custom Template files that we no longer care about, either from a File Browser window or from the "Save Template" window of "File - Save as Template".
In this tutorial we have seen how to create, basically, two presets or custom configurations, for two different contexts:
- an export Preset, specifying both the Textures we want to generate and their pattern of names;
- a New Project Template, so as to find right away some settings or information (such as project resolution and information channels for each Texture Set) when we create a new project.
Well, that's all for this tutorial! See you soon!