What is the Light Path node in Blender?
The Light Path node in Blender is able to access and manipulate how light works in your scene. The first seven outputs of the Light Path Node let you differentiate between various kinds of light rays. The last six outputs give you more control over how the light rays should behave in-between bounces. The light path node has some capabilities with Eevee, but is far more powerful in Cycles.
How does the Light Path node work?
Cycles is a physically based renderer (PBR) in Blender. In other words, Cycles tries to closely mimic how real world light works. But, as artists, sometimes we want to control the lighting of our scene beyond what is physically possible.
That’s where the light path node comes in! The light path node allows you to intercept the light rays in your scene at almost any point during their journey and trick them into thinking whatever you want them to think.
How do Light Paths work in Cycles?
Although it is not totally necessary to understand how light paths work in Cycles in order to use the light path node, it certainly helps. I haven’t found anywhere else online that explains this in simple terms either, so I’ll give it a try!
Simply put, when you render an image, every pixel of your camera gets shot into your scene like a tiny bouncy ball. This is known as a ray. Those rays are like sonar. They are thrown out, bounced around a few times, and reach a light source with information about what they find. When a ray begins, it starts as a Camera Ray. After its first bounce, it becomes a Reflection Ray. When a Camera Ray or Reflection Ray go through glass, it becomes a Transmission Ray. Reflection Rays and Transmission Rays can also carry up to three properties:
- Diffuse – If the ray gets bounced off of a diffuse object
- Glossy – If the ray gets bounced off of a glossy object
- Singular – If the ray is bounced off a perfectly sharp object like a mirror
The very end of a ray’s journey is known as a Shadow Ray, which is when the ray reaches a light source.
Does Eevee support the Light Path node?
Eevee is a real time renderer (RTR) in Blender. Eevee, like many game engines, needs to employ a lot of tricks that allow it to render incredibly fast. Thus, it fundamentally works with light differently than Cycles. Technically, Eevee has no concept of “light paths” like Cycles does. Because of this, the light path node in Eevee is not fully functional. Fortunately though, the Blender developers managed to keep some of its utility in Eevee, which I will outline in this guide.
The “Is Camera Ray” output
✅ Cycles ✅ Eevee
If the ray is a Camera Ray, this output returns 1, otherwise it returns 0. For example if you want your entire scene to act as if the sky is blue, but you want the sky itself to appear purple in your final render, use the “Is Camera Ray” output.
The “Is Shadow Ray” output
✅ Cycles ✅ Eevee
If the ray is a Shadow Ray, this output returns 1, otherwise it returns 0. You can use this to remove shadows in your scene, change their color, or change their intensity among other things.
The “Is Diffuse Ray” output
✅ Cycles ✅ Eevee
If the ray is a Diffuse Ray, this output returns 1, otherwise it returns 0. For example if you want the diffuse objects in your scene to act as if your object is blue, but you want the object itself to appear purple in your final render, use the “Is Diffuse Ray” output.
The “Is Glossy Ray” output
✅ Cycles ✅ Eevee
If the ray is a Glossy Ray, this output returns 1, otherwise it returns 0. With this one output you can effect any glossy object (metals, mirrors, glass, etc.). For example if you want the glossy objects in your scene to act as if your object is blue, but you want the object itself to appear purple in your final render, use the “Is Glossy Ray” output.
The “Is Glossy Ray” output already includes Singular Rays by default. You can remove Singular Rays from this equation with “subtract” and “multiply” math nodes.
The “Is Singular Ray” output
✅ Cycles ❌ Eevee
If the ray is a Singular Ray, this output returns 1, otherwise it returns 0. This will effect any glossy or glass node with little to no roughness (specifically with a roughness below .018 in my tests). I have personally never needed to use this output for any reason.
The “Is Reflection Ray” output
✅ Cycles ❌ Eevee
If the ray is a Reflection Ray, this output returns 1, otherwise it returns 0. Remember that a Reflection Ray contains Diffuse, Glossy, and Singular rays. This output is the exact same thing as if you were to multiply the “Is Diffuse Ray”, and “Is Glossy Ray” outputs together.
So if you want all the objects in your scene, minus glass & transparent objects, to act as if your object is blue, but you want the object itself to appear purple in your final render, use the “Is Reflection Ray” output.
The “Ray Length” output
✅ Cycles ❌ Eevee
The “Ray Length” output returns the length of the rays traveling from your object or light. A practical example would be using this to change the falloff color of your light, or create light profiles, among other things. Also, remember that the first seven outputs before this are for differentiating between rays, and can be used in partnership with this one.
The “Ray Depth” output
✅ Cycles ❌ Eevee
The “Ray Depth” output returns the number of times the rays in your scene have bounced around. You could use this to control how bright your bounced light is, or change the color of a certain bounced light, etc.
The “Diffuse Depth” output
✅ Cycles ❌ Eevee
“Diffuse Depth” works exactly like “Ray Depth” except it only accesses Diffuse Rays. The “Diffuse Depth” output is the same exact thing as if you were to multiply the “Ray Depth” output by the “Is Diffuse Ray” output.
The “Glossy Depth” output
✅ Cycles ❌ Eevee
“Glossy Depth” works exactly like “Ray Depth” except it only accesses Glossy Rays. The “Glossy Depth” output is the same exact thing as if you were to multiply the “Ray Depth” output by the “Is Glossy Ray” output.
The “Is Transparent Depth” output
✅ Cycles ❌ Eevee
“Transparent Depth” returns the number of transparent surfaces passed through. For example, you could use this to make a blue object appear purple through a transparent material.
The “Is Transmission Depth” output
✅ Cycles ❌ Eevee
“Transmission Depth” works exactly like “Ray Depth” except it only accesses Transmission Rays. The “Transmission Depth” output is the same exact thing as if you were to multiply the “Ray Depth” output by the “Is Transmission Ray” output.