Black smoke alpha settings

Started by
5 comments, last by Buckeye 9 years, 9 months ago

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

S T O P C R I M E !

Visual Pro 2005 C++ DX9 Cubase VST 3.70 Working on : LevelContainer class & LevelEditor

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.

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.


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

Yes it does.

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.

S T O P C R I M E !

Visual Pro 2005 C++ DX9 Cubase VST 3.70 Working on : LevelContainer class & LevelEditor

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.

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.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

This topic is closed to new replies.

Advertisement