Mocha OFX 2020 / Distort Map for Autodesk Flame

Hello there,
We’ve just installed the Mocha OFX Plugin 2020 for Autodesk Flame 2020.3 (Linux).
After a test run to create distortion maps from a lens grid, the results aren’t satisfying.
Mocha does export EXRs for distort and undistort. But when using them with the UVWarp32 node inside flame, I can’t recreate the exact same distortion from the original plate.

Are there any documentations/tutorials about the roundtrip of that for flame?

Thanks in advance.

Best,

Chris

Hi Christopher,
There is no official documentation on the lens workflow specific to Flame users. In this older webinar, Flame artist Joel Osis covered his Lens Calibration workflow: https://youtu.be/xwonwH2GDHY

If you jump to 1:02:00, you can skip to his Lens section.

If you are still having issues, it would be good to get your Mocha and Flame project so we could investigate on our end.

Thanks,
Ross

Hi Ross,
First of all: Thanks for your quick response and the link.

Unfortunately Joel doesn’t cover the Redistort-Workflow.

Attached you’ll find a wetransfer link to flame archive with a batch, showing the difference of Mocha’s ST Maps and Nuke’s ST Maps. The Nuke ones works fine.
Flame Version is 2020.3

Maybe you’ll have a solution for that.

https://we.tl/t-WSRPQNTSLN
Will be deleted within 7 days.

Thanks,
Chris

Hi Ross,

so a guy in my team just told me, that there is a bug in mocha with anamorphic footage.
Therefore I did another test with a spheric lens grid.
But still: I can’t recreate the original distortion with Mocha’s ST-Maps.

Here’s another wetransfer-link to a flame archive for the second test. This time with the mocha-plugin embedded.
https://we.tl/t-BstFbCxMEK
Flame 2020.3, Mocha 2020 OFX

Please have a look.

Thanks,
Chris

Hi Chris,
I just wanted to update that we are looking at the issue and will be sure to get back to you when there is something to report.
Thanks for sharing the footage.
-Ross

1 Like

Hi Chris,

I spent some time looking into this, and there’s no really simple way to do it at the moment. The UVWarp32 Matchbox shader can’t handle Mocha’s STMaps, because they contain coordinates outside of the image area, that is below 0.0 and above 1.0. As you’ve seen, undistorting is fine but distorting won’t work.

I was able to use Action’s UV mapping workflow instead but it requires a more complex setup. To do this, export the distortion map from Mocha at the normal footage resolution, then set up your surface in Action for UV mapping. You need to adjust the surface corners to compensate by either moving the UV positions into the correct range or pushing the vertices out to match the UV map.

In your shot, the footage was 1920x1080 and the undistorted footage was 1954x1100. The adjustment at each corner will be half the difference between those two sizes:

Assuming you move UV coordinates in:

Lower left: x+17, y+10
Upper left: x+17, y-10
Upper right: x-17, y-10
Lower right: x-17, y+10

For some reason I had to toggle between bilinear and extended bicubic surface types to see a correct result, not sure why. If you use the difference compare mode in Action you can see the grid converge, but because of the resampling, some fractional adjustments to the UV positions might give a small improvement.

It’s worth mentioning that you will not see a completely black difference key with an undistort->distort process, due to the repeated resampling. I ended up with a feint pattern of thin grid lines, and if you A/B the original with the redistorted plate, the softening is visible.

I switched to 32-bit TIFF for my tests as it is more precise than EXR. You probably wouldn’t notice the difference normally, but you can see more errors with the grid and difference matte.

As this is a bit convoluted I have written a Matchbox shader which understands Mocha’s STMaps, once that’s gone through QA internally we’ll publish it as a free download.

Best regards,

J-P

2 Likes

Hi JP,

thanks for investigating!
Looking forward to that matchbox shader :slight_smile:

Best,
Chris

Hey J-P,

any updates for the matchbox shader?
There’re some jobs on the horizon and I’d love to use Mocha’s ST-Maps :wink:

Best,
Chris

I’m trying again - because we really want to use mocha’s st-maps inside flame.
Any updated about the shader?

Thanks,
Chris

Hi Chris,

@martinb has been testing it and I think it’s looking OK. I’ll check with him today to see if it’s ready to post.

Best regards,

J-P

Sounds great!

Thanks,
Chris

Another week, another status update request.
How’s about this shader? :slight_smile:

Thanks,
Chris

I have been fighting some packaging issues - hopefully will be finished today.

1 Like

DO NOT USE - SEE POST BELOW

Here’s the shader. Please give it a try and let me know if there’s anything you think should be done differently.

MochaMatchbox-7.5.0-1137.g92c0d32103dd.zip

1 Like

Thx! But the link seems to be broken… =/

Fixed, please try it again.

Download complete! Will start testing soon and come back to you with results :slight_smile: thx!!

Our QA team spotted a problem in the version I posted. Here’s a new version which should work better:

MochaMatchbox-7.5.0-1147.g93a745711286.zip

1 Like

Hi J-P,

I hope you’re doing well!

I’ve just tested your latest shader.

Unfortunately it behaves exactly like Flame’s UVWarp32 and doesn’t recreate the original distortion.

I’ve attached a screenshot from my batch tree so you can see the problem.

Stay safe and healthy!

Chris

Hi Chris,

Thanks for letting me know. I’ll try to work out what’s gone wrong.

Best regards,

J-P