1
$\begingroup$

Right now, i have two pictures which come from another game engineer (SecondLife). One is a Colour Picture, another one is a Depth Picture. And, i am new to enter into the compositing world so that i dont know if the Z (Channel) in some Blender Nodes stand for the Depth Channel there. Oks, Simplify what i want to do: I want to composite pictures for making the DOF (Depth of Field) in Blender Node Editor

and i read some articles, they said i need two pictures, one is colour picture, another one is a depth picture. (That's why i got them from SecondLife as Materials)

enter image description here

enter image description here


Also, i have no thoughts about how to link them in Node Editor...

$\endgroup$
1
$\begingroup$

First off you are going to want to get the depth data in a better format. The image in your question is an eight bit png, meaning it can only hold 256 different values. You need more precision then that to get a good depth map.

Now in the compositor, take your two images (color, and depth) and plug them in to a Defocus node. I had to do some manipulations to the depth data before it was usable. First use a ColorRamp node to move the black to white range to where you need it. (In your depth image the black part goes from .0061 to about .122 then jumps to white.) So I moved the black slider to .005, and crushed the white end down to .011. Now the lack of precision in the depth image becomes very clear. To compensate for that I blurred the depth image after the ColorRamp node.
Now that can be used as the Z for the Defocus node.

Tweek the Z-Scale (blur amount), Max Blur and Threshold in the Defocus node till you get an image that is to your liking.

compositor nodes

This is what I got with the nodes above and using your two images.
final result

$\endgroup$
0
$\begingroup$

I think this will work for you. enter image description here

To get the misst value enabel it in render layer -> passes -> check box - misst

$\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.