- Home /
Question by
Smag · Nov 18, 2010 at 01:01 AM ·
shaderperformancelinerenderer
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!
Comment
Best Answer
Answer by Jessy · Nov 18, 2010 at 01:06 AM
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 {} }
}