PDA

View Full Version : How can I create nice looking 2D glowing lines?



sofakng
19-05-2007, 05:38 PM
I'm trying to create a very simple 2D game that uses retro vector graphics like in the games Defcon and Project Vex. The effect I'm trying to get is glowing lines and the transparent color inside of a color.

See the screenshots here:
http://devimg.net/?Post=448
http://www.introversion.co.uk/defcon/about/screenshots.html

I'd like to game to be playable on shader model v1.3 or lower graphics cards so most bloom effects won't work...

So... my question is this:

Is it possible to have glowing lines on a video card that only supports pixel shader model v1.3 or lower? I'm open to using any graphics API as long the effect is somewhat easy to create and looks really nice :)

If there isn't a nice way to do this on shader model 1.3 cards, what is the easiest/best way to do it on SM2.0 cards?

Thanks,
John

JernejL
19-05-2007, 07:01 PM
use a texture for glowing line.

sofakng
19-05-2007, 08:20 PM
Thanks for the reply!

I'm a little confused though... can you explain a little more?

JSoftware
19-05-2007, 08:21 PM
You could render lines to a temporary render-to-texture buffer. This buffer you then blur using some gaussian blur scheme. Then just add it using additive blending after your last pass.

Keywords: P-Buffer, FBO(Framebuffer Object), gaussian blur, draw buffers

This may be overkill though. You could, as Delfi, suggested use a texture

deathshadow
23-10-2007, 04:48 AM
Well, if you were working in OpenGL or DirectX you could draw the line (or multiple lines) two or three times using glLineWidth (or the directX equivalent) to make it narrower, varying the transparancy as you go.

If you had a sprite mapped out as a single set, you could render it multiple times in varying widths and transparancies to do the whole thing a hair faster/more efficient than one line at a time as well.

OpenGL actually makes REALLY SWEET 2d vector games.

User137
24-10-2007, 01:14 AM
Like Delfi mentioned, textured quads work nice. Simple 8x8 texture for example that has white middle and fading to black up and downwards.

If using OpenGL, this sets a nice additive blend mode on:
glBlendFunc(GL_SRC_ALPHA,GL_ONE);