Skip to main content
added 181 characters in body
Source Link
János Turánszki
  • 3.1k
  • 3
  • 18
  • 24

You need a directional lighting. Also disable specular lighting if you want screen position not to matter. This type of directional lighting is achieved by:

float lighting = saturate(dot(normal,lightDirection)); 

But you can enable it in a BasicEffect, too. If you want speculars gone, turn down the material's specular intensity to zero (you can also do it in the BasicEffect by setting SpecularColor to black).

Update:

You should try this if you are using built-in effects:

cubeEffect.DirectionalLight0.Direction = Vector3(1,1,1); cubeEffect.SpecularColor = Color.Black.ToVector3(); 

If you want your faces to not be uniformly lit, you should have smoothed normals on the faces. You can achieve this, by having your vertex normals account for their adjacent faces. So each corner should have one normal which points outwards, not three normals for each face.

You need a directional lighting. Also disable specular lighting if you want screen position not to matter. This type of directional lighting is achieved by:

float lighting = saturate(dot(normal,lightDirection)); 

But you can enable it in a BasicEffect, too. If you want speculars gone, turn down the material's specular intensity to zero (you can also do it in the BasicEffect by setting SpecularColor to black).

You need a directional lighting. Also disable specular lighting if you want screen position not to matter. This type of directional lighting is achieved by:

float lighting = saturate(dot(normal,lightDirection)); 

But you can enable it in a BasicEffect, too. If you want speculars gone, turn down the material's specular intensity to zero (you can also do it in the BasicEffect by setting SpecularColor to black).

Update:

You should try this if you are using built-in effects:

cubeEffect.DirectionalLight0.Direction = Vector3(1,1,1); cubeEffect.SpecularColor = Color.Black.ToVector3(); 

If you want your faces to not be uniformly lit, you should have smoothed normals on the faces. You can achieve this, by having your vertex normals account for their adjacent faces. So each corner should have one normal which points outwards, not three normals for each face.

Source Link
János Turánszki
  • 3.1k
  • 3
  • 18
  • 24

You need a directional lighting. Also disable specular lighting if you want screen position not to matter. This type of directional lighting is achieved by:

float lighting = saturate(dot(normal,lightDirection)); 

But you can enable it in a BasicEffect, too. If you want speculars gone, turn down the material's specular intensity to zero (you can also do it in the BasicEffect by setting SpecularColor to black).