7
$\begingroup$

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.

$\endgroup$
  • 2
    $\begingroup$ can explain more than this ? $\endgroup$ – Chebhou Apr 19 '15 at 11:06
  • $\begingroup$ You want the mist denser at lower altitudes? $\endgroup$ – VRM Apr 19 '15 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 Apr 20 '15 at 16:36
  • $\begingroup$ Related: How to make low lying fog $\endgroup$ – cegaton May 28 at 14:52
8
$\begingroup$

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

$\endgroup$
  • $\begingroup$ thanks thats looks interesting, guessing I can swap the math for a colour ramp, will give this a try. $\endgroup$ – user3471 Apr 20 '15 at 19:02
  • $\begingroup$ @user3471 I guess you can , also there is a map value node you can use $\endgroup$ – Chebhou Apr 20 '15 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 Apr 21 '15 at 6:35
  • $\begingroup$ @user3471 so you mean no gradient mist (constant from depth a to b ) along the depth ? $\endgroup$ – Chebhou Apr 21 '15 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 Apr 21 '15 at 10:08

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.