296 Game Development and Simulation with Unreal Technology
MatLayerBlend_Simple: Provides a simple line ar inte rpolation (Lerp) blending so-
lution for 2 Material Layers. Does not blend Normal; instead , retains Normal of
the Base Mater ia l.
MatLayerBlend_Stain: Blends the Top Material over the Base Material as a stain,
meaning that only the Base Color and Roughness values from the Top Material
are used.
MatLayerBlend_Standard: Blends all attributes of two Material Layers.
MatLayerBlend_Tint: Allows for tinting of a Material Layer by inputting a tint
color and a mask to control the tint’s lo cation. Usef ul for makin g partial color
changes.
MatLayerBlend_TintAllChannels: Similar to Tint, but also affects Specular. This
is a very special case function; generally, you will not ne ed it.
MatLayerBlend_TopNormal: Blends all attributes of both Materials but only uses
the Normal of th e Top Material.
5.10 MATERIAL INSTANCES AND DYNAMIC MATERIAL
MODIFICATIONS
Instanced Materials refer to materials in which spe cific features are represented
as param eters in th e base mater ia l. T hese parameters are in turn available within the
Material Instance Editor for editing without the need to recompile the base ma-
terial. Th is is a very important feature for in-game and dynamic modificatio n of the
instanced materials. This ability to change instanc ed materials allows for modifying
the material while in gameplay in re sponse to in-game events.
In order to instance a material and change its properties in the instanced materials,
you need to represen t such features as parameters. A Material Parameter expres-
sion, as we discussed earlier in this chapter, is a data node that co ntains the default
values given to it in the Material Editor. However, you may refer to th e parameter
in-game, at level design, or in the Material Instance Editor by the parameter’s
name.
Unreal Engine 4 allows for two types of material instances, Constant and Dynamic.
A Constant material instance is calculated once, prior to the gameplay. You may not
change its parameters’ values in-game. Although these types of material in stances are
fixed and cannot be mod ified in-game, they still give yo u the performance advantage
since they do not require compilation.
A Dynamic material instance (Material Instance Dynamic or MID) is a material in-
stance which can be changed in-game at runtim e. Therefo re, you will be able to
create a blueprint script or C++ code to make changes to its parameters’ values. For
example, you can create a Material Instance Dynamic in blueprint scripts by using