By pixel perfect I meant compared to a rendered Z. I'm having really high
values in my P pass (>100000), so it might be rounding off errors. I've
tried with both 16 and 32bit renders though.

*I've found the easiest way is to do a coordinate system transform from
world space to camera space then just take the Z channel. Note that,
depending on the shutter angle of the render vs the imported camera
keyframes that you may get a minor offset compared to rendering "in camera".
*
*
*
Interesting. Do you have an example setup to share?

Cheers!


2013/5/13 Michael Garrett <[email protected]>

> Yes, it's worth taking note of that and it's caught me out in the past. If
> you take the vector from the camera position to any position coordinate in
> the scene you're getting the true distance, whereas a Zdepth image is just
> the z component of that distance.
>
> I've found the easiest way is to do a coordinate system transform from
> world space to camera space then just take the Z channel. Note that,
> depending on the shutter angle of the render vs the imported camera
> keyframes that you may get a minor offset compared to rendering "in camera".
>
> Michael
>
>
> On 13 May 2013 09:41, Eetu Martola <[email protected]> wrote:
>
>> Most renderers write Z as orthogonal distance to the (extended)
>> cameraplane, instead of the actual distance between the pixel position and
>> camera center point. Is your perceived difference greater toward the image
>> edges?
>>
>> eetu.
>>
>>
>>
>> On 13.5.2013 16:36, Steve Newbold wrote:
>>
>>> Pixel perfect compared to what?  A depth pass from the same render as
>>> the world position pass?
>>>
>>> How far off are your values?  Can it be put down to rounding of the
>>> camera position from your 3D package or rounding on the pass values.  Is
>>> your depth pass 32bit float?  Other things to check are premultiplcation
>>> of the position pass from the renderer.
>>>
>>> Steve
>>>
>>>
>>> On 13/05/13 14:26, Simon Björk wrote:
>>>
>>>> Hi all,
>>>>
>>>> I'm looking for a way to accurately converting a point position pass
>>>> (world space) to a depth pass (camera space). I have a camera available.
>>>>
>>>> The following expression gets me close but not pixel perfect:
>>>>
>>>> set cut_paste_input [stack 0]
>>>> version 7.0 v4
>>>> push $cut_paste_input
>>>> Expression {
>>>>  temp_name0 cx
>>>>  temp_expr0 shot_camera.translate.x-r
>>>>  temp_name1 cy
>>>>  temp_expr1 shot_camera.translate.y-g
>>>>  temp_name2 cz
>>>>  temp_expr2 shot_camera.translate.z-b
>>>>  temp_name3 dist
>>>>  temp_expr3 sqrt(cx*cx+cy*cy+cz*cz)
>>>>  channel0 rgba
>>>>  expr0 dist
>>>>  channel1 none
>>>>  name Expression7
>>>>  label "convert p world to z-depth"
>>>>  selected true
>>>>  xpos 266
>>>>  ypos -50
>>>> }
>>>>
>>>>
>>>>
>>>> ______________________________**_________________
>>>> Nuke-users mailing list
>>>> [email protected].**co.uk<[email protected]>
>>>> ,http://forums.**thefoundry.co.uk/ <http://forums.thefoundry.co.uk/>
>>>> http://support.thefoundry.co.**uk/cgi-bin/mailman/listinfo/**nuke-users<http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users>
>>>>
>>>
>>>
>>>
>>> ______________________________**_________________
>>> Nuke-users mailing list
>>> [email protected].**co.uk<[email protected]>,
>>> http://forums.thefoundry.co.**uk/ <http://forums.thefoundry.co.uk/>
>>> http://support.thefoundry.co.**uk/cgi-bin/mailman/listinfo/**nuke-users<http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users>
>>>
>>>
>> ______________________________**_________________
>> Nuke-users mailing list
>> [email protected].**co.uk<[email protected]>,
>> http://forums.thefoundry.co.**uk/ <http://forums.thefoundry.co.uk/>
>> http://support.thefoundry.co.**uk/cgi-bin/mailman/listinfo/**nuke-users<http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users>
>>
>
>
> _______________________________________________
> Nuke-users mailing list
> [email protected], http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users
>
_______________________________________________
Nuke-users mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

Reply via email to