How can I create a glowing line effect?

BlitzMax Forums/BlitzMax Programming/How can I create a glowing line effect?

SofaKng(Posted 2007) [#1]
I'd like to create a retro-looking 2D game and I really like the "glowing line" effect that a game called Project Vex does. Other examples of games that do this are GridWars and Defcon.

I've tried looking at the source to GridWars but the code is so large that I can't find out what I need to do this myself... (eg. all I want to do is draw a polygon that glows)

Here are screenshots of the effect I'm trying to achieve:
http://devimg.net/?Post=448
http://www.introversion.co.uk/defcon/about/screenshots.html

(the first screenshot [eg. Project Vex] is *exactly* what I'd like)

So... how can I do this myself? How can I draw a simple polygon (or line) that is glowing? (I don't care even if I have to use strict OpenGL to do this....)

Thanks,
John


Grisu(Posted 2007) [#2]
You could do some digging and use Indiepath's Textured Polys mod for this: http://www.blitzbasic.com/Community/posts.php?topic=51059


SofaKng(Posted 2007) [#3]
How would that create glowing lines? I thought that was just for creating textured polygons... (eg. the inside of the polygon)


Brucey(Posted 2007) [#4]
From an old post : HERE
Indiepath.TexturedPoly - Now independent of the Official Mods and MacOS compat, contains the New DrawGlowingLines command.



SofaKng(Posted 2007) [#5]
Thanks!

However, it looks like DrawGlowingLines command was removed from the TexturedPoly package?

I downloaded it straight from modules.indiepath.com so I'm not sure what is going on...


MrHanson(Posted 2007) [#6]
This is getting somewhat close:

Graphics 600,600
SetBlend LIGHTBLEND

While Not KeyHit(KEY_ESCAPE)

Cls
'need to play with different colors
SetColor(0,255,0)
DrawGlowLine(0,0,600,600)
DrawGlowLine(0,600,600,0)
Flip

End While


Function drawGlowLine(x1:Int,y1:Int,x2:Int,y2:Int)

SetAlpha (0.2)
SetLineWidth(5)
DrawLine(x1,y1,x2,y2)

SetAlpha(0.07)
SetLineWidth(15)
DrawLine(x1,y1,x2,y2)

End Function


Blueapples(Posted 2007) [#7]
Slight variation, pretty obvious, but it makes the lines flicker.




popcade(Posted 2007) [#8]
Well, I don't know if this helps but

http://bugdie.org/_tmp/texturedpoly.zip

Note:
use TPoly.Line() to draw it, that's the actual glowing line.


H&K(Posted 2007) [#9]
lol


SofaKng(Posted 2007) [#10]
Thanks for all of the help everybody!

It looks like I'll use IndiePath's TexturedPoly add-on... it's easy enough to use (espicially with the examples).

Thanks for all of the help :)


Tylerbot(Posted 2007) [#11]
I have a great idea regarding this that I've actually used before, and it involves using images instead.

Let's say you want a line 5 pixels thick and "glowy." So, you draw the line in photoshop as if it were only one pixel long. Meaning you create a .PNG only 1 x 5 pixels, with your most opaque pixel in the middle, and increasing transparency outward.

When you want to draw the line, you load the image, then set the handle to the middle pixel. Then you merely set the y-scale and rotation suitably, to create, in effect, a blended line from point A to point B.


TartanTangerine (was Indiepath)(Posted 2007) [#12]
Yokos got the examples in the zip file he posted.

@Tylerbot, kinda but not quite - how do you make the lines have a nice smooth round glow at the ends? Use my module it'll handle everything for you.

Here's an example of it being used :


AdrianT(Posted 2007) [#13]
hey that game reminds me of oids. Has it been released at all, demo or otherwise?


rockford(Posted 2007) [#14]
There is a commercially available version of OIDs for the Mac, but none for pc at the moment.

That game above is Thrust Extreme by Wiebo de Wit and is freely available (and it's good. Very good) :)

Read all about it and grab it from here - http://wiebo.wordpress.com/my-pc-games/


MrTAToad(Posted 2007) [#15]
I'll have to use the glowing routines for my game - looks rather good.

Unfortunately it does seem to react badly to other draw objects after it, so maybe I wont be be able to use it.


TartanTangerine (was Indiepath)(Posted 2007) [#16]
Unfortunately it does seem to react badly to other draw objects after it, so maybe I wont be be able to use it.
What does that mean? All it's drawing is 6 triangles per line and texturing them.


MrTAToad(Posted 2007) [#17]
Without my other stuff, it draw properly. However, put all my other stuff back in (pasting images, drawing other rectangles etc etc), the bottom part of the line bulges out for some reason, and it loses the glowing effect.


Tylerbot(Posted 2007) [#18]
Indiepath:
Here's an example of it being used:


Wow, that looks really slick and suitably retro. I'll take a look at your module now :)