This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Landscape Tool
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Objects
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
Content Creation
Content Optimization
Art Samples
Tutorials
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

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.

Last update: 2021-04-29
Build: ()