Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.



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

I''m trying to create some realistic looking effects in my animation. I have a cube in the centre of my scene and I am using cube mapping to map the surrounding environment onto the cube. This works great but I need to incorporate a high degree of transparency in the cube so that as well seeing the reflected environment, the cube is almost transparent. At the moment I am trying to do this using alpha blending and although this works I need more transparency then it provides. Here are some of the settings that I am using: 1) In order to draw the reflected environment I am using the following code so that the current material is ignored and only the texture is used: pDirect3DDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); pDirect3DDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE ); pDirect3DDevice->SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_DIFFUSE); 2) I am also using the following alpha blending settings: pDirect3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); pDirect3DDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCCOLOR); pDirect3DDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCCOLOR); Given this, how can I increase the transparency level? Thanks in advance Asim

Share this post

Link to post
Share on other sites
You are going have to tell Direct3D what is transparent and to what degree that transparency is. You can do this by either the alpha value in the material color, or the alpha value in the texture that you map the cube with.

Hope this helps!

Share this post

Link to post
Share on other sites

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