Articles
Textures and Materials
UI Shader Code Asset

UI Shader Code Asset

The UI Shader Code Asset is a premade material that's great for easily creating 2D interfaces and backgrounds, simply by adjusting properties in the material.

Creating the UI Shader Code Asset

To create the UI Shader Code Asset:

  1. Create a material - ideally applied to a 2D object like a rectangle.
  2. In the Inspector, select Shader Asset, then Create UI Shader Code Asset from the dropdown next to Shader Type.

Editing the UI Shader Code Asset

Under Parameters in the Inspector, you can edit the following properties in the material, or create consumer patches to apply more complex changes:

backgroundColor

Choose a colour for the material.

borderColor

Choose a colour for the border of the material.

borderWidth

Set the width of the border.

BorderRadius

Adjust the radius of each corner of the material.

backgroundTexture

Add a texture to the material.

Render Options

The UI Shader Code Asset has the same render options as other materials in Spark AR Studio.

Was this article helpful?