DeepToImage compatibility issue when Z=inf

39 views
Skip to first unread message

Shawn Neely

unread,
Apr 14, 2017, 8:14:30 PM4/14/17
to OpenDCX Forum
Attached is a small legacy deep EXR file which has pretty RGB colors and deep.front = deep.back = inf.  When we flatten it with the Foundry version of DeepToImage we get the expected pretty RGB values out, but when we flatten with the OpenDCX version of DeepToImage we always get a black output.  We've tried all different combinations of the various OpenDCX options, but can't seem to get the flattening to output the original RGB colors.  This is causing some consternation, because we claimed that the new DeepToImage is legacy-compatible with the original Foundry version, but some existing Nuke scripts are now generating black outputs.

Can the new-and-improved DeepToImage be modified to flatten infinite Z deep samples to match the old behavior?

thanks,

Shawn Neely
(on behalf of my Pixar colleagues)
small_inf_deep.exr

Shawn Neely

unread,
Apr 14, 2017, 8:37:57 PM4/14/17
to OpenDCX Forum
BTW, images like this are somewhat common in our scripts because it's the default output from DeepFromImage if you don't explicitly specify z.

Jonathan Egstad

unread,
Apr 14, 2017, 9:40:35 PM4/14/17
to OpenDCX Forum
On Friday, April 14, 2017 at 5:37:57 PM UTC-7, Shawn Neely wrote:
This is causing some consternation, because we claimed that the new DeepToImage is legacy-compatible with the original Foundry version, but some existing Nuke scripts are now generating black outputs.

Well there's your problem, you said 'is' instead of 'should be'...!  ;)

The trip up is in DDImageAdapter.cpp line 274 where deep samples are copied into the Dcx::DeepPixel - any samples with Zf==inf are skipped:
        // Skip samples with negative, infinite or nan Zfront:
        if (Zf < 0.0f || isinf(Zf) || isnan(Zf))
            continue;

I can't remember the particular reason for the isinf() test except that I was probably trying to filter out spurious Z values.
I think it's safe to remove that test and leave in the isnan() as I've definitely seen problems with nan Z's:
        // Skip samples with negative, infinite or nan Zfront:
        if (Zf < 0.0f || isnan(Zf))
            continue;

However there's also an isinf() test in DcxDeepPixel.cpp line 1262 that will likely trip up the overlap flattener into skipping Zf==Zb==inf samples:
        if (!isinf(segment.Zf) || !isinf(segment.Zb))
        {
That will likely need to be turned off entirely if Zf==Zb==inf is considered legal:
        if (1)
        {

There's also two more isinf() tests in DcxDeepTransform.cpp line 341 and 450 that may need to be removed if you're using the DeepTransform Nuke node. They may mess up the filtering by skipping samples.

And there's a final one in DcxDeepImageTile.cpp line 236 that's the same as the DDImageAdapter.cpp test - remove just the isinf(Zf) and leave the isnan(Zf).


Hopefully that does the trick, I can't think of anything specific that's relying on Zf being < inf.


-jonathan

Jonathan Egstad

unread,
Apr 17, 2017, 12:21:39 PM4/17/17
to OpenDCX Forum
I verified this morning that making those changes does fix the problem.
The changes to DDImageAdapter fixes DeepToImage and the changes to DcxDeepPixel and DcxDeepTransform fix the DeepTransform node.

I'll update github with a new rev with these fixes and a few other minor changes to DcxDeepTransform.

Cheers,
-jonathan

Shawn Neely

unread,
Apr 17, 2017, 12:57:12 PM4/17/17
to OpenDCX Forum
Sweet, thanks!  :)

Shawn Neely

unread,
May 9, 2017, 6:33:59 PM5/9/17
to OpenDCX Forum
Do you have an ETA on the next github update?

John Worphin

unread,
May 9, 2017, 6:59:59 PM5/9/17
to Shawn Neely, OpenDCX Forum
Thanks for the reminder Shawn, I've been sidetracked on other things recently.
I can get it pushed out in the next day or so.


--
You received this message because you are subscribed to the Google Groups "OpenDCX Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opendcx-forum+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/opendcx-forum/1c3364e0-f762-48ca-8222-60e3b03492c2%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Jonathan Egstad

unread,
May 10, 2017, 5:02:07 PM5/10/17
to OpenDCX Forum, max...@gmail.com
Hi Shawn,

Github repo is updated on both the master & v2.2.2 branch.
Let me know if there's any problems!

Cheers,
-jonathan


On Tuesday, May 9, 2017 at 3:59:59 PM UTC-7, Jonathan Egstad wrote:
Thanks for the reminder Shawn, I've been sidetracked on other things recently.
I can get it pushed out in the next day or so.

Shawn Neely

unread,
May 10, 2017, 5:15:13 PM5/10/17
to OpenDCX Forum, max...@gmail.com
Yay, thanks!  We'll update our builds and let you know if there's anything unexpected.

shawn.
Reply all
Reply to author
Forward
0 new messages