Support our Sponsors:

Go Back   Touch Arcade > Developer Discussion > Public Game Developers Forum

Thread Tools Display Modes
Old 06-01-2014, 09:10 AM
Umen Umen is offline
Junior Member
iPhone 5, iOS 7.x
Join Date: Dec 2013
Posts: 2
Default How to make glow effect in cocos2dx

i searching the web for glowing effect , i like to be able to create misc glowing effects ,
like lasers , glow around sprites and such .
couldn't find any thing on the web , any body have any direction ?
something like this :

Last edited by Umen; 06-01-2014 at 09:28 AM..
Reply With Quote
Old 06-01-2014, 11:55 AM
cadaei cadaei is offline
iPhone 5, iOS 6.x
Join Date: Apr 2013
Location: Seattle
Posts: 45

One simple way is to make a copy of the sprite image. Change it all to white. Apply a nice blur to it (all of that in a graphics program), then add the glow sprite behind the main sprite.

If you use white, then in code you can simply tint the glow to whatever color you need.
Reply With Quote
Old 06-01-2014, 01:26 PM
Umen Umen is offline
Junior Member
iPhone 5, iOS 7.x
Join Date: Dec 2013
Posts: 2
Default Good idea

i was wandering if it can be done combining shaders , what is better ?
Reply With Quote
Old 06-02-2014, 04:35 AM
Rogue's Avatar
Rogue Rogue is online now
Join Date: Feb 2011
Location: Brisbane, Australia
Posts: 53

Blur shaders can be hefty due to needing to do multiple samples of a texture (depending on the size of the blur) and you also need to account for the fragments in the sprite (number or samples x number of fragments). On a desktop GPU this is not an issue but on a mobile it adds up fast. I did a basic one way blur effect recently and only got to 4 samples before it started getting a bit dicey on an iPad 2.

Your best move (as noted above me) is to preprocess the glow effect in a sprite. Now, whether you do that as an art asset or by using a blur shader to render to an FBO (do it during startup) is up to you. Easiest way is an art asset.

Last edited by Rogue; 06-02-2014 at 04:39 AM..
Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Copyright 2012,, LLC.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2015, vBulletin Solutions, Inc.
Copyright 2008 - 2011, Privacy Policy / DMCA Copyright Agent