Wednesday, October 29, 2014

Setting up Render Layers in Maya

There is no exact formula for exactly what render layers you'll need, as this can change on a shot by shot basis. Consider this guide less of a formula and more suggestive of how to easily set up simple versions of some of the most widely used render layers for compositing.

Render layers are of supreme importance as they give the artist the power to fine-tune the image in every conceivable way post-render. Rendering separate passes as image sequences allows for the re-rendering of specific portions if an error or visual glitch occurs rather than a brute force re-render of the entire sequence.

OK. So you've got your scene set up, fully animated, shaders and textures in place, carefully lit, cameras in place etc etc...what next?


In our Channel Box / Layer Editor on the right side of the screen, under the Render tab, we've only got one render layer. This layer should be called masterLayer and includes everything in the scene. This is the layer we've been rendering when we shoot out a test render. Since tweaking EVERYTHING involved in even a simple scene still won't result in a perfect render, it seems prudent to split the elements we'll need into separate layers which we'll later combine in a compositing package such as Nuke or (if you must) After Effects.


We'll start with an Occlusion layer, creating a self created shadow based on proximity rather than light. To create a new render layer simple click the Create new empty layer button, do NOT use the button to the right of it...it's glitchy beyond belief.






Name your new render layer accordingly by double clicking on the text. Notice how when we have our new layer selected, nothing shows up in the viewport.


Select the masterLayer and, in the outliner, select all your geometry. We ONLY want geo in our occlusion layer, no lights at all. Once you've got all your geometry selected, right click on your occludeLayer and click on Add Selected Objects.


Right click once again on your occlusionLayer and click on Attributes. Oddly enough I often encounter strange glitches with this function and sometimes have to click the Attributes button several times before the Attributes for that given render layer actually pop up. Mileage may vary.



On the appropriate tab for your Render Layer in the Attribute Editor, hit the Presets button and select Occlusion.


You'll see a new, specialized surface shader pop up and all your geo will turn black.


Upon rendering, you'll get a result similar to this. This is far too dark, we'll have to adjust this new surface shader as we should be seeing darkness only occupying areas of extreme fold rather than spanning entire surfaces.


With the new surface shader selected, in the Attribute Editor, click on the tab for mib_amb_occlusion1.
Setting the Max Distance to 1 usually fixes this gradient problem for me, but feel free to play with the parameters. This looks much better now, on to the next render layer!


Using the same steps as before, create a new render layer, rename, and assign only the geometry to it. We're going to make a Diffuse layer. The Diffuse preset isn't terribly helpful here, so we're going to need to dive into our Hypershade and manually adjust each shader to give us the flat color we're looking for.


Select a shader and, in the Attribute Editor, set a Layer Override for the attribute Ambient Color by right clicking on that attribute's text and selecting the appropriate option.


The text will light up orange, meaning that anything you do to this specific attribute will ONLY change it for this render layer, if you switch to another render layer this attribute will snap back to the way it was before.
Crank the Ambient Color up to pure white. Repeat this process on every single shader in the scene, obviously do NOT do this for your occlusion surface shader or maya's default shaders.


Now, upon rendering, we should be seeing only the color information with nothing extra.


In my scene I have two different light sources, so I'll want to make a render layer for each one. I'll add the geometry as usual to each layer, but this time I'll include the relevant light in the render layer as well.






Just as in the Diffuse layer, we'll need to be making overrides for each shader in these new layers. The first order of business is to place a layer override on the Color attribute. Next change the color to pure white, this may not be possible if you have a texture plugged into this attribute. To get around this simply right click on Color and select Break Connection. Since we just put a layer override on this attribute, it won't affect the texture on other layers, just this one. Then you should be able to change the color to pure white.



Once every shader has been altered in this fashion, you should have a pass that contains mostly just light and shadow information. I only plan to use the shadows coming from my blue light source, so I've turned off shadows on my orange light. Here's my blue light and shadow pass.


Here is my orange light pass, notice the lack of shadows in this pass. Never render something you don't need.


I've only covered the most basic of passes here but if you need additional passes, there are many tutorials in existence that should help you if I am not present to assist (note for random internet visitors, this was directed at the class I'm teaching...sorry I can't personally guide you through other layers random internet friends).

