<p>The near clipping plane in rasterizing setups with perspective projection is there to avoid a divide by 0 and bound the possible depths for orthogonal projection.</p>

<p>With a bit of extra math you can make the depth stored in the depth buffer linear again. However you still need the guard against the divide by 0.</p>

<p>In raytracing the near plane can be at 0 no problem. There is nothing technical stopping you from putting it at -10 however (besides that it would be very odd).</p>

CC BY-SA 3.0
2016-04-14T10:37:54.963Z
Yes i know this, but wondering if there could be a alternate strategy to avoid division by 0.
joojaa
CC BY-SA 3.0
2016-04-17T00:24:11.360Z
You could avoid divide by zero by pushing in or out values that would cause one.
Alan Wolfe
CC BY-SA 3.0
2016-04-17T15:01:07.537Z
@joojaa Raytracing does not divide by zero.
Andreas
CC BY-SA 3.0
2016-04-17T15:01:44.980Z
@Andreas Yes i know that neither does reality ;)
joojaa
CC BY-SA 3.0
2016-05-04T08:00:46.650Z
@joojaa But have you ever tried looking at something that's been pushed through your eyeball? :-)
Simon F
CC BY-SA 3.0
2016-05-04T08:04:12.513Z
@SimonF Actually I have, although i tried to not concentrate on it.. But the projectile geometry actually pushes everything that crosses your view plane trough one point which reality does not ;)
joojaa
CC BY-SA 3.0
2016-04-14T10:15:00.100Z
2016-04-14T10:15:00.100Z
ratchet freak
<p>The near clipping plane is a fundamental feature of projective rasterization. To borrow a diagram from Eric Lengyel's <a href="http://www.terathon.com/gdc07_lengyel.pdf" rel="nofollow noreferrer">Projection Matrix Tricks</a> presentation:</p>

<p><a href="https://i.sstatic.net/wd9gx.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/wd9gx.png" alt="Diagram of camera space to NDC transform"></a></p>

<p>The displayed region of clip space (that you can think of rasterization as happening in) is a box which has a "near" face. This is associated with the near clip plane. But we can push the far clip plane out to infinity, so can we pull the near clip plane in to zero?</p>

<p>Mathematically, you absolutely can! The only point that presents a problem is the eye itself: you can get infinitely close to the eye and still resolve to a single point in clip space. However, if you have a triangle that passes through the eye, you still need to clip it, and to clip it you need an actual plane, not a concept like "infinitely close to the eye."</p>

<p>More critically for the current rasterization pipeline, the perspective divide does fun things with numerical precision. See the line at NDC 0 in the diagram above? It's halfway through the viewing volume in clip space, but not at all near halfway through the view frustum in camera space. In fact, its position depends on the near clip plane's distance to the eye! This means that over half of the depth range in clip space is in that region near the eye. As you get the near clip plane closer and closer to the eye, that plane pulls in even closer and you waste more and more depth range. This isn't necessarily fundamental—you don't have to store z/w in the depth buffer—but it is convenient. Here's an <a href="https://developer.nvidia.com/content/depth-precision-visualized" rel="nofollow noreferrer">article from Nathan Reed</a> about depth precision, and a few notes about <a href="http://www.humus.name/index.php?ID=255" rel="nofollow noreferrer">why the projected z/w depth is useful</a> from Emil Persson.</p>

<p>Finally, I'll plug <a href="https://fgiesen.wordpress.com/2011/07/05/a-trip-through-the-graphics-pipeline-2011-part-5/" rel="nofollow noreferrer">a post in the excellent "A trip through the Graphics Pipeline"</a> series, which is very interesting and references homogeneous rasterization algorithms which, in theory, could avoid the need to do clipping in projected clip space, which would totally avoid some of these traps.</p>

CC BY-SA 4.0
2022-03-15T01:27:57.537Z
Your comment is clearly about rasterization when the question was specifically about ray tracing. Clipping planes are not relevant to ray tracing. The answer is 'no' you don't need it.
Chris_F
CC BY-SA 3.0
2016-04-17T18:17:05.423Z
2016-04-17T19:31:05.250Z
2016-04-17T19:31:05.250Z
John Calsbeek
<p>Would it be, at least theoretically, possible to render without a near clipping plane? Could raytracing ignore this perchance? </p>

<p>Quite many budding 3d artists have a <em>WTF</em> moment the first time they encounter the clipping plane. If this could be avoided then it would be a big win for usability of 3D authoring apps. Its not one of those things a normal artist would think about until explained.</p>

