Textures and Materials
UI Shader Code Asset

UI Shader Code Asset

A flat, cyan rectangle with a black border and rouded corners can be seen covering the Simulator and Viewport.

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:


Choose a colour for the material.


Choose a colour for the border of the material.


Set the width of the border.


Adjust the radius of each corner of the material.


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?