• Advertisement
Sign in to follow this  

Black smoke alpha settings

This topic is 1328 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, have a question :

 

What are the settings for the alpha blending for getting black smoke ?

Do i need a .png file or is there a way to use a seperated bitmap for the alpha ?

 

thanks in advance

Edited by the incredible smoker

Share this post


Link to post
Share on other sites
Advertisement

I would use the same setup for any color of smoke - use billboards (which are just textured quads) and additively blend them together in a particle system that models the behavior of the smoke.  I normally use PNGs while developing, but you would likely want to switch to a processed format later on when you deploy your application.  That let's you load it faster into your application specific format.

Share this post


Link to post
Share on other sites

Additive blending, that is:

 

destColor = srcColor + destColor

 

can only lighten the color of what is underneath (because srcColor can't be negative).  Its fine for making white smoke, but not black smoke.

For black smoke, you could try subtractive blending (not sure if D3D9 supports this mode or not):

 

destColor = destColor - srcColor

 

Alternatively you could use normal alpha blending:

 

destColor = srcColor * srcAlpha + destColor * (1 - srcAlpha)

 

with a mostly dark colored texture with an alpha channel that is opaque in the middle and fades to a transparent circular border.  You'll probably want some noise added to the texture to make it look smoky.

Note that with alpha blending, the order the quads get drawn in matters (unlike with additive or subtractive blending) so you'll want to draw them in back-to-front order, otherwise it won't look right.

Share this post


Link to post
Share on other sites

Hi, thanks for the reply's,

 

Look at this movie please :

 

The black smoke is different then all alpha blend settings ive tryd.

 

So there must be some alpha channel for saying how much transparancy there is on what pixel.

I readed with .png files it would work, i Always have .bmp files, so maybe is there a way to load a monochrome bitmap as alpha channel ?

 

btw : i use 25 frame animated bitmaps ( 5 x 5 in 1 file ) for explosions, that is what i use as particles.

Edited by the incredible smoker

Share this post


Link to post
Share on other sites

I'd suggest premultiplied alpha. That is:

 

destColor' = destColor*invSrcAlpha + srcColor

 

For that to work you will have to preprocess your textures, however.

 

The good thing about this blendmode is that you can achieve a variety of effects from glaring bright explosions to thick black smoke just by altering the source color and/or alpha. Plus you can interpolate these in a shader.

 

The downside is that this blendmode is not commutative so you will have to sort your particles.

Share this post


Link to post
Share on other sites

If you're going to be doing very blending at all, you should consider using pngs (possibly converting them to DXT's at some point). Take a look at Gimp. It's free and a fairly versatile image/texture editor.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement