I got a model in which some parts I want to be able to see through. Actually I l already had the alpha render state attribute enabled
like
bool CMyApp::RestoreGameState()
{
m_pFont->RestoreDeviceObjects();
// restore device states
m_pDevice->SetTransform(D3DTS_PROJECTION, m_Cam.GetProjMatrix());
m_pDevice->SetRenderState(D3DRS_LIGHTING, true);
m_pDevice->SetRenderState(D3DRS_AMBIENT, D3DCOLOR_COLORVALUE(0.5, 0.5, 0.5, 0.0));
m_pDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, true);
m_pDevice->SetRenderState(D3DRS_DIFFUSEMATERIALSOURCE, D3DMCS_MATERIAL);
// normalize since objects are being scaled therefore normals aren't correct anymore
m_pDevice->SetRenderState(D3DRS_NORMALIZENORMALS, true);
m_pDevice->SetSamplerState( 0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR );
m_pDevice->SetSamplerState( 0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR );
m_pDevice->SetSamplerState( 0, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR );
m_pDevice->LightEnable(DIRECTIONAL, true);
m_pDevice->LightEnable(POINT, true);
SetClearColor(175, 175, 175);
return true;
}
The material samples I took from the debugger did have the alpha values of less than 1.0.
But the colors of the materials are solid. I didn't set up the textures for those objects.
The restoregamestate looks alright I think, doesn't it?
I got lights setup. What did I miss out?
Thanks
Jack