Sign in to follow this  

weird alpha blending results

This topic is 4202 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

ok Im getting the weirest results, one second my smoketrail effect is working, and the next it wont render (Im guessing the particle alpha value is 0). It only stops working when I change something, but it is sometimes something totally unrelated (like the amount it starts to decrease the alpha level by after it reaches a certain color). I have the alpha texture stage disabled (It has worked before under that setting) and I call these two render state functions before I render the particles: V_RETURN(d->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ONE)); V_RETURN(d->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA)); each particle is initialized with a diffuse color of 0xff000000 which is increased to 0xff303030 and then the alpha level starts to drop to 0. I have the FVF set for XYZ and DIFFUSE. Am I missing something? It seems like Im leaving some variable uninitialized so its being set to some semi-random value right? The SRCALPHA color is retrieved from the diffuse color right?

Share this post


Link to post
Share on other sites
SrcAlpha ist the alpha value your pixel processing generates. If you use the fixed function pipeline it is the result of the alpha texture stage chain. You write you have disabled the alpha part. You should not do this. The rule says that if you use the color part of a stage you have to set the alpha part too.

As you want the alpha part of the diffuse value you should set D3DTSS_ALPHAOP to D3DTOP_SELECTARG1 and the D3DTSS_ALPHAARG1 to D3DTA_DIFFUSE

Share this post


Link to post
Share on other sites

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

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