# What the difference between View Distance and Ray Length?

What the difference between View Distance and Ray Length? From the description I understood, that besides Ray Length is Cycles only (in EEVEE they are the same) and doesn't work with volumes; they actually do the same:

Ray Length Cycles Only
Distance traveled by the light ray from the last bounce or camera.

View Distance
Distance from the camera to the shading point.

But the result is different:

Ray Length View Distance

That is the difference? Why renders are not the same?

The difference between those two values is the following: the View Distance from the Camera Data node is "real" distance between the camera object (or the virtual camera position in the 3D Viewport when you are not in camera view) and the surface you are looking at, while the Ray Length of the Light Path node is the distance a ray has traveled from the surface to the camera (object or virtual).

Now while this first seems to be the same, the Ray Length is dependent on more than just the space between object and camera: the Clip Start value. Because a raytracing render engine like Cycles only cares for rays which are within the clipping range, therefore the length of the ray is determined by the distance it travels until it hits the clipping border.

I've tried to illustrate this in the following examples. In the first image, there is a camera at (0, 0, 0) looking in +Y direction and a plane at a Y distance of 3 m. The camera has a Clip Start of 1 m, so the View Distance from the camera straight to the plane is 3 m.

The Ray Length however is the length of the ray from the plane to the camera until it reaches the Clip Start border, so this is the length it travels from the camera's clipping border until it hits a surface. Since this border is 1 m away from the camera, the ray travels 2 m from this point to the plane. I do not know if this is technically the most accurate explanation, but this is the result. Of course the parts to the sides of the plane are further away from the camera, I've just drawn circles to show the minimum View Distance/Ray Length.

In the second example everything stays the same, only the Clip Start is now 2 m. Since the camera and plane are still in the same location, the View Distance does not change. The Ray Length however is now shorter: since everything is clipped up to 2 m from the camera, the ray only travels 1 m to be rendered.

I've found another important difference. Ray length includes reflection and refraction in the calculation:

• Yes sure, I did not mention it since the description from the manual which you quote in your question already says "from the last bounce". Bouncing off of a reflective surface which is further away than the object results in a longer ray than the one that reaches the object directly from the camera. Commented Jun 19 at 12:15