I’ve just been replying to a comment about my game on Gameprojects.com, but I got thinking I should really blog this one.
Synthcat suggested I do some Additive blending for the bullets (trails?).
I’ve tinkered with Additive blending but haven’t had much success with it yet. I had a go at making my clouds, smoke and explosions use Additive blending but I just couldn’t get them to look acceptable.
I followed Eli Tayrien’s (XNA team) great article about Additive blending.
As Eli mentions, the art assets themselves (textures) need special skill to look right with additive. I haven’t figured out quite how I should be producing them. Even my colorful explosions ended up looking like a white glare. Likewise for my smoke, which should darken rather than lighten as it gets thicker.
So far, I haven’t had much luck in finding a good explanation on how to produce good art for Additive blending.
Can anyone point me in the right direction?
June 21st, 2007 at 5:41 pm
Now I don’t really know much about additive blending, but if you wanted your smoke to get darker as it thickens, shouldn’t you be doing the additive blending in reverse? I think the formula would be:
source_color + destination_color – 1.0
where the colors are in the range [0..1] . So then use bright gray textures… dunno if that produces good results, but I think it’s worth a try.
Also, a lot of photo editing tools like Photoshop or Gimp allow you to blend layers additively, so you could use that to play around and find what works.
June 21st, 2007 at 7:18 pm
Hmmm… I hadn’t thought of that. Additive, but not additive. Subtractive!
Thanks Pekuja.
June 21st, 2007 at 11:55 pm
Just make your source images dimmer.
June 22nd, 2007 at 6:25 am
I think I tried that, but I’ll have another go. From memory things tended to lose their nice colors.
Are there any techniques to employ with the Alpha channel for Additive blending?
For instance, should any of the Alpha channel be 100% opaque? In the end I suppose it’s always going to depend on the result you want.
I want my Explosions to be fairly Opaque, but I still want the colors to be rich.
June 28th, 2007 at 12:58 am
I support Pekuja’s idea of using a “subratctive” technique but I am curious if you have to turn the expression the other way around to: 1 – (source_color + destination_color)? That way as the result of adding source_color and destination_color gets brighter the end result will diverge towards 0 (dark).
It would be interesting to see some example code on this.
Air Legends sounds really interesting, will have to try it out when I get home!
July 4th, 2007 at 4:52 pm
Thanks.
Looking forward to giving these ideas a try.