hi, I'm trying to getting lighting in a scene but can't seem to do it, I have loaded a .x skinned mesh from file using my own parser and state sorted the vertices by material, when I set the material for each batch of vertices I set the diffuse equal to the ambient for each material.
D3DLIGHT9 light;
D3DMATERIAL9 material;
material.Diffuse = material.Ambient = ...;
light.Type = D3DLIGHT_POINT;
light.Diffuse.r = 0.5f;
light.Diffuse.g = 0.5f
.....
light.Attenation0 = 0.1f;
light.Range = 1000.0f
pDevice->SetLight(0, &light);
pDevice->LightEnable(0, TRUE);
pDevice->SetRenderState(D3DRS_LIGHTING, TRUE);
pDevice->SetRenderState(D3DRS_AMBIENT, D3DCOLOR_XRGB(110, 0, 0));
The problem is that nothing is happening, the ambient light works fine and the material colours are spot on but there is no point lights in the scene?
I also set the vertex format to look like:
pDevice->SetFVF(D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_DIFFUSE | D3DFVF_TEX1);
typedef struct
{
vect3 pos;
vect3 normal;
DWORD color;
float u, v;
} Vertex3D;