Fading out a line


Quick question. I’ve got a stippled line and am trying to make it so it fades out (so alpha is 1 at one end and 0 at the other). Is there a nice easy way of doing this?


Setting a different alpha value at each vertex?

No that just seems to make the whole thing transparent (when one vertex A=1.0, the second A=0.0). Btw Im using (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) as by glBlend arguments.

Do you have smooth shading enabled?

Yep I do.

Ah no I dont, I thought I’d done so but it wasn’t in my code when I checked.

Thanks for the help!.