Struggling to work out how to make a depth AND height pass, so I can use them in compositing an animation of a city.

Depth is easy...height, not so...

Is there some way to mix a vertical gradient with a mist pass to get this result? Or is there a different way?

I am trying to get the effect of a denser mist at lower levels.

Let me know if i need to clarify further.

  • 2
    $\begingroup$ can explain more than this ? $\endgroup$
    – Chebhou
    Commented Apr 19, 2015 at 11:06
  • $\begingroup$ You want the mist denser at lower altitudes? $\endgroup$
    – J Sargent
    Commented Apr 19, 2015 at 11:26
  • $\begingroup$ yes, but this also needs to work with an animation , so must still be effective if we move through a scene. $\endgroup$
    – user3471
    Commented Apr 20, 2015 at 16:36
  • $\begingroup$ Related: How to make low lying fog $\endgroup$
    – user1853
    Commented May 28, 2019 at 14:52

1 Answer 1


Basic idea : render additional layer with overriding material which assign a grayscale value based on the point height , use this layer as height pass

Details :

create the overriding material that will replace all materials in the height pass as follows :

enter image description here

setup an the height pass to use the override material :

enter image description here

in the compositor use the color output of the Height layer as a height pass :

enter image description here

after compositing here is the result :
no height :
enter image description here with height :
enter image description here

  • $\begingroup$ thanks thats looks interesting, guessing I can swap the math for a colour ramp, will give this a try. $\endgroup$
    – user3471
    Commented Apr 20, 2015 at 19:02
  • $\begingroup$ @user3471 I guess you can , also there is a map value node you can use $\endgroup$
    – Chebhou
    Commented Apr 20, 2015 at 19:39
  • $\begingroup$ Having trouble mixing this with my mist pass than I am using for depth.What I need to do is only have mist at far and low levels, however when try to mix the height map and depth I get the mist at the front not back.Maybe i should be using an transparent material instead of the black? $\endgroup$
    – user3471
    Commented Apr 21, 2015 at 6:35
  • $\begingroup$ @user3471 so you mean no gradient mist (constant from depth a to b ) along the depth ? $\endgroup$
    – Chebhou
    Commented Apr 21, 2015 at 8:42
  • 1
    $\begingroup$ I think i may have figured it now. Because the gradient for the height is on the actually meshes unlike the z-dpeth or mist pass it does not effect the sky or background. This was creating a weird effect when mixing the height layer with my mist pass.So on the height layer i added an alpha over node with a white background and this seems to work. $\endgroup$
    – user3471
    Commented Apr 21, 2015 at 10:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .