Skip to content

mcmorry/CosineGradient

 
 

Repository files navigation

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 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.

License

MIT

About

Cosine gradient generator for Unity

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 91.9%
  • GLSL 8.1%