Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
particle explosions
#1
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?
am part of the legion of n00b. We are numerous if dumb. We will enslave you all!
Reply
#2
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..
Reply
#3
so I'd need to adjust the alpha channel of the bitmap? ok

EDIT:

Well I'm pretty much lost doing this...
am part of the legion of n00b. We are numerous if dumb. We will enslave you all!
Reply
#4
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
Reply
#5
would you happen to have any sprites hanging around that already have the alpha value set?
am part of the legion of n00b. We are numerous if dumb. We will enslave you all!
Reply
#6
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..
Reply
#7
what a pain in the ass
am part of the legion of n00b. We are numerous if dumb. We will enslave you all!
Reply
#8
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
Reply
#9
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" ?
am part of the legion of n00b. We are numerous if dumb. We will enslave you all!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)