opengl glow effects

I have a little 2D something like this:

http://n4te.com/temp/ring.png

That is transparent, not gray. I’d like to make a small (maybe 16 pixels high) section of the vertical line sparkle/glow. I’d like to be able to move the glowing section up and down. If it reaches the ring, I’d like that portion of the ring to glow. So if the glow was moving up from the bottom of the screen, when it reaches the ring it would appear to split into two as it makes the ring glow, then join again and continue up after the ring.

Do you guys have any tips for how to approach/render this with OpenGL?

  1. Render the shape to the framebuffer
  2. Render the desired region (clipped / quad) of the shape to a texture.
  3. Blur the texture
  4. Render the texture to the framebuffer

Longer version of what Riven said: http://http.developer.nvidia.com/GPUGems/gpugems_ch21.html

…although personally I’d be tempted to cludge something together by creating a separate ‘glowing spot’ texture, and just drawing that in the appropriate place (or places) on top of the main image.

Simon

Ditto.

It’d really be easier (and you’d have more control over how it looks) to just make the glow effect in photoshop and then draw it behind the ring. If you need the effect to transform (change shape, etc.), just draw several frames. The only question here is how worth it it is to do that. If you need to the glow to be so adaptive that you would be drawing like 50 frames, then obviously it makes no sense to do it this way. But to me it sounds like you only need 2 frames or so.

Thanks for the approaches guys. :slight_smile:

I’d like to play around with doing an actual glow, if just for the experience. I get how to do it, except for the blur step. I’ve read about rendering at 1/4 size and then displaying that at original size to achieve a reasonable blur effect. This seems pretty straightforward. What are some other approaches to doing the blur?

Well, why only 1/4th? Use mipmapping and create N levels.

Yeah, either use mipmapping for super cheap and somewhat nasty (that’s the way I’m doing something similar atm) or a pixel shader with a proper blur, which will obviously be rather more complicated.