I'm trying to implement terrain collision in XNA so I've added some dynamic text that allows me to test whether calculations are correct. Everything was rendered just fine until I called:
spriteBatch.Begin(); spriteBatch.End();
or
spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend);
spriteBatch.End();
With these instructions terrain glitches a little bit, when I remove these two lines from my code everything is back to normal (but it means I cannot draw HUD)
Anyone has any clue what can cause that and how should I fix it?
screens: