Jump to content
  • Advertisement
Sign in to follow this  
navid

texture with alpha channel fading problem

This topic is 3192 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 & happy new year, I have already read a few posts but I can't find the solution. My problem is that I have designed a smoke particle system & I want the smoke sprites to fade away gradually over time but my sprites use smoke texture form an image that has alpha channel & because of that I can't use the alpha component of sprite color to change the overall transparency of the sprite. How can I achieve this? Any idea would be great. Please help me. Thanks in advance. navid.

Share this post


Link to post
Share on other sites
Advertisement
One idea is to write a vertex/pixel shader to render the smoke billboard and to increase the amount of alpha by passing an absolute time to the technique via a uniform extern.

At time 0.0f, you do not adjust the alpha component at all, just leave it as it is after sampling the smoke texture with Tex2D() (i.e. add 0.0f to the alpha). At time 1.0f, you make the pixel completely transparent (i.e. add 1.0f to the alpha component of Tex2D()).

Share this post


Link to post
Share on other sites
thanks for the post but I'm not really good at shader programming. Is there any other way to do this?

Share this post


Link to post
Share on other sites
Use vertex alpha.

And before that, don't forget to enable multiplying texture alpha in the 1st stage with vertex alpha (it's disabled in D3D9 by default)

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!