2D Sprite Muzzle Flash

Blitz3D Forums/Blitz3D Programming/2D Sprite Muzzle Flash

LineOf7s(Posted 2007) [#1]
Hello there.



Hopefully there's a screenshot above. Short version: when the muzzle flash appears, I want the stuff (in this case, the tank itself) around it to 'light up' a lil, in sync.

Now, I know this has been asked before (because I've spent the last 3 hours poring over the search function and the code archives), but I can only find information on 3D stuff (usually FPS) using lights and whatnot, but I'm using 2D-in-3D Sprite Candy stuff.

I have a feeling what I'm looking for involves plopping an ellipse/circle of some kind down when the flash sprite appears, and having where that circle intersects with something-other-than-nothing having that something be 'tinted' somewhat by the colour of that circle.

I'm quite happy to learn this for myself, but right now I have little to no idea what I'm looking for. Is it something to do with blend modes? Do I need to use 'lights'? Does it involve rendering two or more times (a concept I'm still trying to get my head around)?

Please point me in the right direction. :o)


big10p(Posted 2007) [#2]
I cant see the screenie but I'm guessing you just need to use a sprite of a gradient filled circle, that gets fainter as it gets near to the edge. Additive blend that onto the scene when the muzzle flash occurs and it should work.

[edit] oh, I can see the screenie now. :)


LineOf7s(Posted 2007) [#3]
My concern (which probably involves the word 'masking' at some point) is that anything that's not 'tank' or 'scenery' or whatever, I don't want "gradiant filled circle" to appear on. At the moment I'm trying a solid white circle and additive blending it onto the scene and it appears to display 4/5ths of stuff-all. :o(

Since you mentioned 'additive blend' though, I shall bash my head against that specificness for a bit longer and see what happens.


big10p(Posted 2007) [#4]
Convo continued on IRC...


LineOf7s(Posted 2007) [#5]


Just wanted to tie up this loose end. Not quite what I envisaged, but more than good enough (better, actually).

Thanks big10p! And JuicyFonts rocks! So much enthusiasm in one post!!!!111


big10p(Posted 2007) [#6]
np :)


bytecode77(Posted 2007) [#7]
a little suggestion: play arround with the sprite blend modes
(entityblend sprite, XXX)
this might be looking more realistig. you dont really want the black area to be bright ;D


LineOf7s(Posted 2007) [#8]
Devils Child:

Thanks, but I'm not sure I understand your suggestion. I'm using Sprite Candy, but via that it's using EntityBlend sprite, 3 in order to provide the additive blending that makes that effect. Any other blend mode (ie Alpha (1) or Multiply (2)) just doesn't work.

And getting the black area to be bright is exactly what I was trying to achieve... It's only going to be 'black' until I stick the tile-based ground underneath it - which I'll also want to be lit up by the muzzle flash when it goes off.

Won't I?