Skip to main content
GameDev.net gamedev.net
🔒 Locked

HeightMap and movement

Started by xevoxe Nov 16, 2010 at 6:10 PM 1 replies 750+ views
Original Post
xevoxe
xevoxe
I am having trouble figuring out what is going on here. If anyone could point me in the right direction on what could cause this I would appreciate it.

My mesh appears to render correctly so I figure it has to do with how my texture is applied but I am not sure. As the camera moves in any direction it appears the hills in the background are rendering in front of the hills in the foreground.



wireframe


terrain1

terrain2
Noggs
Noggs
It's probably not Z testing. Make sure you have Z write and Z test enabled in your shader. I think they're something like this:

technique blah {   pass blah {      ZEnable = TRUE;      ZWriteEnable = TRUE;
xevoxe
xevoxe
I tracked down the issue due to my FPS counter. Because I use the spritebatch I needed to clear the depth buffer before rendering my terrain. Hopefully someone learns from my mistake. :)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.