I need achieve the following effect that can be observed in the image. Is it possible?
-
4$\begingroup$ Yah, its called fog... $\endgroup$– X-27 is done with the networkDec 14, 2016 at 15:28
-
5$\begingroup$ use the mist pass in the compositor $\endgroup$– lbalazscsDec 14, 2016 at 15:45
-
5$\begingroup$ It can also be done with volume scattering/volume absorption. What render engine are you using? $\endgroup$– user1853Dec 14, 2016 at 15:47
-
$\begingroup$ related: blender.stackexchange.com/questions/43600/… and blender.stackexchange.com/questions/67832/… $\endgroup$– user1853Dec 15, 2016 at 11:58
-
$\begingroup$ also related: blender.stackexchange.com/questions/7797/… and blender.stackexchange.com/questions/26721/… $\endgroup$– user1853Dec 15, 2016 at 12:06
2 Answers
There are a few ways to make the objects fade in the distance like the image you show.
The most realistic would be replicating what would happen in real life: Suspended particles (haze, smoke or dust) would float in the atmosphere limiting visibility of objects in the distance.
To do that in Cycles you can add volume scattering and volume absorption shaders to the world's volume.
A different way to do something similar would be to use a mist pass.
The mist pass can be enabled on the scene section of the properties panel
It creates a black and white image that gets progressively whiter in the distance.
It has a start and depth settings, that can be set on the world section. Objects that are closer to the start distance will be fully black, and those past the maximum distance will be fully white.
The the range from start to end can be visualized as a line, by enabling Display>Mist on the camera settings.
The Mist pass has to be composited into the rendered image using the compositor. Usually you want to Add the mist pass on to the image pass. The Factor on the color mix node will determine how much of the mist pass will be added to the image.
A different way to use the mist pass would be to use it to control the color on the image:
Lastly a different approach would be to use a normalized Z pass.
The Z pass represents the distance from objects to the camera. The limits are controlled by the clip distances on the camera.
Note that the Z pass, being a representation of distance will likely exceed the limits of the 0-1 range of what can be displayed as an image (0 being black, 1 being white), so normalizing the Z pass will convert those values to something that can be visualized.
The main disadvantage of this approach is that the Z pass is not antialiased, so your image might look blocky or pixelated on curves or diagonal edges.
For Additional info on the difference between mist and Z pass read: Difference between a mist pass and a normalized z-buffer?
-
3$\begingroup$ According to wikipedia, the effect should be the a decreasing contrast and saturation, and a shift towards blue. I'm not sure that adding the mist pass is the best way to achieve it. en.wikipedia.org/wiki/Aerial_perspective $\endgroup$ Dec 15, 2016 at 14:16
-
1$\begingroup$ The color shift is not my main concern (it is easy to add a color shift), I am worried about the desaturation method. Adding the same value to all three channels will create a more desaturated color, but at the same time it increases the overall brightness, which was not (?) intended. It pushes the pixels towards white instead of pushing them towards grey. In reality there is scattering, but also absorption. $\endgroup$ Dec 15, 2016 at 15:36
-
3$\begingroup$ I've always used it with the regular "mix" (over) blend mode, just as a mix factor. Distant haze doesn't add light, it replaces it with reflections off the mist. Thus applying the pass should replace color (as in mix/over), not add it. $\endgroup$ Dec 18, 2016 at 19:08
You could use the Z pass to influence a mix node set to saturation (selected node in the first image below). In this example, I also mix it with a blueish color that's also influenced by the Z pass. (This method is not very accurate, but it's faster than using a volume scatter node.)
Here's the image before compositing (no distance desaturation or colorization)
and after compositing