> For the complete documentation index, see [llms.txt](https://sebun1.gitbook.io/skins/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sebun1.gitbook.io/skins/schema/texture-macro.md).

# Texture Macro

## Overview

Texture Macros are procedural texture expressions that can be used anywhere a texture file path is accepted (i.e. the `src` field of a `Texture2D` property). They generate a texture at load time without needing an image file on disk.

Macros were originally added for quick testing but have proven genuinely useful in production — for example, a solid metallic-smoothness map, a flat normal, or a simple gradient can all be expressed in a few characters rather than shipping an extra PNG.

## Syntax

```
@NAME
@NAME(arg1,arg2,...)
@NAME(arg1,arg2,...)[width,height]
```

* The `@` prefix is required.
* Arguments and size are both optional — when omitted, sensible defaults are used (see each macro).
* **Default size** is `4×4` pixels. Larger sizes rarely improve quality for solid-color macros, but may matter for gradients or checkerboards.
* Size values must be positive integers.
* The macro name is **case-insensitive** (`@white`, `@WHITE`, and `@White` are all the same).

## Import Options

When a macro is used as the `src` of a `Texture2D` property, import options are inferred from the slot name using the same logic as file-based textures. You can override this by setting the `options` field on the property explicitly — see the [Material Target](/skins/schema/material-target.md) page.

## Quick Reference

<table><thead><tr><th width="199.5">Macro</th><th width="420.5001220703125">Signature</th><th>Notes</th></tr></thead><tbody><tr><td><code>@WHITE</code></td><td><code>@WHITE[w,h]</code></td><td></td></tr><tr><td><code>@BLACK</code></td><td><code>@BLACK[w,h]</code></td><td></td></tr><tr><td><code>@TRANSPARENT</code></td><td><code>@TRANSPARENT[w,h]</code></td><td></td></tr><tr><td><code>@NORMAL</code></td><td><code>@NORMAL[w,h]</code></td><td>Flat normal (0.5, 0.5, 1, 1)</td></tr><tr><td><code>@GREY</code></td><td><code>@GREY(value)[w,h]</code></td><td>value: 0 - 255</td></tr><tr><td><code>@RGBA</code></td><td><code>@RGBA(r,g,b,a)[w,h]</code></td><td>channels: 0 - 1</td></tr><tr><td><code>@RGBA32</code></td><td><code>@RGBA32(r,g,b,a)[w,h]</code></td><td>channels: 0 - 255</td></tr><tr><td><code>@HSL</code></td><td><code>@HSL(h,s,l)[w,h]</code></td><td>h: 0 - 360, s/l: 0 - 100</td></tr><tr><td><code>@METALLIC_SMOOTHNESS</code></td><td><code>@METALLIC_SMOOTHNESS(metallic,smoothness)[w,h]</code></td><td>metallic/smoothness: 0 - 1</td></tr><tr><td><code>@CHECKER</code></td><td><code>@CHECKER(r1,g1,b1,a1,r2,g2,b2,a2,cells)[w,h]</code></td><td></td></tr><tr><td><code>@GRADIENT_H</code></td><td><code>@GRADIENT_H(r1,g1,b1,a1,r2,g2,b2,a2)[w,h]</code></td><td>left → right</td></tr><tr><td><code>@GRADIENT_V</code></td><td><code>@GRADIENT_V(r1,g1,b1,a1,r2,g2,b2,a2)[w,h]</code></td><td>bottom → top</td></tr></tbody></table>

Size (`[w,h]`) is optional on all macros; defaults to `4×4`.

## Macro Reference

### Solid Color

These macros take no arguments and produce a uniform solid texture.

<table><thead><tr><th width="148.3333740234375">Macro</th><th width="182.166748046875">Pixel value</th><th>Description</th></tr></thead><tbody><tr><td><code>@WHITE</code></td><td><code>(1, 1, 1, 1)</code></td><td>Solid white</td></tr><tr><td><code>@BLACK</code></td><td><code>(0, 0, 0, 1)</code></td><td>Solid black</td></tr><tr><td><code>@TRANSPARENT</code></td><td><code>(0, 0, 0, 0)</code></td><td>Fully transparent</td></tr><tr><td><code>@NORMAL</code></td><td><code>(0.5, 0.5, 1, 1)</code></td><td>Default flat normal map</td></tr></tbody></table>

```
"src": "@NORMAL"
"src": "@WHITE[1,1]"
```

### `@GREY`

Solid grey texture. `value` is in the `0`–`255` range. Defaults to `128` (mid-grey) when omitted.

#### Signature

```
@GREY(value)
```

<table><thead><tr><th width="97">Param</th><th width="108">Range</th><th>Description</th></tr></thead><tbody><tr><td><code>value</code></td><td>0 - 255</td><td>Brightness level</td></tr></tbody></table>

#### Example

```
"src": "@GREY(200)"
```

### `@RGBA`

Solid color with channels in the `0`–`1` range (floating-point).

#### Signature

```
@RGBA(r,g,b,a)
```

<table><thead><tr><th width="90">Param</th><th width="94">Range</th><th>Description</th></tr></thead><tbody><tr><td><code>r</code></td><td>0 - 1</td><td>Red</td></tr><tr><td><code>g</code></td><td>0 - 1</td><td>Green</td></tr><tr><td><code>b</code></td><td>0 - 1</td><td>Blue</td></tr><tr><td><code>a</code></td><td>0 - 1</td><td>Alpha</td></tr></tbody></table>

#### Example

```
"src": "@RGBA(1,0.2,0.2,1)"         // semi-transparent red
"src": "@RGBA(0,0,0,0.5)"           // 50% transparent black
```

### `@RGBA32`

Solid color with channels in the `0`–`255` integer range. Otherwise identical to `@RGBA`.

#### Signature

```
@RGBA32(r,g,b,a)
```

<table><thead><tr><th width="106.5">Param</th><th width="123.5">Range</th><th>Description</th></tr></thead><tbody><tr><td><code>r</code></td><td>0 - 255</td><td>Red</td></tr><tr><td><code>g</code></td><td>0 - 255</td><td>Green</td></tr><tr><td><code>b</code></td><td>0 - 255</td><td>Blue</td></tr><tr><td><code>a</code></td><td>0 - 255</td><td>Alpha</td></tr></tbody></table>

#### Example

```
"src": "@RGBA32(255,51,51,255)"      // same red as above
```

### `@HSL`

Solid color specified in HSL. Converted to RGBA internally.

#### Signature

```
@HSL(h,s,l)
```

<table><thead><tr><th width="110.5">Param</th><th width="120.1666259765625">Range</th><th>Description</th></tr></thead><tbody><tr><td><code>h</code></td><td>0 - 360</td><td>Hue (degrees)</td></tr><tr><td><code>s</code></td><td>0 - 100</td><td>Saturation (%)</td></tr><tr><td><code>l</code></td><td>0 - 100</td><td>Lightness (%)</td></tr></tbody></table>

#### Example

```
"src": "@HSL(210,80,40)"            // dark blue
"src": "@HSL(0,0,50)"               // neutral mid-grey
```

### `@METALLIC_SMOOTHNESS`

Produces a metallic-smoothness map compatible with the standard Unity HDRP/Lit packing: `R` = metallic, `G` = smoothness, `B` = 0, `A` = 1. Both parameters are in the `0`–`1` range.

#### Signature

```
@METALLIC_SMOOTHNESS(metallic,smoothness)
```

<table><thead><tr><th width="150">Param</th><th width="119">Range</th><th>Description</th></tr></thead><tbody><tr><td><code>metallic</code></td><td>0 - 1</td><td>Metallic value</td></tr><tr><td><code>smoothness</code></td><td>0 - 1</td><td>Smoothness value</td></tr></tbody></table>

#### Example

```
"src": "@METALLIC_SMOOTHNESS(0.9,0.5)"
```

### `@CHECKER`

Checkerboard pattern alternating between two RGBA colors. All color channels are `0`–`1`. The `cells` argument controls how many checker cells appear across the texture. All arguments are optional and default to white/black with 2 cells.

#### Signature

```
@CHECKER(r1,g1,b1,a1, r2,g2,b2,a2, cells)
```

<table><thead><tr><th width="152.5">Param</th><th width="131">Range</th><th width="121.5">Default</th><th>Description</th></tr></thead><tbody><tr><td><code>r1,g1,b1,a1</code></td><td>0 - 1 each</td><td>white</td><td>First color</td></tr><tr><td><code>r2,g2,b2,a2</code></td><td>0 - 1 each</td><td>black</td><td>Second color</td></tr><tr><td><code>cells</code></td><td>≥ 1</td><td><code>2</code></td><td>Number of checker divisions across each axis</td></tr></tbody></table>

#### Example

```
"src": "@CHECKER(1,0,0,1, 0,0,1,1, 4)[64,64]"   // red/blue 4×4 checker, 64px
"src": "@CHECKER"                                  // default white/black 2×2 checker
```

### `@GRADIENT_H`

Horizontal gradient (left → right) linearly interpolated between two RGBA colors. Channels are `0` - `1`. Defaults to black → white when arguments are omitted.

#### Signature

```
@GRADIENT_H(r1,g1,b1,a1, r2,g2,b2,a2)
```

<table><thead><tr><th width="152.5">Param</th><th width="131">Range</th><th width="121.5">Default</th><th>Description</th></tr></thead><tbody><tr><td><code>r1,g1,b1,a1</code></td><td>0 - 1 each</td><td>white</td><td>Left color</td></tr><tr><td><code>r2,g2,b2,a2</code></td><td>0 - 1 each</td><td>black</td><td>Right color</td></tr></tbody></table>

#### Example

```
"src": "@GRADIENT_H(0,0,0,1, 1,1,1,1)[256,4]"   // black to white, horizontal
```

### `@GRADIENT_V`

Vertical gradient (bottom → top). Same arguments as `@GRADIENT_H`.

#### Signature

```
@GRADIENT_V(r1,g1,b1,a1, r2,g2,b2,a2)
```

<table><thead><tr><th width="152.5">Param</th><th width="131">Range</th><th width="121.5">Default</th><th>Description</th></tr></thead><tbody><tr><td><code>r1,g1,b1,a1</code></td><td>0 - 1 each</td><td>white</td><td>Bottom color</td></tr><tr><td><code>r2,g2,b2,a2</code></td><td>0 - 1 each</td><td>black</td><td>Top color</td></tr></tbody></table>

#### Example

```
"src": "@GRADIENT_V(0,0,0,1, 0,0.5,1,1)[4,256]"  // black to blue, vertical
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sebun1.gitbook.io/skins/schema/texture-macro.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
