Week7 - BasicEffect class

Start Project: Week7Start.zip

Finished Project: Week7Finish.zip


If you compare the differences between the starting project and the finished project, you'll notice there is very little change. As a matter of fact, the only difference is in the two foreach loops in Game1.Draw(). Here is the new code that was added there:

//effect.LightingEnabled = true;
//effect.AmbientLightColor = Color.Gray.ToVector3();
//effect.DiffuseColor = Color.White.ToVector3();
//effect.DirectionalLight0.Enabled = true;
//effect.DirectionalLight0.DiffuseColor = Color.Red.ToVector3();
//effect.DirectionalLight0.Direction = -Vector3.UnitX;
//effect.DirectionalLight0.SpecularColor = Color.Green.ToVector3();
//effect.SpecularColor = Vector3.One;
effect.FogEnabled = true;
effect.FogColor = Color.Green.ToVector3();
effect.FogStart = 0.0f;
effect.FogEnd = 2.5f;

There are plenty of explanations for everything that's covered in this code as well as good tutorials for understanding lighting, so I won't rewrite that here. However, the links to there are as follows:
BasicEffect Class
BasicEffect Lighting
BasicEffect Fog

back to SIGXNA

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License