# How to do volumetric lighting for a forest scene?

I have scene that looks like this:

And I want to add volumetric lighting to it so that light forms a rays of light when it go through the trees like on this example that I found in youtube:

But the problem is that all of these tutorials show how to make this lighting coming from windows, but when I try to replicate it in my forest scene it looks like big ugly fog with cubical shape. Also the light is coming from the back of the camera (as you can see) and there are some spots that needs this special lighting (like places where light goes through trees) and some that don't (like big bright are on the bottom left corner) so I can't just add a giant cube to all of the scene.

## 1 Answer

The principles that apply for a forest scene are the same as for any other scene.

Think of volumetrics as shining a light in an environment that has suspended particles in the air, like haze or smoke.

All you need is to add a volume scatter node to the world's volume, and set it to a lower value than the default (in the following examples the value I chose is 0.01).

(To make the scene less compute-intensive you might want to use a cube that surrounds the scene and that has a volume scatter node, as explained in this link: Atmospheric lighting in cycles)

Then you need a light that is bright enough to cut through the volume scattering. You might need to set the strength at a very large value.

To get well defined shafts of light, try to keep the light size as small as possible. Point or Spot sources work the best for this effect (if you choose to use a sun lamp, then don't use volume scattering in the world, and use a mesh as volume scattering domain).

The effects of Volumetric lighting are more visible when bright light beams are in front of dark areas of a scene, and are less visible when the background is bright. Also, Volume scattering works best with back lighting (when the light is behind the objects in the scene) and side lighting, like the image posted on the question or any of these reference images.

Back light

(click on any of the images to enlarge)

Side light

Front light

If you have the main light source behind the camera, the problem is that the light is bounced back at the camera before it lights the scene, making everything brighter and flatter (the dark areas are not as dark any more). The same effect as driving through fog, where it is harder to see because the light is reflected back at the driver instead of lighting the road and the landscape.

An alternative way to deal with your scene is to set a bright volumetric light for the landscape (to be the sun or moon or whatever) and smaller less bright area lights to reveal the shapes of the house. Those lights can be invisible to the volume scatter by disabling Volume Scatter Ray Visibility in the Cycles Settings. That way, you can make lights that will not make the atmospheric haze or smoke any brighter.

Volumetric effects will create noisier images, so you might need to increase the number of samples for rendering.