How to draw glowing edges in OpenGL ES
Hi,
I'd like my geometry to be drawn like in Geometry Wars (check the picture below) although I'm not going to have so many objects on screen. I'm drawing GL_LINE_LOOPS and don't use textures at all (well, except for fonts), and I don't know how to achieve that glow effect. My guess is that I'm going to need some kind of post-processing, but there's maybe a simpler way to do it. Any suggestions? I'd like to avoid using textures if possible.
I'd like my geometry to be drawn like in Geometry Wars (check the picture below) although I'm not going to have so many objects on screen. I'm drawing GL_LINE_LOOPS and don't use textures at all (well, except for fonts), and I don't know how to achieve that glow effect. My guess is that I'm going to need some kind of post-processing, but there's maybe a simpler way to do it. Any suggestions? I'd like to avoid using textures if possible.
![[Image: geometrywars.jpg]](http://img208.imageshack.us/img208/5073/geometrywars.jpg)
Use a texture. That's what they're doing.
Do you know that for sure? When you see it in high resolution (on a PC or HDTV) you can see that the lines have square ends and overlap in quite an ugly way, just like if you draw GL_LINES (or whatever the direct3d equivalent is) . I'd have thought that if they used textures they'd have sorted that.
Anyway, I'd definitely use textures for that. Any glow effect is usually done by adding a blurred version over the top of the original. So you'll probably need to use FBOs. Blurring can be done using GLSL or cheated by scaling or drawing multiple times.
EDIT: just been told that they use textures for Geometry Wars 2. Dunno about the original.
Anyway, I'd definitely use textures for that. Any glow effect is usually done by adding a blurred version over the top of the original. So you'll probably need to use FBOs. Blurring can be done using GLSL or cheated by scaling or drawing multiple times.
EDIT: just been told that they use textures for Geometry Wars 2. Dunno about the original.
If they are using textures, do they draw the enemies by just drawing quads and then applying the texture on them? Or is it a way to do it per edge? What about those sparks which are simple lines?
Maximile, what does FBO stand for? I'm kind of new to this, sorry.
Wait, I've just realised that you meant framebuffer objects and it looks that there is GL extension for that which is supported on iPhones.
Maximile, what does FBO stand for? I'm kind of new to this, sorry.

Wait, I've just realised that you meant framebuffer objects and it looks that there is GL extension for that which is supported on iPhones.
FBO stands for framebuffer object. It lets you render to a texture. So in your case you could first draw everything to an FBO, then draw that texture to the screen and also use it as the source for your blur.
I'm out of my depth talking about FBOs though, so you might want to see if anyone else has a better idea.
I'm out of my depth talking about FBOs though, so you might want to see if anyone else has a better idea.
Thanks maximile! I'll check FBOs then.
Anyway, if anyone knows of any other approaches (specially if I can avoid using textures) please let us know.
Anyway, if anyone knows of any other approaches (specially if I can avoid using textures) please let us know.

maximile Wrote:Do you know that for sure?
Generally speaking, 99 out of 100 times, when talking about OpenGL, if arekkusu says it's so, then it's so.

You guys should check out arekkusu's glAArg page.
miq01 Wrote:If they are using textures, do they draw the enemies by just drawing quads and then applying the texture on them?
Try downloading Grid Wars and looking inside the gfx/ folder. You can see that the glow is just baked into all of the textures.
An alternate way to do it is to only create glowing lines, like Shoot Things (this is my game using glAArg, so I feel I can speak definitively on how it works.)
Creating every object out of lines is more flexible, but requires a lot more geometry.
Since this in in the Phone forum where resources are constrained, you want the cheapest possible solution: use a texture.
Wow, great game , heard about it but thought it was windows only, instead it's made in blitzmax.
©h€ck øut µy stuƒƒ åt ragdollsoft.com
New game in development Rubber Ninjas - Mac Games Downloads
Thanks arekkusu! I've created some textures like the ones in Grid Wars, replaced the drawing code with the new version, and now my game looks as I wanted to.
Possibly Related Threads...
Thread: | Author | Replies: | Views: | Last Post | |
how to draw to OpenGL texture | Gillissie | 7 | 10,272 |
Apr 24, 2009 06:35 AM Last Post: AnotherJake |
|
OpenGL - how to draw background image? | SDyer777 | 1 | 10,125 |
Mar 9, 2009 11:17 AM Last Post: AnotherJake |