Compositing refraction: a Maya shader and a Nuke gizmo
A while ago, I stubled on a small problem. I had a transparent object in Maya, but not a good backgroundplate yet. I always get kinda itchy when I bake in the backgroundplate in the Mayarender anyway, so I tried to create fake refraction in comp. This is not impossible, but also not as easy as I’d like it to be, thus I decided to write these little tools.
The Maya part is a short MEL script that creates the refraction UVs. Ordinary normalpasses don’t come in like I want them, so it’s a custom network from a samplerInfo with remapped values. The script doesn’t check for existing nodes, it doesn’t hook it up to your objects; It just creates the shadingnetwork laid out in the image below. Nothing fancy.
The Nuke part is a gizmo with a simple interface of sliders. It take a background plate, and the RefractionUVs from the Maya MEL script, and creates this glass refraction. It has several options to be as flexibel as possible, so you can create the glass look you’re looking for.
So, download the tools, and do with them what you want. I’ve used them multiple times already. Get the tools for free here. Installation instructions are included.
Thanks to Luis Montemayor for explaining the technique these tools were based on.