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:
output = atan2 (In.y,In.x);
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.