protected override void Draw(GameTime gameTime)
{
_graphics.GraphicsDevice.Clear(Color.Black);
//tree.Draw();
_graphics.GraphicsDevice.VertexDeclaration = _vertexDeclaration;
// Update our camera
UpdateCameraThirdPerson();
_basicEffect.Begin();
_basicEffect.Projection = _proj;
_basicEffect.View = _view;
_basicEffect.Alpha = 1.0f;
_basicEffect.DiffuseColor = new Vector3(.95f, .95f, .95f);
_basicEffect.SpecularColor = new Vector3(0.05f, 0.05f, 0.05f);
_basicEffect.SpecularPower = 5.0f;
_basicEffect.AmbientLightColor = new Vector3(0.75f, 0.75f, 0.75f);
_basicEffect.DirectionalLight0.Enabled = true;
_basicEffect.DirectionalLight0.DiffuseColor = Vector3.One;
_basicEffect.DirectionalLight0.Direction = Vector3.Normalize(new Vector3(1.0f, -1.0f, 0.0f));
_basicEffect.DirectionalLight0.SpecularColor = Vector3.One;
_basicEffect.DirectionalLight1.Enabled = true;
_basicEffect.DirectionalLight1.DiffuseColor = new Vector3(0.1f, 0.1f, 0.1f);
_basicEffect.DirectionalLight1.Direction = Vector3.Normalize(new Vector3(-1.0f, -1.0f, 1.0f));
_basicEffect.LightingEnabled = true;
foreach (var pass in _basicEffect.CurrentTechnique.Passes)
{
pass.Begin();
_graphics.GraphicsDevice.RenderState.CullMode = CullMode.None;
_graphics.GraphicsDevice.RenderState.FillMode = FillMode.WireFrame;
_graphics.GraphicsDevice.RenderState.AlphaBlendEnable = true;
// Make the renderers draw their stuff
base.Draw(gameTime);
_graphics.GraphicsDevice.RenderState.FillMode = FillMode.Solid;
_graphics.GraphicsDevice.RenderState.CullMode = CullMode.CullClockwiseFace;
_graphics.GraphicsDevice.RenderState.AlphaBlendEnable = false;
pass.End();
}
_basicEffect.End();
DrawCameraState();
//_spriteBatch.Begin();
//_spriteBatch.DrawString(_spriteFont, "Esc: Opens the console.",
// new Vector2(10, _graphics.GraphicsDevice.Viewport.Height - 30), Color.White);
//_spriteBatch.End();
GraphicsDevice.RenderState.DepthBufferEnable = true;
GraphicsDevice.RenderState.AlphaBlendEnable = false;
}