Original Post
🔒 Locked
Transparency
Advertisement
Which language and API are you using?
I might be able to save some time by linking you to the Drunken Hyena tutorial on blending, but that assumes C++ and D3D9.
I might be able to save some time by linking you to the Drunken Hyena tutorial on blending, but that assumes C++ and D3D9.
I am using Direct3D with C++.
I had also tried this before that is mentioned in the tutorial,
but it doesn't work.
g_pd3dDevice->SetRenderState(D3DRS_ALPHABLENDENABLE,true);
g_pd3dDevice->SetTextureStageState(0,D3DTSS_ALPHAOP,D3DTOP_SELECTARG1);
g_pd3dDevice->SetTextureStageState(0,D3DTSS_ALPHAARG1,D3DTA_DIFFUSE); g_pd3dDevice->SetTextureStageState(0,D3DTSS_ALPHAARG2,D3DTA_TEXTURE);
What am I doing wrong?
I had also tried this before that is mentioned in the tutorial,
but it doesn't work.
g_pd3dDevice->SetRenderState(D3DRS_ALPHABLENDENABLE,true);
g_pd3dDevice->SetTextureStageState(0,D3DTSS_ALPHAOP,D3DTOP_SELECTARG1);
g_pd3dDevice->SetTextureStageState(0,D3DTSS_ALPHAARG1,D3DTA_DIFFUSE); g_pd3dDevice->SetTextureStageState(0,D3DTSS_ALPHAARG2,D3DTA_TEXTURE);
What am I doing wrong?
Okay, for the first time it works now,
after adding these three lines of code.
Hope I am doing the proper way.
g_pd3dDevice->SetRenderState(D3DRS_SRCBLEND,D3DBLEND_SRCALPHA);
g_pd3dDevice->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_INVSRCALPHA);
g_pd3dDevice->SetRenderState(D3DRS_BLENDOP,D3DBLENDOP_ADD);
after adding these three lines of code.
Hope I am doing the proper way.
g_pd3dDevice->SetRenderState(D3DRS_SRCBLEND,D3DBLEND_SRCALPHA);
g_pd3dDevice->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_INVSRCALPHA);
g_pd3dDevice->SetRenderState(D3DRS_BLENDOP,D3DBLENDOP_ADD);
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement