Jump to content
  • Advertisement
Sign in to follow this  

fade out

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

hi there i want the dead bodys in my scene to fade out, the vertex format is <position, textureCoord> (no shader), in directx with the fixed pipeline, i can change the texture factor to achieve the alpha blending fade out effect like this

// color operation
device->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
device->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);

// alpha operation, change the 'clrCurrent' to do the fade out effect
device->SetRenderState(D3DRS_TEXTUREFACTOR, clrCurrent);
device->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
device->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TFACTOR);

I'm wondering what's the D3DRS_TEXTUREFACTOR equivalence in OGL, so i dont need to change my mesh vertex format? or any other choice i can do the trick without modifying the vertex format? thanks a lot.

Share this post

Link to post
Share on other sites
Without knowing too much about DirectX, I don't think there's an equivalent in OpenGL to do exactly what you're doing in DX.

However, before you render your model you can set the alpha value of the model using glColor4f(); which will allow you fade the Alpha down. You will need to enable blending. And if you're going to have multiple objects near each other fading out, you will need to render from back-to-front.

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!