2
\$\begingroup\$

Talking BasicEffects, where is the source of the three directional lights?

When I write this:

effect.DirectionalLight0.DiffuseColor = new Vector3(0.5f, 0, 0); // a red light
effect.DirectionalLight0.Direction = new Vector3(1, 0, 0);

What does it mean for the direction? From where is it directing?

\$\endgroup\$
4
\$\begingroup\$

Directional lights have no position. Think of the sun lighting objects on earth. Technically it has a position, but it is so far away that it does not matter.

Therefore a directional light will illuminate based only on the angle between the light's direction and the surface normal.

If you want lights with a position that also have attenuation, you want to use point lights.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.