Snow Effect Sample
This material graph sample demonstrates how to implement an effect of snow coverage.
The data from the Normal Map texture is sampled by the Sample2D node connected via the xyz port adapter to the Normal port of the Deferred PBR Material master material node.
The output of the Sample2D node for the normal map (XY components) is connected to the GetNormalZ node that calculates Z component of the normal which is in turn combined with X and Y into a normal vector (float 3) via the Make Float3 node . This normal vector is converted from tangent to world space to calculate a dot product of this normal vector and snow direction vector (in world coordinates) provided by the Float3 Slider node (enabling you to adjust float3 values via the Parameters panel in the UnigineEditor). The resulting value is saturated in the [0.0f; 1.0f] range to obtain a snow coverage map which is then passed to the contrast node which applies contrast correction with the Mask Contrast value provided by another Float Slider node.
The resulting value is used as a coefficient for linear interpolation between the color stored in the Albedo texture and snow color provided by the Color node (enabling you to adjust color values via the Parameters panel in the UnigineEditor).
Opacity value (fully opaque) for the Deferred PBR Material master material node is specified directly via port adapter.
Finally, the data output is passed to the Final Material node.