Jump to content
  • Advertisement
Sign in to follow this  
Halsafar

Fade the alpha blend

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

Okay I got a TnL quad over the screen and I have a few alpha blending states enabled. I was wondering what value or what render state I would modify to literally fade the intensity of the alpha, ie. Make the quad go from transparent to solid as I update the frames. [Edited by - Halsafar on June 10, 2005 5:09:28 PM]

Share this post


Link to post
Share on other sites
Advertisement
I'm in a bit of a hurry right now, so this'll have to be brief [smile]

You could use materials (D3DMATERIAL9's) and alter the "a" component accordingly.

You could also, I think, use the D3DTS_TFACTOR (or something TFACTOR??) for the fixed-function blending states.

Or you could physically modify the vertices and/or texture alpha data.

It entirely depends on how your program is operating - the first one above will only work when you're using FF lighting, the second if you're not using shaders (?) and the last one has possible performance problems.

hth
Jack

Share this post


Link to post
Share on other sites
Okay when using a Screen QUAD D3DFVF_XYZRHW and D3DFVF_DIFFUSE. I can set the color of the DIFFUSE to any alpha and nothing changes...

Share this post


Link to post
Share on other sites
Try Device->SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_DIFFUSE );
And make sure Device->SetRenderState( D3DRS_ALPHABLENDENABLE, true );

Share this post


Link to post
Share on other sites
Yah I got it working by adding texture coords and doing this:
::Graphics()->SetTextureStageState(0,D3DTSS_COLOROP,D3DTOP_SELECTARG1);
::Graphics()->SetTextureStageState(0,D3DTSS_COLORARG1,D3DTA_TEXTURE);
::Graphics()->SetTextureStageState(0,D3DTSS_COLORARG2,D3DTA_DIFFUSE); //Ignored

//Set the alpha to come completely from the diffuse
::Graphics()->SetTextureStageState(0,D3DTSS_ALPHAOP,D3DTOP_SELECTARG1);
::Graphics()->SetTextureStageState(0,D3DTSS_ALPHAARG1,D3DTA_DIFFUSE);
::Graphics()->SetTextureStageState(0,D3DTSS_ALPHAARG2,D3DTA_TEXTURE); //Ignor


I am not sure if I need all those states.

Curious tho, what is the default value for those states so I can them back....

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!