xna 4.0 - XNA 4.0: terrain glitches caused by SpriteBatch -


i'm trying implement terrain collision in xna i've added dynamic text allows me test whether calculations correct. rendered fine until called:

spritebatch.begin(); spritebatch.end();

or

spritebatch.begin(spritesortmode.backtofront, blendstate.alphablend); spritebatch.end();

with these instructions terrain glitches little bit, when remove these 2 lines code normal (but means cannot draw hud)

anyone has clue can cause , how should fix it?

screens:

with sprite batch on

with sprite batch off

it due spritebatch change graphicsdevice states...

before drawing terrain should store right renderstates...

usually have set right rasterizerstate , depthstencilstate.

common values rasterizarstate.cullnone , depthstencilstate.default


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -