depth layer


#1

Hello, I’m dealing with a depth layer exported from XSI into Nuke.
So everything is normalized with values between 0 and 1.

I am trying to get the z value of the initial points, I have the settings for the camera in XSI something like:

fov :53.638
near plane 0.1
far plane 322768

does that mean that [0, 322768] got linearly mapped to [0.1]?

so to restore the initial z, i just multiply back by 322768 ?
would that make sense?

I would really appreacite any suggestion that you might have,

thanks a lot!


#2

That should get you pretty close, but more accurate would be the expression

lerp(z,0.1,322768.0)

Which will fit a range from 0 to 1 in to a custom range.

lerp (
Type a,
Type b,
Typeb x
)

Returns a point on the line f(x) where f(0)==a and f(1)==b. Matches the function in RenderMan and other shading languages.

In your case, I think multiplying should work fine though, since the small imprecision isn’t likely to be an issue and will probably be lost in floating point magic anyways.


#3

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.