XNA 4.0: terrain glitches caused by SpriteBatch
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: with sprite batch on with sprite batch off
it due to spritebatch change the graphicsdevice states... before drawing the terrain you should store the right renderstates... usually the you have to set the right RasterizerState and DepthStencilState. Common values are RasterizarState.CullNone and DepthStencilState.Default
XNA 4.0 InvalidOperationException was unhandeled
Pass variables to another class?
Xna Game referencing Game in update
XNA game studio simple sprite animation
XNA phase management
How to check BoundingSphere for one ModelBone?
MonoGame: Some VertexColorPosition dissappear while drawing user primitives(DrawUserPrimitives)
Testing XNA 4.0 games On the XBOX 360 without paying $100 [duplicate]
Detecting clicks in a non-rectangular shape
What's a good way to optimise rendering a 2D tile game in XNA?
How to make 3D racing game with XNA? [closed]
How to correctly accelerate a rotated 3d model in XNA?
What's the difference between world and view for purpose of camera?
Vertexbuffer Getdata VertexPositionNormalTexture
Converting from 3.1 to 4.0… gamestates
XNA large coordinates and float precision