m_pD3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, true);
m_pD3DDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
m_pD3DDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
SetLight with Alpha channel
SetMaterial with Alpha channel
m_pD3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, false);
How to render an object with texture and transparency
How to render an object with texture and transparency?
If I render the object(with texture) with the code as below, the object looks like solid without transparency.
If I render the object(only with material,without texture) with the code below, the object looks like solid with transparency;
It's up to the alphaop/alphaarg settings you use in your SetTextureStageState calls. You want to modulate texture and diffuse, allowing both the texture opacity and material opacity to work together.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement