CosineGradient is a small package for generating cosine-based gradients in Unity.
The idea of cosine-based gradients is based on an article written by Íñigo Quílez. See the original article for further details.
Download and install the unitypackage.
CosineGradient object can be created from the Create menu (Create -> Cosine Gradient). The coefficients of CosineGradient can be interactively edited on the inspector.
There is just a single method in the
CosineGradient class --
Evaluate returns a color value at a given point in a gradient.
The editor preview shader can be referred as an example of evaluating a gradient in a shader. Note that the coefficient vectors (_CoeffsA/B/C/D) should be given from a script.