# Adding "Mist overlay" in live Viewport Render Display - Cycles

Hi lovely Blender community,

I mostly work on larger environment scenes in which depth plays a decisive role. Now there are several methods to get this, either you render volumes (which unfortunately increase the rendering time drastically) or you use the mist or depth past in post work. Now I asked myself whether it isn't possible to put the mist pass in the live render viewport over the beauty pass, so that you can see live how the mist pass affects the entire scene without having to do this first in the post work. Actually this should be possible with a blend effect, since you can also look at all individual passes live in the render viewport. I am grateful for your answers!

• Sounds interesting, though I’m not aware of it. I think it might be kind of nice if you could actually just activate the compositor to work on the view port, but I’m not sure if that would work. Nov 11 '21 at 14:23

It was initially planned for the 2.9 series but was postponed.

Apparently it is planned in one of the next versions for Eevee, but no ETA.

I guess it will be part of the general Eevee refactor but it's hard to predict when it will be out or how it will be used.

• Coolio, can't wait for that feature :D Nov 12 '21 at 9:30
• Thanks for give us the information! Hope to see it soon. Would be great for early lookdev. Nov 12 '21 at 23:10

Currently, the only way to get the mist pass to be included in the combined pass, that I can conceive, is to create a mist node group and add it to every material.

## Node Group

I have tested the following node group with refraction, transparency, and volumetrics with fair results at low densities for everything except Eevee's volumes:

The Multiply node (just to the right of the Mix node) is the density control.
Color and intensity can be controlled via the Emission node.

To use the node group, simply insert it right before the Surface output.

For Cycles volumes, be sure to insert a Transparent BSDF as shown.

This node group also works for the World material.

## Script

I have also made a crude script to add the mist node to all materials in the current scene which do not already contain the node group.

import bpy

for ob in bpy.context.scene.objects:
if ob.type not in ('MESH', 'META', 'CURVE', 'SURFACE', 'FONT', 'VOLUME'):
continue
for slot in ob.material_slots:
main_tree = slot.material.node_tree
mist_in_tree = False

for node in main_tree.nodes:
if node.node_tree == bpy.data.node_groups['Mist']:
mist_in_tree = True
break

if mist_in_tree:
continue