How can I create glowing lines with TGB? (example inside)
by John Klimek · in Torque Game Builder · 05/19/2007 (11:15 pm) · 28 replies
I'm trying to create a retro/vector-art 2D that has glowing lines like Defcon or a game called Project Vex...
Here are some screenshots:
http://devimg.net/?Post=448
http://www.introversion.co.uk/defcon/about/screenshots.html
How can I achieve this effect in TGB?
Thanks,
John
Here are some screenshots:
http://devimg.net/?Post=448
http://www.introversion.co.uk/defcon/about/screenshots.html
How can I achieve this effect in TGB?
Thanks,
John
About the author
Recent Threads
#2
I do own the Pro version but I really don't know how to do what you're saying... (it sounds like it involves rendering to a texture)
Anybody else know of another way to do this or have the code I can add to my TGB source? :(
05/21/2007 (4:29 am)
Thanks for the reply...I do own the Pro version but I really don't know how to do what you're saying... (it sounds like it involves rendering to a texture)
Anybody else know of another way to do this or have the code I can add to my TGB source? :(
#3
05/21/2007 (4:46 am)
Could you not overlay your non-glowing line with another blurry line using blending to make it glow? That's what I would try.
#5
05/21/2007 (7:18 am)
@Matt: How would you draw a blurry line? I'd be interested in that too.
#6
05/21/2007 (7:42 am)
Use photoshop, draw a line, put a glow/blur effect on it?
#7
Would I just draw a white blurry line in photoshop and then somehow change the white to a different color? (is that using "light" blending or something?)
I'd still be interested in the best looking way to do this... (maybe this is it?)
If anybody has time, please checkout that Project Vex (the first screenshot I linked to in my original post). They have the glow effect PERFECT. (I've e-mailed the author asking how he did it but he isn't responding...)
05/21/2007 (7:51 am)
Can you change the color of it then?Would I just draw a white blurry line in photoshop and then somehow change the white to a different color? (is that using "light" blending or something?)
I'd still be interested in the best looking way to do this... (maybe this is it?)
If anybody has time, please checkout that Project Vex (the first screenshot I linked to in my original post). They have the glow effect PERFECT. (I've e-mailed the author asking how he did it but he isn't responding...)
#8
05/21/2007 (8:37 am)
It looks like he's using an actual glow rendering effect. i think to fake it you'd have to make use of a lot of alpha transparent sprites. combinations of solid colors and then a partially transparent color overtop, and wider. i'm just tossing ideas as i've never tried to accomplish this with just artwork. and i'm no artist :)
#9
05/21/2007 (9:12 am)
@Matt: No the effect in this game is made using an in-engine algorithm... I have played it so I can tell. And that's why I tried to explain how to do it without using textures. :)
#10
Anyways, you're saying that he probably did it the way you described? (eg. render to a texture and blur it)
I'd really like to duplicate that *exact* effect (eg. how nice it looks), so I'll have to read into how to render to textures and blur them... (I only know basic, basic OpenGL so I'm in for a long road!)
05/21/2007 (9:21 am)
@Oliver: Thanks for checking into it :) (the game is pretty basic but also pretty fun, no?)Anyways, you're saying that he probably did it the way you described? (eg. render to a texture and blur it)
I'd really like to duplicate that *exact* effect (eg. how nice it looks), so I'll have to read into how to render to textures and blur them... (I only know basic, basic OpenGL so I'm in for a long road!)
#11
05/21/2007 (10:22 am)
Blurring textures with OpenGL is a very expensive (slow!) computation. Unless you use shaders, which you can't in TGB. So if there is any way you can fake it you probably should. Maybe try some blending and layer trickery.
#12
05/21/2007 (11:08 am)
I belive you, but if the guy from Project Vex can do it (and his game runs lightning fast on my super-old laptop), then it must be possible :)
#13
There has been a resource for that in a different language I used which has OpenGL 1.2 / DX7 based 2D rendering
what you use to do this is missuse the OpenGL linewidth and/or triangle strips depending on your need.
05/21/2007 (12:55 pm)
Yes it is possible.There has been a resource for that in a different language I used which has OpenGL 1.2 / DX7 based 2D rendering
what you use to do this is missuse the OpenGL linewidth and/or triangle strips depending on your need.
#14
05/21/2007 (1:26 pm)
@Marc: Which other language are you referring to? (feel free to send me an email if you want, jklimek@gmail.com).
#15
http://farm1.static.flickr.com/192/508598078_193b76988d_o.png
Basically, I drew the screen, created a 1/20th version of the screen, then stretched the 1/20 version of the screen onto the existing screen and used a LIGHTBLEND mode with 80% alpha.
Even if I change the scale factor (eg. 1/20th) or the alpha value it doesn't look very good.
(By the way, I'm doing this in another language to get the concept right and then I'll try to convert into the monster TGB code :))
05/21/2007 (5:56 pm)
Well, I tried doing the shrink-and-expand blur method but I have really bad results:http://farm1.static.flickr.com/192/508598078_193b76988d_o.png
Basically, I drew the screen, created a 1/20th version of the screen, then stretched the 1/20 version of the screen onto the existing screen and used a LIGHTBLEND mode with 80% alpha.
Even if I change the scale factor (eg. 1/20th) or the alpha value it doesn't look very good.
(By the way, I'm doing this in another language to get the concept right and then I'll try to convert into the monster TGB code :))
#16
What you would do is use actual polygons with a "glowing line texture" (gray scale) that is drawn instead of the line. This texture then can be blended as needed and tinted in the desired color to match any kind line effect you want.
What you would need to do is draw all those object with this new line routine.
So in the end for something like defcon you simpler create the sprites upfront with that and create an overlay sprite that is set to additive blend mode to brighten up the underlaying "line like art" to make it glow for example (or whatever effect you want to achieve)
05/22/2007 (12:59 am)
The other language I'm referring too is BlitzMax and the source I'm talking of is Indiepaths glowing polygon module.What you would do is use actual polygons with a "glowing line texture" (gray scale) that is drawn instead of the line. This texture then can be blended as needed and tinted in the desired color to match any kind line effect you want.
What you would need to do is draw all those object with this new line routine.
So in the end for something like defcon you simpler create the sprites upfront with that and create an overlay sprite that is set to additive blend mode to brighten up the underlaying "line like art" to make it glow for example (or whatever effect you want to achieve)
#17
05/22/2007 (1:08 am)
@John: I have played it along time ago already. ;) Anyway... instead of doing wild guessing, how about just asking the author of that game politely? ;)
#18
@Oliver: I've e-mailed him over a week ago but I never received any response... :(
05/22/2007 (4:36 am)
@Marc: I also own BlitzMax and I have tried IndiePath's module. The result is not that bad... I don't think it looks quite as nice as the effect in Project Vex (eg. real bloom effect) but it's one of my options I suppose...@Oliver: I've e-mailed him over a week ago but I never received any response... :(
#19
(not fully true but faking it needs a good graphics card, most likely a better one than using shader 1.1)
You would need to use TGBX which has shader support and when I remember correctly, even a bloom effect present.
05/22/2007 (5:27 am)
True bloom effects are only possible through shader and thus not possible with TGB.(not fully true but faking it needs a good graphics card, most likely a better one than using shader 1.1)
You would need to use TGBX which has shader support and when I remember correctly, even a bloom effect present.
#20
Been trying to do some kinda trail much like this with sprites rotated to align to the path with less than decent results. As I've just learnt/learning TGB scripting digging into the source is a little bit over my head just now.
Thanks
05/25/2007 (1:01 pm)
I've been trying to do similar things, sorry to take this thread into a slightly different way.. but is there still no easy way to draw a simple line from XY to X2Y2 without the pro version?Been trying to do some kinda trail much like this with sprites rotated to align to the path with less than decent results. As I've just learnt/learning TGB scripting digging into the source is a little bit over my head just now.
Thanks
Torque Owner Jemand den es nicht gibt
Render the scene once and blur it, then render the scene again ontop of the blurry one. The blurring is the semi-hard part. One blur algorithm I know goes like this:
Render the scene to a lower resolution and stretch it to the original resolution and maybe lower the alpha value. But I cannot say if this is state of the art. ;-)