Sign in to follow this  
Halsafar

Fade the alpha blend

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

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