CC BY-SA 3.0
2016-04-17T11:06:14.913Z
Imagine having a 3d object INSIDE your eye. How would that look like in your opinion? What do your buddies think?
Andreas
CC BY-SA 3.0
2016-04-17T11:17:16.863Z
@Andreas yes but that only how the linear algebra trick works we could use numerous other tricks.
joojaa
CC BY-SA 3.0
2016-04-17T11:21:15.167Z
What other tricks?
Andreas
CC BY-SA 3.0
2016-04-17T11:50:04.330Z
@Andreas we could do spherical projections for example. Just because we have one mathematical model that works does not mean there are no other ways to solve problems.
joojaa
CC BY-SA 3.0
2016-04-17T14:59:11.590Z
Removed my answer
Andreas
<raytracing><clipping>
Could we dispense the near clipping plane?
joojaa
# Could we dispense the near clipping plane?

(Asked by: username_0 on 2016-04-14)

Would it be, at least theoretically, possible to render without a near clipping plane? Could raytracing ignore this perchance?

Quite many budding 3d artists have a *WTF* moment the first time they encounter the clipping plane. If this could be avoided then it would be a big win for usability of 3D authoring apps. Its not one of those things a normal artist would think about until explained.

**Tags:** raytracing, clipping

> **Comments:**
> **username_1**: Imagine having a 3d object INSIDE your eye. How would that look like in your opinion? What do your buddies think?  
> **username_0**: @username_1 yes but that only how the linear algebra trick works we could use numerous other tricks.  
> **username_1**: What other tricks?  
> **username_0**: @username_1 we could do spherical projections for example. Just because we have one mathematical model that works does not mean there are no other ways to solve problems.  
> **username_1**: Removed my answer  

---

## 2 answers

### Answer by username_5 on 2016-04-17. Score: 4 | Accepted answer

The near clipping plane is a fundamental feature of projective rasterization. To borrow a diagram from Eric Lengyel's [Projection Matrix Tricks](http://www.terathon.com/gdc07_lengyel.pdf) presentation:

[![Diagram of camera space to NDC transform](https://i.sstatic.net/wd9gx.png)](https://i.sstatic.net/wd9gx.png)

The displayed region of clip space (that you can think of rasterization as happening in) is a box which has a "near" face. This is associated with the near clip plane. But we can push the far clip plane out to infinity, so can we pull the near clip plane in to zero?

Mathematically, you absolutely can! The only point that presents a problem is the eye itself: you can get infinitely close to the eye and still resolve to a single point in clip space. However, if you have a triangle that passes through the eye, you still need to clip it, and to clip it you need an actual plane, not a concept like "infinitely close to the eye."

More critically for the current rasterization pipeline, the perspective divide does fun things with numerical precision. See the line at NDC 0 in the diagram above? It's halfway through the viewing volume in clip space, but not at all near halfway through the view frustum in camera space. In fact, its position depends on the near clip plane's distance to the eye! This means that over half of the depth range in clip space is in that region near the eye. As you get the near clip plane closer and closer to the eye, that plane pulls in even closer and you waste more and more depth range. This isn't necessarily fundamental—you don't have to store z/w in the depth buffer—but it is convenient. Here's an [article from Nathan Reed](https://developer.nvidia.com/content/depth-precision-visualized) about depth precision, and a few notes about [why the projected z/w depth is useful](http://www.humus.name/index.php?ID=255) from Emil Persson.

Finally, I'll plug [a post in the excellent "A trip through the Graphics Pipeline"](https://fgiesen.wordpress.com/2011/07/05/a-trip-through-the-graphics-pipeline-2011-part-5/) series, which is very interesting and references homogeneous rasterization algorithms which, in theory, could avoid the need to do clipping in projected clip space, which would totally avoid some of these traps.

> **Comments:**
> **username_6**: Your comment is clearly about rasterization when the question was specifically about ray tracing. Clipping planes are not relevant to ray tracing. The answer is 'no' you don't need it.  

---

### Answer by username_2 on 2016-04-14. Score: 5

The near clipping plane in rasterizing setups with perspective projection is there to avoid a divide by 0 and bound the possible depths for orthogonal projection.

With a bit of extra math you can make the depth stored in the depth buffer linear again. However you still need the guard against the divide by 0.

In raytracing the near plane can be at 0 no problem. There is nothing technical stopping you from putting it at -10 however (besides that it would be very odd).

> **Comments:**
> **username_0**: Yes i know this, but wondering if there could be a alternate strategy to avoid division by 0.  
> **username_3**: You could avoid divide by zero by pushing in or out values that would cause one.  
> **username_1**: @username_0 Raytracing does not divide by zero.  
> **username_0**: @username_1 Yes i know that neither does reality ;)  
> **username_4**: @username_0 But have you ever tried looking at something that's been pushed through your eyeball? :-)  
> **username_0**: @username_4 Actually I have, although i tried to not concentrate on it.. But the projectile geometry actually pushes everything that crosses your view plane trough one point which reality does not ;)  

---

