
Player model sinking into the ground when the player Y<0
EDIT: FOUND IT... there some misterious bug with the depthbuffer? If i switch the rendering order to render my player first everything is fine... what is going on. Doest anyone know how to fix that bug without changing the render order?
EDIT2: FINALLLY FIXED:I found how to fix it while keeping the draw order intact. The real bug is that i have quads at Y=0 that are transparent with a thin red line around for debug purpose... and its screwing the deptbuffer. I added DepthStencilState = DepthStencilState.DepthRead; for those debug quads and everything is fine now... Thanks for the help
Simple heightmap with cubes as terrain. Every thing is positioned from the same source : terrain.GetHeight(x,z). Everything on the map is placed right even when the Y of the heightmap is below 0. The player looks right when hes on a tile Y>0 but sink more and more the lower the tile is. My character is 2unit tall and when the tile is Y<-2 it totally disapear. If Y is below 0 and higher than -2 its partially hidden... Ive logged the height of my character AND the ground IN the draw function and they are exactly the same. Im using basicEffect. On the tiles y>0 the character look fine... Any lead apreciated. Ive tested changing to a new basiceffect and many other things but no success.