How to do additive line drawing

Hi All,

I am having a hard time converting code to draw a vectorscope which is currently drawn with Qt using QPainter.
I can’t figure out now to get the additive line drawing effect: I am drawing a large number of “randomn” dark gray lines on top of each other and the points where they cross they should get brighter. Somehow I am not allowed to post an example image :frowning:

Thanks for you help
Markus

Are you doing alpha blending?

No, currently I am only setting glBegin(GL_LINE_STRIP) and draw using glVertex3f().
I am not sure how to use alpha blending.

If you use a black surface as base (glClearColor(0,0,0,0)), you can simply use additive blending. Meaning if you draw the value 20,20,20 two times on a pixel then the pixel will be 40,40,40. Three times will be 60,60,60 and so one…

glBlendFunc(GL_ONE, GL_ONE);
glEnable(GL_BLEND);

//your drawing

glDisable(GL_BLEND);

Thanks a lot, that worked!