Direct3D Alpha Blend with Lighting ?
Hi,
I was working with the microsoft shadow volume demo and I was trying to modify the alpha blending states so that i could load a png with a transparent background. I am trying to texture it onto a 3D model. It works fine but the moment I turn the lights on, the transparent background starts to become visible.
My blending states are like this
Code:
pd3dDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
pd3dDevice->SetRenderState(D3DRS_BLENDOP, D3DBLENDOP_ADD);
pd3dDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ONE);
pd3dDevice->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_INVSRCALPHA);
I am using the microsoft shadow volume demo and did not write the lighting shader myself but I believe it is per pixel lighting. I have attached the shader.
Could someone please let me know how I can maintain the transparency of the png when the lights are turned on ?
Also, does anyone know if theres a way to ignore black pixels or to conduct a color key without using the LoadTextureFromFile method ?
Any help is appreciated.
Thank You.