Easy way to make fancy glowing vector lines?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
JamesGecko
Prole
Posts: 8
Joined: Sat Jan 31, 2009 7:10 pm

Easy way to make fancy glowing vector lines?

Post by JamesGecko »

I'm messing around with the basics of a vector game, sort of like Asteroids, Bitfighter, or Geometry Wars. For optimum coolness factor, I'm trying to figure out a convenient way to make the lines sort of shimmer or glow, like they did on those old arcade screens.

Kenta Cho uses the effect a lot in his games, but from his source code, it looks like he makes some OpenGL calls to accomplish it. Does Love has access to this stuff, or do I need to use an external library or something?

A non-OpenGL method of doing this seems to be to copy a portion of the drawing surface, blur it (maybe increase saturation?), then slap it down right before the next drawn frame. The blur has to be very efficient though; otherwise things start crawling. I'm looking at Love's documentation though, and I don't see an easy way to do that, either. Am I missing something?
http://www.blackpawn.com/texts/blur/default.html
http://incubator.quasimondo.com/process ... stblur.pde

Thanks!
User avatar
Kaze
Party member
Posts: 189
Joined: Sat Jul 19, 2008 4:39 pm
Location: Dublin, Ireland

Re: Easy way to make fancy glowing vector lines?

Post by Kaze »

JamesGecko wrote:I'm messing around with the basics of a vector game, sort of like Asteroids, Bitfighter, or Geometry Wars. For optimum coolness factor, I'm trying to figure out a convenient way to make the lines sort of shimmer or glow, like they did on those old arcade screens.

Kenta Cho uses the effect a lot in his games, but from his source code, it looks like he makes some OpenGL calls to accomplish it. Does Love has access to this stuff, or do I need to use an external library or something?

A non-OpenGL method of doing this seems to be to copy a portion of the drawing surface, blur it (maybe increase saturation?), then slap it down right before the next drawn frame. The blur has to be very efficient though; otherwise things start crawling. I'm looking at Love's documentation though, and I don't see an easy way to do that, either. Am I missing something?
http://www.blackpawn.com/texts/blur/default.html
http://incubator.quasimondo.com/process ... stblur.pde

Thanks!
I don't quite understand what you mean, but if you want to change the alpha of something for a "pulse" effect, use:

Code: Select all

math.sin(os.clock())*255
for the alpha
User avatar
rude
Administrator
Posts: 1052
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: Easy way to make fancy glowing vector lines?

Post by rude »

If it's glowing, it probably involves additive blending. [love.graphics.setBlendMode(love.blend_additive)]

http://love2d.org/demos/particles.love
JamesGecko
Prole
Posts: 8
Joined: Sat Jan 31, 2009 7:10 pm

Re: Easy way to make fancy glowing vector lines?

Post by JamesGecko »

I was going for an effect sort of like this or this.

There seems to be very little difference between the love.blend_additive and love.blend_normal modes on my Intel graphics card. It looks like it just makes lines a little smoother. Maybe I'm not using it properly? The glowing particles demo looked pretty neat.

Using Kaze's pulse with love.color_modulate looks pretty neat, but it's still not exactly what I was going for.

More techniques for glowyness:
In GridWars, they appear to just prerender everything as sprites with the glowy effect, but I'd rather have the flexibility offered by vectors rather than manipulate sprites.
User avatar
zapwow
Prole
Posts: 48
Joined: Fri Oct 24, 2008 11:37 pm

Re: Easy way to make fancy glowing vector lines?

Post by zapwow »

Hi JamesGecko,
Unless you have several items on-screen in the same area, the additive effect will not be much different from the normal blend mode.
I think you might be able to achieve your desired effect by rendering your object multiple times. See attached.
Attachments
linesTest.love
(6.92 KiB) Downloaded 482 times
User avatar
rude
Administrator
Posts: 1052
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: Easy way to make fancy glowing vector lines?

Post by rude »

I also made this demo to showcase additive blending. You should be able to make some pretty cool effects with lines + additive blending alone, but it will take some work.

http://love2d.org/demos/glow.love
JamesGecko
Prole
Posts: 8
Joined: Sat Jan 31, 2009 7:10 pm

Re: Easy way to make fancy glowing vector lines?

Post by JamesGecko »

Ah, excellent. Thanks for your help. :-)
User avatar
counterfactual_jones
Prole
Posts: 24
Joined: Mon Feb 09, 2009 10:14 am

Re: Easy way to make fancy glowing vector lines?

Post by counterfactual_jones »

zapwow wrote: I think you might be able to achieve your desired effect by rendering your object multiple times. See attached.
*Yoink*
Lesbian Viking
Prole
Posts: 5
Joined: Mon Feb 22, 2010 1:00 am

Re: Easy way to make fancy glowing vector lines?

Post by Lesbian Viking »

rude wrote:I also made this demo to showcase additive blending. You should be able to make some pretty cool effects with lines + additive blending alone, but it will take some work.

http://love2d.org/demos/glow.love
Anywhere I can get this demo now?
User avatar
Nephilim
Prole
Posts: 9
Joined: Tue Feb 16, 2010 3:00 pm
Location: Netherlands

Re: Easy way to make fancy glowing vector lines?

Post by Nephilim »

Without pretending to know what I'm talking about:

Couldn't you surround the line with particles with a certain alpha value? :brows:
Programming is an art form that fights back.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest