Set HSV and Blur in Compositor By Distance of Objects from Camera

Has anybody here seen an Add-on, script, or compositing method that automatically adds HSV desaturation and blur effects to objects relative to their distance from the camera.

It seems this must have come up before.

I want to be able to move the camera all over a large scene, and wherever it goes, if it pans back where it came from, I’d like to have the desaturation and blur affect objects previously close to the camera. I’d prefer not to add Mist to the World settings.

Thanks for any help!

You can use the Z pass to achieve these effects. Z passes are rendered automatically when using cycles by default.

The Z-buffer is black and white data that relates to how far away objects are from the camera.

Control the Z-buffer using a normalize node to normalize the Z buffer values to a 0 - 1 range, then for adittional control you can use a color ramp. then plug this into either the Blur node as the factor, or into one of the inputs of the HSV node and it should get the effect you want.

Theres good information on this topic in answers to the question asked here - http://blender.stackexchange.com/questions/1555/how-can-i-get-a-depth-of-field-render-pass

(Scroll down a bit till you see “creating a black and white depth image”

Is the Blur node kind of the default node that merges the unaffected render image with the fx adjustments to the image?

I’m very new to working with Nodes and Compositing and I’m trying to understand the logic of it.

It seems that you can take a property, or a “pass,” in the rendering process, apply various stylizations and effects to that part of the render, and then combine it back into the final image output.

For example, you take 2 Input nodes with Alpha Transparencies and combine them into one image using the Alpha Over node.

For the sake of simplicity and ability to see in the modeling and animating process what parts of the render will be affected by depth of field, I have tried to use the “hijack mist,” process in the link you sent. Here’s what seems like the logical train of thought for affecting the mist parameter of the render:


Like you take the part of the render process you want to affect, add some nodes in, and then somehow merge them back into the final output. I don’t see how that is done in a case like this.

Anybody have thoughts on the sort of general big picture process for this? Is it different for every node type that you use?

Thanks for any help!