Stylized Rendering Materials

An overview of the special case Materials used in the Stylized Rendering showcase included with UE4.

Choose your operating system:

Windows

macOS

Linux

There are some special techniques which have been applied to Materials in the scene to help give the impression that this is a painted work of art come to life. Two key examples are the "floating brush stroke" effect that can be seen around the treetops, and another is the 2D-style foliage that always orients toward the player.

Most of the Materials created for this scene are actually applied via a Material Instance Constant . This allows for rapid property adjustments and tweaks without having to wait for the Material to recompile.

Floating Brush Stroke Leaves

TreeTopMaterial.png

To see this Material network, please locate and open ( double-click ) the M_Tree_Leaf_Base_Solid Material in the Content Browser .

Around the tops of the trees in the scene are what appear to be floating paint strokes which give the impression of leaves. These are made possible by way of a Masked Material combined with Temporal Anti-Aliasing.

The critical part of the network is the DitherTemporalAA Material Function. This function creates a dot (stipple) pattern that moves over time. When used as a part of an opacity mask on a Masked Material, they can keep the mask from appearing too harsh, allowing for masks that seem much softer.

Here is the tree with and without the use of the DitherTemporalAA node:

With DitherTemporalAA

Without DitherTemporalAA

However, it should be noted that this technique requires the use of TemporalAA , which is an engine feature that is active by default . It can be overridden within a Post Process Volume via the AA Method property, which is found under the Misc category.

AAOverride.png

Foliage Material

FoliageExample.png

To see this Material network, please locate and open ( double-click ) the M_Grass_Masked Material in the Content Browser .

Scattered across the terrain is a series of foliage that, although flat, always faces the player. This behavior is defined in the Material by way of the World Position Offset Material input. This input allows for the vertices of a mesh to be edited through vector operations within the Material. Objects can be reshaped, resized, or in this case, can have their geometry rotated to face the camera.

The expression to handle this is found within the Face camera on 1 axis comment block .

Click for full size

Of particular importance in this network is the Custom expression node, which allows for HLSL code to be written for its input. Currently, it is performing the following math expression:

float2 output; 
float2 Input1; 
output = atan2 (In.y,In.x); 
return (output);

This is useful, but must be used with caution. The Custom node prevents the Material network from being collapsed, which is an internal optimization process. In effect, it makes this Material a bit less performant.

언리얼 엔진 문서의 미래를 함께 만들어주세요! 더 나은 서비스를 제공할 수 있도록 문서 사용에 대한 피드백을 주세요.
설문조사에 참여해 주세요
건너뛰기