1
$\begingroup$

I followed this tutorial on how to create mist in blender. https://www.youtube.com/watch?v=CxNeMMZs_sM

I have this dome that will be where the camera is pointed at, but for some reason the mist is always appearing on top of it even though I set it so that the mist would appear behind it.

enter image description here enter image description here

enter image description here

Any help would be appreciated.

$\endgroup$
  • 2
    $\begingroup$ In your screenshots you seem to have enabled the Mist pass but aren't using it in the compositor - you're using the Depth instead. $\endgroup$ – Rich Sedman May 22 '18 at 7:42
  • $\begingroup$ Whenever I plug in mist instead of depth nothing shows up. $\endgroup$ – opaque_dragon May 22 '18 at 16:09
  • $\begingroup$ Mist returns a value between 0.0 and 1.0 so you can feed that directly into your Mix ‘Fac’ socket - so shouldn’t need those Maths nodes. From your screenshot you have mist configured to vary from 1m to 500m so check that it matches you scene scale. The ‘Clamp’ on those Maths nodes might cause you a problem too - as it stands the Divide will return only betwee 0.0 and 1.0 (as it’s clamped) so the clamped Subtract of 0.7 can only return beteen 0.0 and 0.3 (since 1.0 - 0.7 = 0.3) which will be limiting your maximum mist when trying to base it on Depth. $\endgroup$ – Rich Sedman May 22 '18 at 16:41
  • $\begingroup$ Could we take this into live chat? Whenever I turn off the clamps the colors invert. $\endgroup$ – opaque_dragon May 23 '18 at 5:15
  • $\begingroup$ Can’t really chat as only limited internet (most of my Blending is offline while travelling) but I’ll try and write an answer to explain. However, the Clamp on the last Math node should remain (since that stops the Fac being out of range) - the one on the Divide will be the main problem. $\endgroup$ – Rich Sedman May 23 '18 at 15:51
4
$\begingroup$

Here are two ways to produce a mist effect in the compositor.

Mist Pass

Simply enable the Mist pass in the Render Layers. You can then adjust the depth of the mist in the World settings as in the screenshot in your question. ie,

mist

To use the Mist pass you simply use the Mist render layer output as the Factor of a Mix node to mix between your rendered image and the mist color :

mist pass

To adjust the mist you need to adjust the Mist Pass settings in the World properties and re-render the scene. You could get limited adjustability by adjusting the Mist output using Maths nodes or similar before using it in the factor but it's limited to the range of mist in your original settings (eg, if the mist ends at 500m then there's no way of adjusting it further than that). You're generally best just adjusting the Mist Pass settings and re-rendering.

Depth Pass

An alternative is to use the raw Depth pass and manipulate it using Maths nodes or similar to get the desired mist. This can be achieved as follows :

mist from depth

Here the Divide maths node re-scales the Depth - we need to convert the raw depth so that the desired depth of mist corresponds to the mathematical range of 0.0 to 1.0 to use in a Mix node. Adjust the divisor to get the desired depth. The Subtract node allows you to adjust the distance to the start of the mist.

Note that the Divide node is set to not Clamp but the Subtract is set to Clamp. The Subtract set to Clamp is to ensure that the value passed to the Factor is always within the range 0.0 to 1.0 - otherwise strange effects can occur since the compositor nodes do not automatically clamp the factors (as Cycles material nodes do). However, Clamping the Divide node would skew the calculation and can cause undesired effects - such as the mist not increasing to maximum value at the far distance of its range.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.