Halo-Effect in 3D OpenGL ES

Member
Posts: 95
Joined: 2009.09
Post: #1
Hey guys,

I wanna polisch my game a bit and i'm looking for a lightsaber-like effect.

I know I can do that easyly in 2D using a RGBA-texture.

But what about 3D?
Has anyone done something like that?

I mean just adding a slightly bigger Object around your glowing one, whose color has alpha<1 would probably look cheap.
Adding more then 1 glow-object with decreasing alpha would introduce a lot more vertices even when the object itself is just cylindrical or spherical.
Quote this message in a reply
Sage
Posts: 1,199
Joined: 2004.10
Post: #2
I would render the lightsaber geometry in the glow color into a cleared all-black fbo. Then I'd blur that FBO, then blit it back on top of the scene additively. I did this recently (http://shamyl.zakariya.net/screenshots/S...-22-02.png) to draw debug overlays for physics.

That being said, I don't know what kind of shaders are available on iphone. If at all.

If shaders aren't available, you could probably fake blur by drawing the fbo on top of the scene several times, jittered. Say 16 times with the alpha decreasing by distance of the jitter.
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #3
A pretty cheap and effective way to do it without shaders is to just blend a bunch of planes around it. Lots of older games did this and it looks quite good.

Good looking glowing light pulse thing:
[Image: Shot00002.jpg]

If you intersect the camera with it, you can see how it's done.
[Image: Shot00003.jpg]

It looks pretty good even at fairly steep angles too.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Member
Posts: 95
Joined: 2009.09
Post: #4
Thanks guys, the idea to overlay several planes with different angles sounds promising. I'm going to try this and post a screenshot here when I'm finished.
Quote this message in a reply
Member
Posts: 177
Joined: 2002.08
Post: #5
Just a warning, it's very easy to hit the fillrate limit of the pre-3GS mobile devices doing this sort of thing (especially if you try to run processing passes on auxiliary buffers). The 3GS has power to spare if that's all you're targeting, though.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Temple Run Magnet Effect anmetv 2 896 Dec 1, 2013 05:24 PM
Last Post: JustinFic
  Using blending for a text fading effect. cjcaufield 2 4,116 Jun 30, 2010 08:21 PM
Last Post: cjcaufield
  How to do a Quick, Dirty bloom effect FAST! Oddity007 12 7,532 May 9, 2009 09:42 AM
Last Post: aardvarc
  malloc particle effect (glDrawArray) Graphic Ace 1 2,979 Mar 15, 2009 03:13 PM
Last Post: maximile
  Turning Page Effect with OpenGl ReSuMa 3 5,352 May 12, 2007 05:57 AM
Last Post: ReSuMa