Create new default values for ShaderFX nodes in a Stingray Physically Based Shader

In the ShaderFX editor for your Stingray PBS node, create a node, for example, Add. Click any input attribute on the node to display its Attribute Editor. A Default value has been assigned to the node; in this case, 0 0 0 0.

You can change this default value to any of the following. The attribute port also changes color as its default value is changed to a different data type.

By setting the default value on an input, you can perform operations without providing an external connection.

For example, you can set the first input of your Add node to (1, 0, 1) and the 2nd input to (0, 0, -1). Click the Render Swatch icon, and you see that the Add node swatch turns red. You have added the two input default values (1, 0, 1) + (0, 0, -1) = (1, 0, 0) without connecting any external input nodes.

As soon as you connect a node to an input, however, the default value that you specified is erased and replaced with the new connection.

Example: Vertex color channel to determine opacity

The following example demonstrates how to use the vertex color blue channel to control opacity.

The 0.5 value added to the blue vertex color channel causes all areas with blue to be semi-transparent.

A significant amount of blue was painted on dinosaur's leg. These areas are now more opaque than other areas since it is the blue channel that determines the opacity.