Oct 292011

For those of you who like to use a linear workflow in Maya, you might notice that once you apply a lens shader (mental ray) or an overall gamma setting (vray) to your scene with gamma 2.2, while your gamma-corrected textures might look great, your image planes will be washed out. This is a pain when you’re trying to use a plate as a reference for lighting your scenes. There is a way to gamma correct image planes, but the setup takes a few more steps and it’s somewhat counter-intuitive. Thanks, Maya!

The first thing to do once you attach an image plane to the camera is to switch the “Type” attribute from “image” to “texture.” Once you do this, you can attach a regular File node to the texture, and set up your image sequence attributes on the file node if you are using a sequence.

The next step is to connect the file node to a gammaCorrect node… create a gammaCorrect node, set the gamma in all three channels to 0.454 (or whatever the inverse of your current gamma is if you’re not correcting to 2.2) and then connect the outColor of the file node to the “value” of the gammaCorrect node.

The last step is the tricky part. Try connecting the output of the gammaCorrect node to the imagePlane node… where does it go in the Connection Editor? Maya decided that you, the user, should be sheltered from this most dangerous input, and it’s been hidden by default. Turn on “show hidden” on the right side of the Connection Editor, and then connect the outValue of the gammaCorrect node to the “texture” input of the imagePlane.

I don’t really understand why this has to be so difficult in Maya, but the same could be said about a lot of this program.

Oct 262011

A lot of After Effects compositors like to use a plugin to allow texture substitution on objects, called Re:Map. You render out a special color pass from your 3D scene, and then the plugin uses those colors to wrap a flat image onto the object, basically allowing you to re-texture in post.

A lot of people in the past have asked me or others to find the material you’re supposed to use to render this pass from Maya. There are different ways to make it, but by far the easiest is to just use a place2dTexture node and a surface shader (or a VrayLightMtl, if that’s your thing).

Connect the place2dTexture.outU –> surfaceShader.outColorR. Then connect place2dTexture.outV –> surfaceShader.outColorG.

That’s it. Apply the material to everything and you’re done. In VRay, you don’t even need a material if you want to save a render layer; just create a VrayExtraTex element on your render layer and connect the place2dTexture outputs to the ExtraTex element in the same manner.

The setup is really easy but there are a few things to watch out for. First of all, if your UV’s are distorted, then any texture you place on it is going to be distorted. So you need good UV’s. If you’re using simple rectangular billboards, make sure the UV’s are normalized (you can normalize UV’s in the UV Texture Editor). Also, the image quality will suffer if you aren’t rendering to a floating point file format– 32-bit floating point images are best to avoid artifacting.

One other subtle thing to watch out for. If you are using a linear workflow when you render (and you should be!) it’s easy to screw up this render and end up with weirdly warped images. This render should NOT be gamma-corrected in any way, so disable your lens shaders if you’re in mental ray, and set your gamma to 1.0 and turn off “linear workflow” if you’re in VRay. It’s hard to see, but take a look at the difference between a linear render of this pass and an sRGB (gamma 2.2) render:

The image on the left is the correct one. Using a color-corrected UV pass will cause your substituted textures in After Effects to appear very warped around certain edges.

(I’ve made this mistake way too many times.)

Oct 112011

I recently took a staff position at the up-and-coming Gentleman Scholar Studios in Santa Monica. I’ll be their “Technical Director,” which more or less means I’ll be doing more of the same old scripting, lighting and materials. Which is totally fine with me… these guys are gonna be big.

Also on a positive note… the Maya pipeline system I’ve developed here at Scholar, “Mustache,” is now fully production-ready, and being used for several simultaneous 3D spots right now! It’s taken a long time to work out the bugs, and there’s still plenty more, but it’s made jobs that would have previously been impossible to manage a comparatively painless procedure. I’ll be posting more later about the more unique features of Mustache and why nobody here wants to work without it anymore.