Monday, October 24, 2011

Well That's Dumb

I resolved my rendering issue thanks to this XNA forum post which indicates that Viewports (which determine which portion of the screen actually gets drawn on) initialize with maximum and minimum depth set to zero.  This explains why the problem on xbox only showed up when I was using split-screen, as it involves creating new viewports.  So basically all the depth calculations were getting clamped between 0 and 0, effectively rendering the depth buffer useless.  A quick change to explicitly set appropriate minimum and maximum depths (0 and 1) fixed the problem completely.

What I don't understand now is why the problem DIDN'T show up on Windows, but I really don't care at this point.  There are other weird problems happening on Windows that don't happen on xbox (for some reason, my game sounds don't work on Windows, but they work on Xbox), and I can't be bothered to track down the cause.  Probably I need to do a fresh reinstallation on my laptop, but again, can't be bothered.

Anyway, the important thing is it's working correctly now!  I can carry on with fruitful development instead of banging my head against bugs.

No comments:

Post a Comment