240 Game Development and Simulation with Unreal Technology
Blend: Blends together ea c h frame of the SubUV sprite layout, rather
than i n stantly “pop p ing” from one frame to the next.
Texture: Specifies the texture sampled by the expression.
Sampler Type: The type of data that will be sampled and output from
the node.
Mip Value Mode: Applies a noise value to the texture that affects the
look and performance.
TABLE 4.54: Texture S ample Parameter SubUV Inputs and Outputs
Inputs
UVs: Takes in UV texture coordinates to use for the texture. If no val-
ues are input to the UVs, the texture coordinates of the mesh the
material is app lied to are used.
Output s
RGB: Outputs the three-c h a n n e l RGB vector value of the color.
R: Outputs the red channel value of th e color.
G: Outputs the green channel value of the co lor.
B: Outputs the blue channel value of the color.
A: Outputs the alp h a channe l vector value of the color.
Texture Sample Parameter Cube: This parameter expression is the eq uivalent to
a Texture Sample expression in that it stores a texture map and returns these val-
ues except that it only accepts cubemaps. Moreover, like all other parameters in
Unreal Engine, it can be referenced and its values change in an instance of the
material at run-time, by level designers, or by the other engine com ponents such
as Cascade an d Matinee.
TABLE 4.55: Texture S ample Parameter Cube Properties
Properties
Parameter Name: Specifies the name used to identify the parameter in
instance of the material and through code.
Group: Provides a way to org a n ize parameter names into groups, or cat-
egories, within a Material Inst ance Constant. All parameters
within a material that have the same Group property name will be
listed underneath that cate gory in the instance.
Blend: Blends together ea c h frame of the SubUV sprite layout, rather
than i n stantly “pop p ing” from one frame to the next.
Texture: Specifies the texture sampled by the expression.
Materials in Unreal Engine 241
Sampler Type: The type of data that will be sampled and output from
the node.
Mip Value Mode: Applies a noise value to the texture that affects the
look and performance.
TABLE 4.56: Texture Sample Parameter Cube Inputs and Outputs
Inputs
UVs: Takes in UV texture coordinates to use for the texture. If n o val-
ues are input to the UVs, the texture coordinates of the mesh the
material is applied to are used.
Output s
RGB: Outputs the three-channel RGB vector value of the color.
R: Outputs the red channel value of the color.
G: Outputs the green channel value of the color.
B: Outputs the blue channel value of the color.
A: Outputs the alpha chan n e l vector value of the color.
4.6.2.9 Utility Ex pressions
These expressions
8
allow you to perform some utility functions in unreal engine in
support of material and rendering functionalities. A comprehensive list of these func-
tions may be found in the Appendix A, or online at Unreal Engine Documentation
Pages [51].
Black Body: T his expression simulates the effects of bla ck body radiation in a mate-
rial. The user m ay provide an input param eter temperature in Kelvin and connect
the resulting outputs to the Base Color and Em issive Color channels of the
material node for physically accurate resu lts.
Example Usa ge: You can connect the Temp input channel of this expression to
a network that statically or dynamically derives the temperature in kelvin
of a material (such as lava, stars, etc.). Feed the outp ut result of this expres-
sion to the Base Color and the Emissive Color channels of the material.
Figure 4.74 shows a network that moves a noise texture coordinates, while
the noise texture samples temperature s ranging between 50 0
K (c old) to
5000
K (hot) on a surface of a radiating object.
8
The contents of this section are adopted from the official UE4 online documentation found at:
https://docs.unrealengine.com/latest/INT/.
242 Game Development and Simulation with Unreal Technology
FIGURE 4.74: Black Body Expression Example.
Bump Offset: This expression is the Unreal Engine 4 ter m for what is commonly
known as “parallax mapping. The Bump Offset expression allows a ma te rial to
give the illusion of depth without the need for additional geometry.
Materials with bump offset use a grayscale heightmap to give depth information.
The b righter the value in the heightmap, the more “popped out” the material will
be; these areas will parallax (shif t) as a camera moves across the surface. Darker
areas in the heightm ap are “further away” and will shift the least.
TABLE 4.57: Bump Offset Properties
Properties
Height Ratio: Multiplier for the depth taken from the heightmap. The
larger the value, the more extreme the depth will be. Typical values
range from 0.02 to 0.1.
Reference Plane: This value specifies the a p proximate height in texture
space to apply the effect. A value of 0 will appear to distort the tex-
ture completely off the surface, whereas a value of 0.5 (the default)
means that some of the surface will p op off w h ile some areas will be
sunken in.
TABLE 4.58: Bump Offset Inputs
Inputs
Coordinates: Takes in base texture coordinates to be modified.
Height: This input takes in the texture (or a value) to be used as the
heightmap.
Height Ratio Input: This input is the multiplier for the depth taken from
the heightmap. The larger the value, the m ore extreme the depth
Materials in Unreal Engine 243
will be. Typical values range from 0.02 to 0.1. If use d , thi s input
supersedes any value in the Height Ratio property.
Constant Bias Scale: This expression takes an input value, adds a bias value to it,
and then multiplies it by a scaling factor outputting the result. The mathematical
equation for this expression is as f ollows:
CBS(X,B,s) = (X + B)× s (4.22)
where X is the input vector, B is the bias vector, and s is the scaling factor. In this
equation × stands for element-by-element multiplication.
TABLE 4.59: Constant Bias Scale
Properties
Bias: This value specifies the bias to be added to the input.
Scale: This value specifies the multiplie r for the bias result.
Example: To convert input data from [-1,1 ] to [0,1] y ou would use a b ia s of 1.0
and a scale of 0.5. This is a common use when we ar e taking the Sine or
Cosine values that ra nge between -1 to 1 and would like to supply it for an
Alpha value in Lerp expre ssions that range between 0 to 1.
Depth Fade: This expression is used to hide unsightly seams that take place when
translucent objects intersect with opaque ones.
TABLE 4.60: Depth Fade
Properties
Fade Distance: This value is the world space distance over which the
fade should take place. T h is is used if the Fade Distance input is
unconnected.
Inputs
Opacity: This i n p u t takes in the existing opacity for the ob ject prior to
the depth fade.
Fade Distance: This input takes in the world space distance over which
the fade should take place.
Example Usa ge: This expression can be used as to augment the Opacity chan-
nel of a translucent material. When the object with this material intersects
another object, the results of this expression will create a nice blur and fade
effect at the intersection site.
244 Game Development and Simulation with Unreal Technology
Depth of Field Function: This expression is designed to g ive artists control over
what happens to a Material when it is being blurred by Depth of Field. It out-
puts a value between 0-1 suc h that 0 represents “in focus” and 1 represents “com-
pletely blurred. This is useful for inter polating between sharp and blurry versions
of a texture, for instance. The Depth input allows for the existing results from
the scene’s Depth of Field calculations to be overridden by other calculations.
NOTE
For this expression to work, the material n eeds to be exposed to a Post-
Process Volume with Depth of Field settings.
(a) (b)
FIGURE 4.75: Depth of Field (DoF) Function. (a) View of a Material with DoF and within
a DoF Post-Process Volume. (b) DoF Network that Blends Material between Blue and Red.
Example Usa ge: This expression can be used as the alpha channel of a Linear
Interpolate expression to blend between different colors, or textures when
exposed to a Depth of Field volume (see Figure 4.75(b)). The network in
Figure 4.75(b) blends between a blue and a red color based on Depth of
Field. The results are shown in Figure 4.75 (a).
Desaturation: This expression converts the colors of its input to softer sha des based
on a certain percentage. Let X be the origin al color, L be the Lu minance Factor
and f be the Fraction value, then the desaturated color D will be calculated
according to the following equation:
D = (1 f ) × (X L) + f × X (4.23)
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.124.21