A FREE and simple-to-use tool for generating “live” gradient textures, which can be edited in-place, non-destructively, and the result used just like any other typical texture object in Unity. You can assign it in your shaders, read the colours via C#, copy it to a new texture, etc…
You can even also export the result as an actual PNG texture if you’d like, allowing you to integrate Photoshop, or any other image editor toolchain/workflow.
Gradient
property colour to setup the colours.Generate/Update Texture
button.
See the images below for reference…
“Gradient Tool” is a scriptable object with a perma-linked texture sub-asset.
This is the texture you can assign to shaders, sample, etc…
You can reference/assign this texture like any other object.
Nothing other than the single GradientTool.cs
script is necessary for the asset.
_*Demo
folder.You can use Resolution
to determine the width, while the height will always be 1px.
If you set the texture Filter Mode
to Bilinear
sampling, you’ll get smooth values even with a just handful of pixels (at the cost of largely or often negligible interpolation/accuracy sampling issues).
You can use the Auto Save
toggle for realtime texture updates, but it should be off otherwise.
Here is where you can make adjustments to the keys of Gradient
.
Resolution
.