I want to draw some debug info on screen, but this cause problem with rendering model. I found some solutions in the internet, but it dosen't work. Maybe i'm too stupid, but i don't know what's wrong. Here's Draw method:
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.DarkCyan);
spriteBatch.Begin();
player.Draw(dt);
spriteBatch.DrawString(gamefont, "render Time :" + gameTime.ElapsedGameTime.TotalSeconds, new Vector2(0, 85), Color.White);
spriteBatch.End();
effect.View = player.view;
effect.Projection = player.projection;
effect.Texture = dirtTexture;
GraphicsDevice.SamplerStates[0] = SamplerState.PointClamp;
GraphicsDevice.BlendState = BlendState.Opaque;
GraphicsDevice.DepthStencilState = DepthStencilState.Default;
foreach (EffectPass p in effect.CurrentTechnique.Passes)
{
p.Apply();
effect.World = player.world;
GraphicsDevice.DrawPrimitives(PrimitiveType.TriangleList, 0, buffer.VertexCount / 3);
}
base.Draw(gameTime);
}