How to draw glowing edges in OpenGL ES

Member
Posts: 36
Joined: 2009.02
Post: #1
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.

[Image: geometrywars.jpg]
Quote this message in a reply
Sage
Posts: 1,232
Joined: 2002.10
Post: #2
Use a texture. That's what they're doing.
Quote this message in a reply
Member
Posts: 283
Joined: 2006.05
Post: #3
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.
Quote this message in a reply
Member
Posts: 36
Joined: 2009.02
Post: #4
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. Smile

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.
Quote this message in a reply
Member
Posts: 283
Joined: 2006.05
Post: #5
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.
Quote this message in a reply
Member
Posts: 36
Joined: 2009.02
Post: #6
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. Smile
Quote this message in a reply
Moderator
Posts: 3,572
Joined: 2003.06
Post: #7
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. Wink

You guys should check out arekkusu's glAArg page.
Quote this message in a reply
Sage
Posts: 1,232
Joined: 2002.10
Post: #8
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.
Quote this message in a reply
Member
Posts: 749
Joined: 2003.01
Post: #9
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
Quote this message in a reply
Member
Posts: 36
Joined: 2009.02
Post: #10
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.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  how to draw to OpenGL texture Gillissie 7 7,019 Apr 24, 2009 06:35 AM
Last Post: AnotherJake
  OpenGL - how to draw background image? SDyer777 1 7,371 Mar 9, 2009 11:17 AM
Last Post: AnotherJake