Previous | Next --- Slide 15 of 69
Back to Lecture Thumbnails
Azure

I'm not sure I wholly understand near/far clipping. Doesn't the near/far values depend on how far the object is? So shouldn't the depth of the boxes still be the same, if they're drawn the same; just the limits are different? And if the depth of the boxes are the same, shouldn't they be rendered in the same way?

Basically, why does changing the near/far limits change the depth of the same object?

xiaol3

According to near/far clipping, is the resolution going to change base on "near/far"? But that sounds incredibly hard to inplement.

penguin

^ I have the same question as Azure.

keenan

@Azure The near/far clip planes don't change the actual depth of the object, but they do affect the numerical values used to represent points on the object after they're mapped into clip space, i.e., after we map the view frustum to the 2x2x2 box. In particular, if near/far are extremely far away, your object will occupy only a tiny fraction of this box. So, when you use these transformed Z values to do a depth comparison, you may get the answer wrong (due to numerical precision issues).

ceviri

Just wanted to say that this slide + animation is really really cool. It's one of the coolest things I've seen so far, no joke, and not a phenomenon I would've expected to occur before seeing this slide.

As a side note, the "lectures" tab really needs to be updated.

keenan

@ceviri Great---glad you found it eye-opening! And thanks for the reminder. :-)

bpopeck

I'm struggling to understand the bottom red text - I thought z-fighting was a consequence of less precision near zero?

keenan

@bpopeck Basically you can imagine your 3D object gets "squashed" along the Z-direction by the clipping transformation. If the Z coordinates of your model land in a region of the number line where floating point has poor precision, you'll get Z-fighting. So, you try to tightly fit the near/far clip planes around your object so you can use up the full range.

barath

So, does the range of Near and Far clips mean anything? Say smaller the range better the precision?