Get Started

Inspector Properties

Property
Type
Default
Description

gradient

Gradient

β€”

The gradient used to generate the texture.

savingPath

string

/LKHGames/GradientTextureGenerator/GeneratedTexture/

Path under Assets/ where baked textures are saved. Change this before updating the plugin.

width

float

256

Width of the generated texture in pixels.

height

float

64

Height of the generated texture in pixels.

rotate90

bool

false

If true, samples the gradient vertically instead of horizontally.

Workflows

Bake texture to disk

  1. Add GradientGenerator to a GameObject

  2. Set the gradient

  3. Optionally set savingPath (recommended if you might update/delete the plugin)

  4. Set width, height, and rotate90 as needed

  5. Choose textureFormat

  6. Click "Generate Gradient Texture" in the Inspector

Output files are named GradientTexture_<random>.png or .jpg and saved under Assets + savingPath

Live gradient on material (Play mode)

  1. Expose a texture property in your shader and note its reference name

  2. Assign propertiesName with that reference name

  3. Assign the materialRenderer

  4. Set onPlayMode :

    1. Off – no runtime updates

    2. UpdateOnStart – updates once at start

    3. UpdateEveryFrame – updates every frame (for animating gradients)

Last updated