How to add glowing effect to a line for OpenGL?

joi picture joi · Nov 28, 2011 · Viewed 26.2k times · Source

How can I add a glowing effect to a line that I draw? I'm using OpenGL for Linux.

Answer

karlphillip picture karlphillip · Dec 29, 2012

You can implement the radial blur effect described on Nehe Lesson 36. The main idea is to render the drawing to a texture, and do that N times with a small offset after each render, until the drawing is ready to be copied to the framebuffer.

I've written a small demo that uses Qt and OpenGL. You can see the original drawing (without the blur) below:

enter image description here

The next image shows the drawing with the blur effect turned on:

enter image description here

I know it's not much, but it's a start.