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 Reference
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

Dot Product Node


Description

Outputs the dot product of two vectors A and B, which is the sum of the multiplication of each vectors components. For example, if A and B are 3-component vectors, then the result is A.x * B.x + A.y * B.y + A.z * B.z.

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

The geometric interpretation of the dot product is that it represents the magnitude of one vector's projection onto another. This projection can be visualized as the "shadow" of one vector cast onto the axis defined by the direction of the other.

The dot product is commutative, so the order of arguments is not important.

This operation is essential in shading, determining light intensity based on the alignment between the surface normal and the light direction.

Usage Examples

View-Dependent Shading

The example demonstrates a view-dependent shading effect, where color transitions are based on the alignment between the view direction and the surface normal.

The outputs of the View Direction and Vertex Normal nodes in Tangent space are connected to the Dot Product node that calculates the dot product of these vectors. The result is inverted by subtracting it from 1 using input adapter and passed to the Lerp node as a linear interpolation coefficient. The Lerp node blends between two colors — red and green — based on this coefficient. The result of linear interpolation provides Albedo values for the Material.

The information on this page is valid for UNIGINE 2.20 SDK.

Last update: 2025-04-04
Build: ()