BOYD GFX Pipeline
Tools
Modeling: Blender.
Game engine: Unreal Engine 4.
Texturing: Blender, Substance Designer.
Style
The choice of style for the BOYD project fell on a slightly stylized Middle Ages.
Production
Premise
The environment constructor consists of 2x2m blocks (plus some smaller "hole fillers just in case"). The assumption is to automate the asset preparation process to the maximum, therefore procedural modeling techniques are used for modeling and one multi-channel "master baker" in the case of multi-material assets or a single-channel simplified one in the case of single-material assets.
Modeling overview
Each asset is made of 2 parts: a low poly model with a uv map and a high poly model from which information is baked into low poly. For this we use auxiliary or transitional forms of these models. All together is as follows:
SM_XXX_HPW - high poly work model - a working model with modifiers, we work on the high poly form on it.
SM_XXX_HP - high poly model - HPW model with modifiers applied, model for use in Substane Designer, will serve as a source from which we will bake information to low poly.
SM_XXX_LP - low poly model - low poly model with uv map, uniform smooth shading, model for use in Substane Designer, we will bake information from high poly on it.
SM_XXX - low poly model for use in the engine (UE4, Unity, etc.), on the Alpha Vertex Color channel with black we paint completely dark places of the model (holes, deep fissures, etc.), in most cases it will be a dependent LP copy of the model (one the exception may be the generation of floors, so the floor in the engine has one simple object, while due to the multitude of variations and the optimal use of texture density, we place a set of 16 floors on one texture, which is why the LP model and the model in the engine differ).
Modeling example - simple
Now let's look at this pipeline on a specific example of a wall block with a basement window. Due to the simplicity of the model, it will be textured in a simple single channel way.
According to the object concept, we make the HPW model using simple low poly cubes and similar simple "bricks". We're adding modifiers to provide procedural differentiation and density high poly geometries. It is worth noting here that the model consists of 2 parts, later combined into one object - the wall itself and the window with the truss.
We duplicate our HPW, change the name to HP, in the middle of the object we add additional blocks on the right and left side of the wall (which when baking textures will give the effect of wall continuity - the side edges will be well "built in" in the series of walls composed of many segments) and using the shortcut Alt+C apply all modifiers. We check whether the generated geometry is correct - whether there are no triangles sticking out somewhere, or we correct it manually. Our HP model is ready to bake.
We make the LP model so that it covers the HPW model well. We set a uniform smooth shading on it. We unwrap and use the TexTools tool (https://bitbucket.org/renderhjs/textools-blender/src/master/) to set the proper texture density scale. When setting the texture scale, it's worth checking to sample texture desints from the largest object - in our case it's a gate.
List of modifiers (exact parameters in the picture):
Subsurf
Displace
Subsurf
Decimate
Decimate
Bevel
Displace mod Texture parameters
We add the "Col" Vertex Color channel and one more "Col_ALPHA" channel, which will serve as the fourth "Alpha" Vertex Color channel when exporting the model to FBX (requires Enzyme42 Modified FBX Exporter - currently only for Blender 2.78c). We paint on this "Col_ALPHA" channel black on white the dark place under the window. LP model and engine model ready.
Texturing - simple
In Substance Designer we create a simple setup. Loading HP and LP models. We are baking the following maps from HP to LP.
To save resources, we combine Roughness and Ambient Occlusion textures into one texture using the channel packaging method. In this way, instead of 4 textures, we only have 3, and 2 free channels in the third texture just in case (e.g. metallic and emissive). We export the baked textures and import them and the low poly model into the engine (in this case it will be UE4).
Material in engine - simple
In the engine, we create a very simple material to which we attach the generated textures. Then in the material instace of this material we will replace the textures in the parameters for other models.
Modeling example - advanced
Now we will discuss an advanced way of creating assets that saves production time. Basically, we will use the same method as described above for modeling. The only difference, or rather an addition, will be the use of the RGB channel "Col" Vertex Color to indicate different materials. For the needs of this project, I developed a setup for 14 materials:
Stone FF0000
Wood 00FF00
Metal 0000FF
Ground Dirt 7F00FF
Ground Grass FF007F
Gems FF8000
Wax (Candle) FFFF00
Glass (Potion) 00FFFF
Leather FF00FF
Paper 80FF00
Ceramic 00FF80
Fabric 0080FF
Paint C19FFF
Ashes FFC06A
Each material is assigned its own unique Vertex Color. Based on the generated map in the Substance, using the "Color to Mask" node, a specific material is masked and then combined with the others into one texture.
The output is the following textures:
BaseColor
Normal
Composite A
R - Ruff
G - AO
B - Metal
A - Opacity
Composite B
R - Color Mask
G - Emit Mask
B - reserved
A - reserved
This way we only have 4 full textures (plus 2 free channels just in case) supporting all 14 materials in all combinations. Some of these materials require Opacity Map, some Emissive, some Color Mask to be able to control the color in the engine - this setup covers all these needs.
As a curiosity, I can add that at the beginning I used the "Multi Material Blend" node to mix all these materials, but for some unknown reason it caused random non-display and non-mixing of some channels (from opening to opening the project file with materials in Substace it could be different channels). That's why I did my own mixing of all these materials/channels.
Resume
This method is quite simple and time efficient. It gives a pretty good visual effect in terms of production speed and is universal - with its help you can create the entire graphics constructor as well as props and character assets while maintaining a uniform style. The longest time consuming thing with this method is setting up the right materials in Substance Designer and clicking through all the assets to save all generated textures.