This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
Basics
Rendering
Professional (SIM)
UnigineEditor
Interface Overview
Assets Workflow
Version Control
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API
Animations-Related Classes
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
VR-Related Classes
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Matrix
Textures
Art Samples
Tutorials

Subtract Node


Description

Outputs the subtraction result of the two input values A and B. Subtraction between vector data types are done per-component.

If A and B have a different number of components, a cast is performed to match the one with the greater number of components.

Subtraction operation is not commutative so the order of values is important.

Usage Examples

Example 1

Subtracting two textures (non-commutative). The upper Subtract node takes color values from the first Sample Texture node (first texture) and subtracts the values from the second Sample Texture node (second texture) from them providing Albedo values for the Material. While the lower Subtract node does vice versa subtracting values of the first texture from the values of the second one providing Emission values for the Material producing a nice looking effect.

Gradient Mask with Subtract and Divide

Gradient mask controlling interpolation (along U-axis) between two given textures, with Slider1 controlling the position of the transition and Slider2 controlling transition softness. Outputs of two Sample Texture nodes are connected to the Lerp node that performs linear interpolation between texture values with an interpolation coefficient. To getthis coefficient we take U coordinate from the Vertex UV 0 node and subtract it from the current Slider1 value, the result is then passed to the Divide node to be divided by the value of Slider2, then the result is summed up with Slider1 value and passed to the Clamp node to be restricted to the [0;1] range. The result or linear interpolation provides Albedo values for the Material.

Last update: 2022-05-16
Build: ()