gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Graphics > Glowing sprites?

#54304 - paladine - Sat Sep 17, 2005 11:29 pm

I want to achieve an effect similar to Final Fantasy games where a character has a status boost and he begins to glow. I havn't ever done this effect before in any of my GBA games so I was wondering how I should proceed. It seems to me that I could do some math on the palette to achieve the glowing effect. Is this the typical way or is there some GBA hardware support for doing this sort of thing?

#54306 - poslundc - Sat Sep 17, 2005 11:56 pm

You can do it with the hardware if you want, using the effects register to adjust the brightness of the sprite up or down. The only problem with this technique is that there's only one effects register for the entire GBA, which basically means the following:

- While you can apply it to multiple sprites if you so choose, they must all be glowing in the same pattern.

- You won't be able to use the register for other effects at the same time, such as alpha-blending of backgrounds.

For this reason many game designs opt to do palette tweening, where you have basically two versions of your palette in memory: the starting version and the ending version, and an animation counter that determines what proportions with which to combine the two. Then every VBlank you update the actual hardware palette to reflect the appropriate combination of your two work-palettes.

Such a system can be as complicated or simple as you like... for example, if you have different sprites using different 16-colour subsets of the palette, you might have routines to tween only one 16-colour subset of the entire palette.

Dan.

#54317 - DiscoStew - Sun Sep 18, 2005 6:57 am

Yes, just like poslundc said, manipulate the palette of the sprites to do this. To get this glow effect, all it takes is a simple change to 1 color on the palette. If you plan to have this same effect done over multiple sprites, I suggest you make sure that the palette arrangement of all the sprites that will use this technique will be similar, with this specific color (in the Final Fantasy games, it's the darkish border surrounding the character) always being the same index with the rest of the sprites.

Once you have your sprite cels and palettes loaded, all you do is change the color for that index, and it should do the trick, no matter which sprite you use for that effect.

Just like the "I'm about to attack" coloring of the monsters changes from their normal color to a black with white outline, it's all dependant on the arrangement of the palette, and changing the necessary indexes (not exact colors themselves) to get the effect to work.
_________________
DS - It's all about DiscoStew