Qbasicnews.com

Full Version: particle explosions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
You know the effect in the nehe particle tutorial, where the particles(the circle textures) seem to blur into one another when in close proximity? How would this effect be achieved in yagl?
By using a shaded alpha value

For example, you have your particle, which is a square, and a single color (for simplicity as im a lazy typer)

Now, the alphachannel of that particle, is set to be a "sphere"
That is 255 in the center, and fading outwards in a circular pattern

When two particles overlap their alphavalues are now added, and they "blur" into each other..


If you cant figure it out let me know and I'll whip together a small demo/sample.. I'm kind of busy though, so I'd appreaciate if you only asked for an example if you really couldnt figure it out.. or if someone else made it..
so I'd need to adjust the alpha channel of the bitmap? ok

EDIT:

Well I'm pretty much lost doing this...
Easiest way to do this, is to load it into memory, in a 32bit context, then change the alpha by adding ALPHA*&H1000000

Assuming the pixel does not already have alpha set
would you happen to have any sprites hanging around that already have the alpha value set?
Sadly, no, I change the alpha on loading..

What you can do is load the sprite with regular BLOAD, assuming the sprite is a BMP, and that you've set screen mode to 32bit dummy mode (last screen flag at -1)

After you've loaded it, you scan through the image buffer (in memory) in integer steps (32bit)
Each step, you add ALPHA*&H1000000
Where alpha is the desired alpha value for that pixel..
what a pain in the ass
Quote:what a pain in the ass
Haha, you could also edit the alpha in a drawing program, such as GIMP or photoshop
Saving it as a 32bit bmp, or some other 32bit format that is RGBA
sounds like a plan. Thanks!

EDIT:
GraphicsGale Free edition allows me to add an alpha value. Yay! But for some reason my particles always appear as a colour that's different to the square I painted them as... what kind of rgb values would I need to create "fireballs" ?