This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
Professional (SIM)
UnigineEditor
Interface Overview
Assets Workflow
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
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
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials

Vertex Color Sample

This material graph sample demonstrates how to use vertex color for texture blending when creating materials.

Vertex color data retrieved via the Vertex Color node is passed to a portal for the ease of access. 4 sets of Albedo and tangent-space Normal textures are blended with accordance to the channels of the vertex color data:

  • Each of the color channels (RGB) gets its own Linear Interpolation expression.
  • The data from the first Albedo A texture sampled by the Sample Texture node is plugged to the A port of the first Lerp node.
  • The data from each of the other three albedo Textures (B-D) sampled by the corresponding Sample Texture node is plugged to the B port of its corresponding Lerp node.
  • The first Lerp node corresponding to the Texture A plugs into the A port of the Lerp node corresponding to Texture B, with Coefficient driven by the Red channel from the vertex color (connected via the x port adapter).
  • The second Lerp node corresponding to Texture B plugs into the A port of the Lerp node corresponding to Texture C, with Coefficient driven by the Green channel from the vertex color (connected via the y port adapter).
  • The third Lerp node corresponding to Texture C plugs into the Albedo port of the master material node, with Coefficient driven by the Blue channel from the vertex color (connected via the z port adapter).
  • Four Normal maps sampled by the corresponding Sample Texture nodes have the same kind of setup of Linear Interpolation expressions.

Finally, the data output is passed to the Final node.

The result
Last update: 2022-10-10
Build: ()