Rendering artifacts (Buffer fighting?)

This issue has cropped up recently and I can’t seem to track down why. It didn’t do this before, sometime between starting on my shadows and finishing them this started happening. If I turn off the entire shadow system it still occurs though.

It gets worse the farther away I get, but as seen in the picture it happens even when very close as well.

Any ideas on what could be causing this to happen?? Sometimes the object in the picture disappears almost entirely.

It looks like you have a problem with the precision. Probably your object is too small compared to the distance to the origin. Move the object to the coordinate system origin and if object renders correctly that’s it!
Also, move near and far clipping planes as close to the object as possible (this will diminish Z-fighting, if it causes the problem).

You might also be getting a 16-bit Z buffer. I’ve seen this happen before with certain hardware, where if you ask for 32-bits at startup, but 32-bits doesn’t exist, it will only give you 16.

In general it’s always safer to ask for a 24-bit Z buffer during startup.

I asked for a 16 bit z-buffer, switching to a 32 crashes. Using 24 bit doesn’t seem to make a difference either.

Distance from the origin doesn’t help either as I have the same map drawn 3 times each at a farther distance and each one does it. I moved the far plane in closer and had no effect.

Ahh, I changed the near plane and that seems to have fixed it. I was using 0.001f before to prevent clipping of objects too close, I must have accidentally made this value smaller than it should have been. Using 0.1f fixes the problem without causing clipping issues close to objects. Thanks for the help.