texture with alpha channel fading problem

Started by
3 comments, last by navid 14 years, 3 months ago
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.
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()).
thanks for the post but I'm not really good at shader programming. Is there any other way to do this?
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)
oh yeah!
it's working. you're the best snake5. i will rate you right away.
thanks a million.

This topic is closed to new replies.

Advertisement