Shader needed for gradients using a LineRenderer

Hi,

I have a (screenwide) LineRenderer with two different colors that I use to render a gradient background. Currently I use the Particles/Additive shader, but I'm quite sure there could be a faster solution.

Some more information :

  • It doesn't need alpha, just RGB.
  • It can ignore anything that's underneath it, so it doesn't have to be additive at all (I just use that shader now because it works)
  • No textures are needed, just the two colors

Thanks!

Line Renderers store the Start and End colors in the vertices, so you just need a shader that displays vertex colors. Here's the simplest one:

Shader "Vertex Colors" {

Subshader {
    BindChannels {
        Bind "vertex", vertex
        Bind "color", color 
    }
    Pass {}
}

}