Other passes include but are not limited to:
Specular Pass (I've got mine piped into my light/shadow passes here, but separating them gives even more control).
Matte Pass or Object Buffer Pass(using flat, primary colors to allow you to select a specific section of screen in order to modify said section in isolation).
Depth Pass or Luminance Pass(for adding depth of field blur and other effects).

Once I've had a chance to composite my passes, you'll see a noticable difference in quality from the original beautyLayer render. For comparison's sake, here is the beauty render:


...and here is the final comp of all four of our layers. The additional control of using various layers rather than the default beauty layer allows the artist to produce a much more interesting and refined image. Given critique from an art director, we wouldn't need to necessarily rerender anything, we could go back into the comp and tweak the settings on each layer.


Sunday, October 26, 2014

Animating in Maya: A Beginner's Guide

Once you have a model and a nice rig to go along with it, it's time to dive into animating in Maya! The first order of business is to make sure, especially when animating and timing a character's movements, that what we're getting out of our viewport in terms of motion playback is in real time.

Window < Settings/Preferences < Preferences

Under the Categories section and the subheading of Settings, select the Time Slider option.
Change the Playback speed in the dropdown to Real-time [24 fps].
This may not show you every single frame (especially on older, slower computers) but it will force Maya to not take memory into account and to adhere to a strict 24 frames per second playback speed. On older machines with limited memory, this may result in Maya dropping frames in order to stick to the 24 frames per second format.

There are positives and negatives here, the main draw for an animator being that they will know exactly how to time their poses as the frame rate is guaranteed.

Now down to the basics of animating.
We are not going to animate joints or geometry, instead we'll animated the controls our riggers have built for us. For this example I've selected Lilith's wrist control.

Using basic transform tools on the various rig controls, we can pose our characters exactly how we need to. In order to lock this pose to our current frame on the timeline, we need to Key this information. There are several ways we can go about this, on the Channel Box we can shift select only the attributes we want to key (for example, I want to only key the translate information).

With only the attributes we need selected, we can right click and hit Key Selected.

The attributes with keyframes attached will light up pink.

If we don't particularly care which attributes are keyed or not, we can simply select the rig control in question and hit the "s" button on your keyboard. This will key all the attributes at this point in the timeline with no discretion.

On the timeline, all the keyed positions will show up as a red line for each pose/key.

To navigate between set keys or to jump to the nearest key use the Step back/forward one key button.

To select a range of keys on the timeline hold down alt and shift. With these two buttons held, middle mouse button click and drag over the range of keys you wish to alter.

To expand or contract and set of selected keys use the outermost yellow arrows to scale the set of keys in time. This is a useful tool to help you retime established poses.

The innermost yellow arrows in the selection will allow you to drag the selected keys in time without scaling them.

To smooth out and tweak our animation, we'll need to use the Graph Editor.
Window < Animation Editors < Graph Editor

On the left we'll see whatever we have selected, on the right is our animation curves. The black dots are keys and the line going through them shows, for that attribute (for example transformX), the curve of resulting motion.

Selecting a single attribute and hitting the "f" key on your keyboard will frame up that single animation curve.

You can left click and drag across any keys you wish to adjust, this is the curve set to Auto tangents.


Linear tangents.

Step (or pose-to-pose) tangents.

In order to forever loop a set of keys (for example, perhaps we're making a walk cycle), click View < Infinity and check the box.

We'll see the first and last key stretch on into infinity.

To give this infinite curve our same animation over and over, go to Curves < Pre/Post Infinity < and set them to Cycle with Offset.
Now we'll see our same motion repeat itself with no snapback from the crossover from last to first key.

If you are running a slow machine or need a test for dailies, we'll have to render out a quick Playblast. A Playblast is a quick render of exactly what you see in the viewport, no more no less.
First select the view you wish to render.

Next go to Window < Playblast< Option Box

Set your options to reflect your desired render and define the path, then hit Playblast.

There you go, with these basic tools you should be able to accomplish the majority of your animating needs! I hope this quick guide was helpful!

Sunday, October 19, 2014

Free Assets for Artists

This is less of a tutorial and more of a compilation of useful links.
When working on a limited budget, it can be hard to find high quality, useful assets to use in your artwork.
Hopefully this list will make that search less painful for you.

Here is how I'm going to break everything down:
Site Name (link)
Permissions
Usefulness 

Images
Public-Domain-Photos
Free for Personal and Commercial use.
Large selection of high quality images.

CC Search
You can choose what sort of license you are looking for.
Allows you to search using many different pools of photos (for example flickr, google images, etc etc) for anything relating to your keywords and chosen license. Super helpful.

Fonts
Open Font Library
Unlimited use.
Limited selection.

Lost Type Co-op
Pay what you want for Personal use, Production use costs range.
Some truly great designs, but the lack of royalty-free fonts brings this one down.

Font Yukle
No Restrictions.
Great Selection!

Music
PD Info 
More of an information site on what songs are in public domain at the moment. 

MusOpen
No Copyright Restrictions.
Almost exclusively classical music.

Public Domain 4U
Free for Educational Use only.
Hits through history and forgotten classics.

Partners in Rhyme
Free to use but individual loops/tracks cannot be re-posted online for download or mixed into music.
Limited selection. 

ccMixter
Creative Commons
Large selection of music and loops that are community generated.

Free Soundtrack Music
Royalty Free with Attribution.
Large selection in a variety of styles, all oriented around the idea of fitting into a film soundtrack.

 Moby Gratis
Free license for filmmakers.
The musician Moby is offering a large selection of his music for free to filmmakers provided you fill out a form first that tells him exactly what your plans are for it.

Incompetech
Royalty free with attribution.
Hundreds of songs that vary in quality. Some are great, others are pretty rough.

Free Sound
A collection of free sound effects that range from Creative Commons to Royalty Free.
As it is community-driven, the site is always expanding.

Sound Bible
Ranging from Creative Commons, Royalty Free, and Public Domain.
Sound effects.

Stock Footage
Footage Island
Royalty Free stock footage.
A wide selection of varying quality with no real way to search through by keyword.

Stock Footage for Free
Royalty Free stock footage.
Tries to trick you into buying footage by making the first few search results links to a paid-footage site. Limited library.

Videvo
Royalty Free stock footage.
In order to download you have to share the video on social media, it's really annoying.

X Stock Video
Royalty Free stock footage.
Most of the footage must be paid for, but there is a small selection that is free.

Videezy
Creative Commons and Public Domain stock footage.
Expanding community of varying quality.

The Film Archives
Royalty Free collection of grain, flares, and light leaks.

The Open Video Project
Varies according to the clip.
A massive collection, from documentaries to government propaganda video.

HDRI Panoramics and Textures
Open Footage
Creative Commons
A great selection of panoramic photos

 
 

Friday, October 17, 2014

UV Basics in Maya for Beginners

After working out your models,

setting up your shaders,

and correctly assigning them, you may be shocked to discover that the textures just aren't lining up how they should be. Our label on the soup can is super zoomed in and stretched. The countertop has stretching at the ends as well. This is because the UVs of these objects are messed up. Imagine if you could take the polygons of a piece of geometry and roll them out flat (like papercraft before you build it). This grid the object would make is the UV grid. Now imagine this flattened object, this UV grid, is laid out over a picture...your texture. It might not line up very well. Working with UVs is all about getting the grid to a shape and position that allows your texture to match up how you want it to.


I'll start with my can of soup. With the geometry selected I'll go to Edit UVs > UV Texture Editor

 Now we see exactly what's wrong here. The majority of the geometry is bunched up over the medallion in our label texture, which is why a stretched version of it is all we see in our viewport.

We COULD rework the UV point by point, and in some cases this may be necessary, but fortunately Maya has some nice presets for basic shapes. With our can selected go to Create UVs > Cylindrical Mapping

As you can see this will pop up some handles both in the viewport and in our UV Texture Editor window that we can manipulate to better wrap the texture around the cylinder. Now that the UV grid is dispersed evenly across the texture, we're getting much better results in the viewport.

 Next up is our countertop.

With the counter selected, I'm going to opt for a different approach and will use Create UVs > Automatic Mapping
 

Already we've got a cleaner result, but it appears our UV has been split into two chunks and the smaller chunk is on the wrong side. We'll click the button on the top left of the window with the blue square and motion arrow to select whole chunks of UV and translate them.

At this point you can use your regular Maya hotkeys to translate, rotate, and scale bits of the UV map.

Now we want to be able to select edges rather than vertices, to get to that point we've got to select the button on the top right of the window that looks like a blue grid with yellow corners. Now drag-select over portions of our UV to make sure it's working (the UV window can be flaky in terms of selection).

 Now that we know we CAN select specific portions, hold right click and drag to change your selection capabilities to Edge. Now we can click on specific edges on our UV.

I've only clicked edges along one side of the small chunk yet edges along the larger one are lighting up as well. This tells me that on the physical model, these two portions are sewn together. In order to avoid a nasty visual seam, I'll have to sew these together on the UV as well. To do this I'll click the button that has a green arrow pointing up and a blue arrow pointing to the side. You'll see the portions snap together. Inversely, to cut portions off of a UV map, you can do the same thing by using the button with the scissors on it. When you are editing a complicated mesh, you'll be doing a lot of cutting and merging of specific UV portions.

After getting my UV grid nicely sewn, I'll select the whole thing and go to Polygons > Normalize to best fill the space.

There we have it, no stretching!