0
$\begingroup$

I wonder how I can set the values in the Map Value node to get the best output. I want the pixels values of objects to be rendered according the to the distance from the camera in meters unit. I'm using blender-render Any advice please?

I tried using the normalize node but it causes flickering when my file has animation that's why I want to know how I can set the values of the Map Value node correctly.

Like the nearest point of the object to the camera should be white then pixels of the object degrades to grey until the furthest pixel of the dog to be black with the background, where the z value of each pixel will have the distance between it and the camera in metric unit, so that closer pixels (white) will have lower z value than further pixels (black).

My .blend file can be found here: Blend File

$\endgroup$
  • $\begingroup$ To do this you can place a normalize node after the Zpass output, this should fix your problem $\endgroup$ – Delagone Feb 6 '17 at 13:14
  • $\begingroup$ @Delagone but using the normalise will normalise my depth values to be between 0-1 and I don't want this $\endgroup$ – Tak Feb 6 '17 at 13:17
  • $\begingroup$ Ah I see, in that case you can try adding 2 dummy objects, one at the closest part to the camera and one for the fartest part you want to see the falloff. Disable all lightpasses or make it transparent from the camera ray and parent these objects to your camera. $\endgroup$ – Delagone Feb 6 '17 at 13:24
  • $\begingroup$ @Delagone I'm not sure what you mean, but what is the difference between what you said and adjusting the clipping range of the camera? $\endgroup$ – Tak Feb 6 '17 at 13:26
  • $\begingroup$ the difference is that with clipping you might get a faulty Zpass due to objects that surpass these values. With parents everything is parented to your camera and therefor not able to differentiate in animation. eg. objects apearing and disappearing in background/foreground will result in an Zpass greater or less then 1 or 0 as you pointed out. Can't provide you detailed workflow because I'm currently not behind my pc. $\endgroup$ – Delagone Feb 6 '17 at 14:45

Your Answer

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

Browse other questions tagged or ask your own question.