Lighting a Direct3D 9 mesh sphere
I'm lighting a sphere as described in the title with diffuse and specular lighting. I have used, individually and in conjunction, directional and point lighting, but each time I try, a strange effect occurs. The way the sphere vertices are lit depends on the angle I am looking at it from, and if you could see this you would appreciate how ridiculous it looks. Has anyone succeeded in lighting a mesh sphere before?
Code:
mSphere=Mesh.Sphere(device,1.0f,32,16);
mSphere.ComputeNormals();
SphereCol=new Material();
SphereCol.Ambient=Color.DarkRed;
SphereCol.Diffuse=Color.Red;
SphereCol.Specular=Color.White;
.
.
.
device.Lights[0].Type=LightType.Directional;
device.Lights[0].Specular=Color.White;
device.Lights[0].Diffuse=Color.White;
device.Lights[0].Position=new Vector3(0.0f,0.0f, -4.0f);
device.Lights[0].Direction=new Vector3(0.0f,0.0f, 1.0f);
device.Lights[0].Enabled=true;
device.Material=SphereCol;
mSphere.DrawSubset(0);
As you can see from the attachments, the 90 degree shot has the shadow on the wrong side.