Point sprites with glow and alpha blend

Started by
13 comments, last by Miksan 20 years ago
Yes, I don't have Photoshop, but I have PSP lying around. I'll see what can I do with it. Even if I get rid of the black boxes by creating the particle texture on transparent background, how can I get the glow effect working? Like this?

I mean how could I have the alpha blending and the glow effect from blend one-blend one working at the same time?

Business is business and Moses is Moses
[Homesite]

[edited by - Miksan on April 12, 2004 4:34:49 PM]
Advertisement
You can get that by using destblend of one, but otherwise using the same values as above.

This works out as (srcalpha * srcpixel) + (destpixel * 1). So, the new image will blend out with your particle alpha multiplied by the texture alpha. This will then be added to the current back buffer value.

Doing this, you could pre-multiply your bitmap, and not have alpha in it, since you don''t need per pixel alpha for anything other than scaling the srcpixel values. Just fade your image to black at the edges. The the vertex alpha will scale the bitmap''s brightness before adding it to the back buffer.
Great, it works now. Here''s the code:

device.RenderState.ZBufferEnable = false;device.RenderState.AlphaBlendEnable = true;device.RenderState.SourceBlend = Blend.SourceAlpha;device.RenderState.DestinationBlend = Blend.One;device.TextureState[0].AlphaOperation = TextureOperation.Modulate;device.RenderState.PointSpriteEnable = true;device.RenderState.PointScaleEnable = true;device.RenderState.PointSize = 0.05f;device.SetTexture(0, texture);


Here''s a screenie also (console is also visible ): Clicky

Business is business and Moses is Moses
[Homesite]
I''ll continue this thread, I think new one is not necessary...

How could I make black particles show up? Like doing thick black smoke or something? If I color my particle black, it becomes transparent. If I blend them, they get brighter...?

Business is business and Moses is Moses
[Homesite]
Simple black particles would be a black sphere with fading alpha on the outside and normal alpha blending (srcblend=srcalpha, destblend=invsrcalpha).

Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>

This topic is closed to new replies.

Advertisement