particle explosions - Printable Version +- Qbasicnews.com (http://qbasicnews.com/newforum) +-- Forum: Qbasic "like" compilers/interpreters (http://qbasicnews.com/newforum/forum-5.html) +--- Forum: FB Discussion & Programming Help (http://qbasicnews.com/newforum/forum-15.html) +--- Thread: particle explosions (/thread-8830.html) |
particle explosions - SBM Productions - 02-02-2006 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? particle explosions - Z!re - 02-02-2006 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.. particle explosions - SBM Productions - 02-02-2006 so I'd need to adjust the alpha channel of the bitmap? ok EDIT: Well I'm pretty much lost doing this... particle explosions - Z!re - 02-02-2006 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 particle explosions - SBM Productions - 02-02-2006 would you happen to have any sprites hanging around that already have the alpha value set? particle explosions - Z!re - 02-02-2006 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.. particle explosions - SBM Productions - 02-02-2006 what a pain in the ass particle explosions - Z!re - 02-02-2006 Quote:what a pain in the assHaha, 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 particle explosions - SBM Productions - 02-02-2006 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" ? |