texture with alpha channel fading problem
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.
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()).
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)
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)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement