Skip to content
On this page

Vertex-color blending

The following sections contain examples on how to blend colors using vertex-colors. It is recommended to read Shading network concepts before proceeding.

Vertex-color blending using InterpolateNode

This script sets up three vertex color nodes where the last one is used as blend weight. This example is based on the InterpolateNode.

MEL
string $pipelineFilePath = "D:\\Pipelines\\ReductionPipelineWithBaking.json";
...

select -all;
SimplygonShadingNetwork
-cn materialName ColorNode DiffuseColor1
-cn materialName ColorNode DiffuseColor2
-cn materialName VertexColorNode BlendColor

-sd materialName DiffuseColor1 0 1.0 0.0 0.0   // base 1, red
-sd materialName DiffuseColor2 0 0.0 1.0 0.0   // base 2, green
-svn materialName BlendColor blendColorSet     // link blend set

-cn materialName InterpolateNode VertexColorInterpolator

-si materialName VertexColorInterpolator 0 DiffuseColor1   // red -> 0
-si materialName VertexColorInterpolator 1 DiffuseColor2   // green -> 1
-si materialName VertexColorInterpolator 2 BlendColor      // vertex color -> 3

-sce materialName Diffuse VertexColorInterpolator

-exf materialName Diffuse "D:\\diffuse.xml";

Simplygon
-sf $pipelineFilePath
-asm materialName
-ixf materialName Diffuse "D:\\diffuse.xml";