Advanced Lighting Exercise


This exercise covers a number of lighting techniques you may find useful.




Changing the Light's Color Map

The color of a light is able to be mapped like almost every other attribute in Maya. One does not typically expect a light to emit more than one color, but this can be useful for creating gradations. You can also use it to simulate effects such as caustics (shown below) or stained glass windows.

Changing the color map in lights:

Stained Glass Example:






Shadow Lights

There are times when you need finer control of shadows.


Gobo Light by changing object's shader transparency:

There are various techniques for blocking light. The most basic of these is called a gobo. A gobo is simply something you put in front of a light to prevent it from reaching certain areas. You can make a gobo out of geometry so that you can precisely control its shape. Assign a new Lambert shader to it and set the Transparency to white. This will make the gobo invisible, but it will still cast shadows.



Gobo light by changing the color map:

Another way to create a gobo light is by changing the color of the light to a black and white image of the shadow you want to cast. Simply click on the map button for the light's color settings, select file and choose your black and white image file.



Gobo Light changing render stats:

The last option is to change the renderstat of the object that will cast a shadow, so that it's visibility doesn't render in the final image. To do this, select the object you want to cast a shadow and in the attribute editor under the object's shape tab, uncheck "Primary Visibility" from renderstats.








Barndoors

If you only need to limit the edges of your light, then using the Barn Doors of a Spotlight will be sufficient. The settings for Barn Doors can be found under Light Effects. The image on the right was created by narrowing the left and right barn doors of the Spotlight.



You can change the softness of the edges for barndoors by adjusting the light's penumbra and droppoff settings.






Volume Primitive Fog


Another way to create fog besides changing a light into a fog light, is to make volume primitives. When you create a volume primitive, it creates fog by default. Go to Create> Volume Primitives > Cube. If you were to render the cube you just made, it should look like it's filled with fog. If there's an object in the fog, its shadow probably isn't interacting with the fog. By checking the "Illuminated" box in the cubefog attributes, this will turn on the shadow attributes in the fog.

If the fog is a bit grainy or there's a lot of weird lines, then you just need to bump up the volume samples for the fog. Just be careful on the volume sample amount, because it will slow down render time. Under render setting > features, you'll find volume samples.

In the color settings for the fog, you can try messing around with different types of shader nodes such as "noise" or "cloud" to add texture. You can also apply ramp shaders to add an interesting effect. Play around with other attributes for the fog and see what happens. You can also key attributes to make the fog change over time.








Occlusion Layer


Occlusion is another type of shadow that occurs in the real world, but cannot be generated when reading out a scene with lights in Maya. Instead, a shader with occlusion attributes is applied to all objects in a scene and rendered out. All the objects are white when rendered out with soft occlusion shadows on them. It doesn't take too long to set up.


  1. Save your project before starting.
  2. Since we're applying an occlusion shader to the entire scene in a new layer, select all mesh assets and all mesh parts of the set. When creating an occlusion layer, you never want anims or other materials in the layer, or else they will have occlusion shadows as well. So be careful and only select mesh. Then in the layer box, click on the icon that looks like a sun with a blue sphere and white plane, and all the mesh you selected will be placed in a new layer.
  3. Name that layer, "occlusion_layer".
  4. Right-click on the layer and click on attributes.
  5. Click on Presets, and then click on Occlusion in the list of layer options.
  6. Rename the "surfaceShader#" to "occlusion_shader". If you look in the hypershade, you'll notice a shader node called occlusion_shader. If you didn't change the name, it will be surfaceshader#.
  7. The Out Color attribute is where you can control the occlusion shader attributes. Click on the black arrow on the right side of out color.
  8. Sample is the quality of the shadows. Higher the number, the less grainy the shadows will be and the longer it will take to render. Lower the number, less grainy the shadows will be. I like to start at 250 and work my way up. If you play around with the value, you'll notice the quality change and render time changes.
  9. There are two values to occlusion. By default it's white as bright (for the non-shadows parts of the objects) and black for the dark (the color of the occlusion shadow). Sometimes it's best not having pure black shadows, because it makes the image look muddy in colors when black mixes with other colors. Keep bright at white and dark at black.
  10. Spread is the amount of occlusion spread you want on the objects. The best value for this depends on your set size and the distance between the camera and the objects with occlusion shader. Play around and see what value looks best. I think 1.2 is fine.
  11. The max distance is how far rays will travel to find objects. The farther rays travel, the wider and shadow will be. If you decrease the distance of the rays, they create tighter shadows that appear when other geometry is very close to the surface.
  12. Render out an image when you're done and save it to composite with a beauty render of the room.
  13. Open up the beauty render and occlusion layer in Photoshop.
  14. Paste the occlusion layer into the beauty layer scene. When you do this, it will place the occlusion layer automatically in it's own layer. You can see the layers on the right hand side in the layers box.
  15. In the layers box on the top, there is a drop down menu. With the occlusion layer selected, scroll down in the menu layer and select "Multiply". This will make the white disappear from the occlusion layer and all you'll see are the shadows.
  16. Now change the opacity until you get a look you like. I think anywhere between 20%-30% is good.
  17. Save a copy of your composition.
  18. Back to Exercises