/CosineGradient

Cosine gradient generator for Unity

Primary LanguageC#MIT LicenseMIT

CosineGradient

gif

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.

Usage

Download and install the unitypackage.

A 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 gradient overlay shader example shows how to evaluate a gradient in a shader. Note that the coefficient vectors (_CoeffsA/B/C/D) should be given from a script.

License

MIT