CLEAR

Visual Shaders - Patches

Connect these patches to determine the appearance of an object.

Find out more about using visual shaders.

Consumer Patches

Consumer patches represent a material's properties. Connecting other patches to the consumer patch will have the same effect as setting its properties in the Inspector Panel.



Asset Patches

Texture asset

Texture asset patches are orange. They represent textures you've added to your project.

They have 3 output ports:

  1. RGBA - a 4-channel Texture containing both the color and the alpha components of the texture asset.
  2. RGB - a 3-channel Texture containing the color components of the texture asset.
  3. A - a 1-channel Texture containing the alpha component of the texture asset.

You can instantiate the same asset patch more than once.

Producer Patches

Gradient

This patch creates a gradient. It has one output port, which is a 1-channel grayscale texture of a gradient.

You can change the gradient shape to either horizontal, vertical or circular.

Intermediary Patches

Gradient Step

This patch creates a 4-channel texture color gradient. The shape of the gradient will depend on whether the input of the Gradient patch it's connected to is circular, vertical or horizontal.

The Gradient Step patch has 5 input ports:

  1. Gradient - this is a 1-channel texture indicating the shape of the gradient. You'd usually connect this to the output of a Gradient patch or the Gradient output port of another Gradient Step patch.
  2. Previous Step - Vector4, representing the starting color of the gradient or 4-channel Texture on which the color gradient is added. This would usually be the output of another Gradient Step.
  3. New Color - Vector4, representing the end color of the gradient.
  4. Start Range - Scalar, representing the start of the range at which the gradient will start.
  5. End Range - Scalar, representing the end of the range at which the gradient will end.

It has 2 output ports:

  1. Gradient - this is a 1-channel texture connected to the Gradient input. You'd use this to connect to the next Gradient Step patch.
  2. Output - this is a 4-channel texture representing the input texture, with an added color gradient in the specified range.

Learn more about using the Gradient Step patch in our example graphs.

Texture sampler

This patch allows you to sample a texture at particular coordinates.

It has 2 input ports:

  1. Texture - a 1, 2, 3 or 4-channel texture to be sampled.
  2. UV - Vector2 of the coordinates where the texture should be sampled.

It has 1 output port, Color. The output will the value sampled from the texture. It will be Scalar for 1 channel textures or Vector2, Vector3 or Vector4 for 2, 3, or 4-channel textures.

Texture transform

This patch allows you to transform a texture, for example scale or rotate it, when used with a 2D Transform Pack patch.

The Texture Transform patch has 2 input ports:

  1. Texture - input the 1, 2, 3 or 4-channel texture to be transformed.
  2. Transform - Matrix3 representing the transform to be applied, depending on the input from the 2D Transform Pack patch.

It has 1 output port:

  1. Texture - the transformed texture - it will have the same number of channels as the input texture.

Learn more about using the Texture Transform patch with a 2D Transform Pack patch in our example graphs.