pDevice->SetRenderState(D3DRS_AMBIENT, D3DXCOLOR(0x00202020));
I use that state,and set the material's ambient value(argb) to 1.Yet all my vertices are still black(and yes i enabled lighting).
What could be the problem?
pDevice->SetRenderState(D3DRS_AMBIENT, D3DXCOLOR(0x00202020));
I use that state,and set the material's ambient value(argb) to 1.Yet all my vertices are still black(and yes i enabled lighting).
What could be the problem?
Do your vertices contain normals? You need normals for lighting (even though ambient lighting technically doesn't use them).
Another thought - I'm not using the fixed pipeline so I'm not sure this matter at all, but maybe you could try to use 0xFF202020 instead of 0x00202020. In fact for testing I would suggest rather something like 0xFFFF7F7F (you'll know it's working properly when your objects are rendered in red).