This is based largely on https://github.com/mitay-walle/com.mitay-walle.gradient-texture/tree/main, but with both runtime and editor code mostly rewritten to add new features, fix warnings and build errors and cleaner separate the code (fleity).
Unity gradient texture generator, Texture2D-Gradient generated in Editor by ScriptableObject with Gradient-properties.
Usage example video ( Youtube )
Shader in example based on this, can be downloaded here
You can't expose gradient to material inspector
You are forced to use Texture2D-based gradients
While designing VFX using gradients you need to tweak colors and positions, according to vfx timings/size etc, what makes you:
- optional pause vfx
- optional make screenshot
- switch Photoshop or rearrange windows to have both (Photoshop and Unity) visible on screen together
- tweak Gradient as is in Photoshop or according to screenshot, or according to Unity-view
- save file
- switch to Unity window 1-2-3 times to reimport Texture or reimport by hand (if Playmode is active?)
- check visual changes
- repeat all
Texture2D-Gradient generated dynamically during Editor-time by a ScriptableObject with Gradient-properties
I. Exposed in shader graph as Texture2D
II. faster iteration with no need to switch to Photoshop, rearrange windows, save file, reimport etc.