Jump to content
  • Advertisement
Sign in to follow this  
navid

black smoke particles using blending?

This topic is 3096 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 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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
YAHOO!!! finally i have black smoke!!!
thanks a million ET3D you really helped me with this. and thanks for your advice.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!