black smoke particles using blending?

Started by
1 comment, last by navid 14 years ago
hi all. i have designed a smoke particle system using Directx 9.0. i use a ".png" file as the texture for my point sprites. the .png file background is white which is transparent & the smoke part of the texture is orange. the smoke particles are fine using any color except black. my problem is that i can't render black particles. they all are transparent. what i want to do is to render black smoke which will fade over time. my blending config. is : device->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_MODULATE); device->SetRenderState(D3DRS_ALPHABLENDENABLE, true); device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); device->SetRenderState(D3DRS_DESTBLEND,2); any help would be great.
Advertisement
Your blending is SRC*SRC_ALPHA + DEST. If source is black, then nothing is added to dest, so it's in effect transparent. You can't make the image darker when adding to the dest (using D3DBLEND_ONE for D3DRS_DESTBLEND). You have to multiply the background by something. I think that SRC * D3DBLEND_ZERO + DEST * D3DBLEND_INVSRCALPHA will work.

By the way, I'd suggest that you always use the constants defined by Direct3D, such as D3DBLEND_ONE, instead of numbers. It's much clearer.
YAHOO!!! finally i have black smoke!!!
thanks a million ET3D you really helped me with this. and thanks for your advice.

This topic is closed to new replies.

Advertisement