public override void DepthExtractor(Microsoft.Xna.Framework.GameTime gt, SceneControl.IObject obj, Microsoft.Xna.Framework.Matrix View, Microsoft.Xna.Framework.Matrix projection, SceneControl.RenderHelper render)
 {
     SimpleTree tree = (obj.Modelo as TreeModel).Tree;
     tree.DrawTrunk(obj.WorldMatrix, View, projection, false, true);
     render.ResyncStates();
     tree.DrawLeaves(obj.WorldMatrix, View, projection, false, true);
     render.ResyncStates();
 }         
 public override void PosDrawPhase(Microsoft.Xna.Framework.GameTime gt, SceneControl.IObject obj, SceneControl.RenderHelper render, Cameras.ICamera cam, IList<Light.ILight> lights)
 {
     SimpleTree tree = (obj.Modelo as TreeModel).Tree;
     tree.DrawLeaves(obj.WorldMatrix, cam.View, cam.Projection, false);
     render.ResyncStates();
     render.SetSamplerStates(ginfo.SamplerState);
 }
        /// <summary>
        /// Normal Drawn Function.
        /// </summary>
        /// <param name="gt">The gt.</param>
        /// <param name="obj">The obj.</param>
        /// <param name="cam">The cam.</param>
        /// <param name="lights">The lights.</param>
        /// <param name="render">The render.</param>
        public void Drawn(Microsoft.Xna.Framework.GameTime gt, SceneControl.IObject obj, Cameras.ICamera cam, IList<Light.ILight> lights, SceneControl.RenderHelper render)
        {
            WorldMatrix.SetValue(obj.PhysicObject.WorldMatrix);
            ViewMatrix.SetValue(cam.View);
            ProjectionMatrix.SetValue(cam.Projection);

            TerrainShader.CurrentTechnique = TerrainShader.Techniques["Technique1"];
            TerrainShader.CurrentTechnique.Passes[0].Apply();

            QuadTerrain.DrawTerrain(TerrainShader, render.device);

            render.ResyncStates();
        }
        /// <summary>
        /// Normal Drawn Function.
        /// </summary>
        /// <param name="gt">The gt.</param>
        /// <param name="obj">The obj.</param>
        /// <param name="cam">The cam.</param>
        /// <param name="lights">The lights.</param>
        /// <param name="render">The render.</param>
        public void Drawn(Microsoft.Xna.Framework.GameTime gt, SceneControl.IObject obj, Cameras.ICamera cam, IList<Light.ILight> lights, SceneControl.RenderHelper render)
        {
            if (isupdated == false)
            {                
                QuadTerrain.UpdateTerrain(cam.Position, cam.BoundingFrustum, LOD);                
            }

            WorldMatrix.SetValue(obj.PhysicObject.WorldMatrix);
            ViewMatrix.SetValue(cam.View);
            ProjectionMatrix.SetValue(cam.Projection);

            TerrainShader.CurrentTechnique = TerrainShader.Techniques["Technique2"];
            TerrainShader.CurrentTechnique.Passes[0].Apply();

            QuadTerrain.DrawTerrain(TerrainShader, render.device);

            render.ResyncStates();
            isupdated = false;
            render.SetSamplerStates(ginfo.SamplerState,6);
        }