Rendering in Layers in Maya
Application Used: Autodesk Maya
Author: Bogdan Amidzic
Rendering in Layers in Maya
Render layers is one very powerful feature of Maya. You might ask why?
Here we show you how to use it properly.
In this tutorial we will be using a finished model. You can download it here.
Imagine this -- you are doing a shot for a film, for example, a cyber cityscape. And you use many lights, glows, fog, crafts ¡ and of course, you turn on some form of GI or ambient occlusion. And when you press render it takes hours to render, but it looks really great. And then your director comes, looks at the render and says, "Wow that is really great!". You're happy cause you haven't slept for three days in order to finish it. But then he says "¡ but I don't like the color of that fog, make it a little brighter!" So you go and change it, but thing is that he has to wait hours for that new render. And you are very lucky if you have to change only that one thing. But in most cases he will ask you to change a million things. He doesn't have time for you to render frame again and again. So after some time, you will be fired!
But -- if you are smart, you will separate your scene in many layers so that when he comes and asks, "change the color of that craft there, change the color of the sky¡", you will just change one slider in the compositing program, and the result will come almost instantly. Your director will love you, and you will get few hours to sleep.
So I used Maya and Shake to build this cityscape scene. It's very simple, I didn't have time to create a complex model.
As a starting point I used this.
Created one directional light (sun), that casts depth map shadows with 2k resolution.
Also I created four directional lights from different sides to create blue illusion of sky illumination.
When rendered, the image looks like this. You can notice that those four lights make the scene look flat. Later I'll use an ambient occlusion pass to make small details more visible.
I used blinn materials for some buildings.
I assigned a texture to it. You can notice how odd it looks. We need to fix the UVs.
Select all faces.
Use cylindrical projection to project texture from cylinder around the object. Use manipulators to fit the cylinder to your object.
I also added bump using the same texture, and used that same texture for specular color.
Select all faces that look to the sky. Use planar projection to project texture to them.
I also created few more materials.
For some parts I used automatic mapping. This will try to project the texture from different angles.
You might notice that the texture looks very big. In the UV texture editor, you can select all UVs and scale them. This will repeat the texture.
Now the cityscape is starting to take shape.
For small lights, I created very simple geometry and assigned surface shaders to them. I added a bit of glow to them. You can add glow also in compositing passes.
Now Rendering Layers. Select all objects except those tiny glowing objects (grouping and selection sets will be your great ally in this step), and in the channel box check render. This will display your render layers. By default, all objects are assigned to masterLayer. Click that second button (one with tiny blue ball), this will assign objects to the new layer you created. Double click to layer and change its name to Color. All new layers will be named layer1 by default. Check 'R' in the box to the left. That means that layer is rendered. The masterLayer shouldn't have this 'R'.
With same selection (all except the tiny glows), create new layer. Hold right mouse button on layer1 (that new layer) and you will see presets submenu. Choose Ambient occlusion. This will create a shader override for all objects in that layer. Name the layer occlusion.
In hypershade, you can see that new surface shader was created. In color input it has mlb_amb_occlusion1. That is the mental ray occlusion sampler. Set samples to 32. The more samples you set, the less noise it will have and the longer time it will take to render.
If you render that layer, you can see the result. In compositing, I will multiply this layer with color to make details more visible.
Our scene still looks normal.
Select all objects in the scene, except lights and create new layer. Select all objects except the tiny glows and assign one surface shader to it. That material will be assigned to those objects only in that layer.
Set all attributes to black. When matte opacity is black (0) it will not create alpha and it'll block out all other objects and have no color.
If you render that glow layer, the colors shall be blocked in all other objects and only those tiny lights will have alpha, so it could be put over all other layers in compositing.
In options, check Render All Layers if you want to render all layers together. You can also set blending modes for each layer to get preview.
Create another layer, and assign all objects to it. Assign a surface shader to all objects.
In Out Color for surface shader, create a Ramp texture, as projection. This will create a placement node for texture.
Scale the placement node to fit all geometry in the scene.
Change colors in ramp from white to black.
When rendered, that layer looks like this. We will use it for the fog (Y depth).
The last thing you need to do is to render all layers or do a batch render of the sequence if you have it.
For compositing I will use Shake. In Shake, I created four fileIn nodes with render layers.
If you like hypershade, you will love Shake. So use Imult node to multiply color with the ambient occlusion layer. This will darken the holes and details.
Then with over node put glows on top of IMult layer.
This is a little more complicated, I used IMult to change the density of fog, with Reorder, I copied the R channel of image to Alpha channel, since Color node (plain color) is using it for a mask.
The Color node is orange, but here the thumbnail is black. Then that orange goes on top of over1 node.
Here I added blurred glows as the height drops. Those glows on the streets are blurred.
Now if you want to change the color of the fog, just change the color of color1 node. You can tweak everything instantly.
You can do all that in Photoshop, but you can do that only on single images. Shake is much better for these kinds of jobs, and for a Maya user, it takes only a few hours to get into Shake.
That will be all for now.
Download Scene File Here