Sign in to follow this  
navid

texture with alpha channel fading problem

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this