Wednesday, October 7, 2009

Session 7: Image-Based Lighting

• Image Based Lighting
• HDR
• Exercise: IBL and HDR



 
Image Based Lighting (IBL)

IBL is the process of using an image or sequence of images to define the lighting in a scene. The color values in the image are used in one of the following ways:
  • as directional lights
  • as irradiance values for final gather
  • as photon emitters for global illumination

Render Settings > mental ray tab > Environment section > Image Based Lighting Button

-provides a spherical container that is used as a hemispherical bounding environment – appears in your scene as an IBL node. The IBL node can be mapped with an image that is used for casting light and color values into the scene (or just for reflection).

In Infinite mode, the position and scale of the spherical object is irrelevant (but rotation is used to orient the image). In finite mode (Infinite checked off) all transformations have effect; you can scale and position the IBL node in a closed environment such as a room.

High Dynamic Range Images (HDRI)

Can be used as the basis for illumination in a scene. An HDRI has an extra floating point value that is used to describe the exponent or persistence of light at any given pixel. This overall illumination information is used in the Final Gather process. Regular images have limitations when it comes to describing the range of colors necessary to describe light values precisely.

Creating your own HDRI involves taking several shots of the same subject matter with bracketed f stops and assembling the images into a floating point tiff or hdr. Photoshop CS4 or HDR Shop can be used for this purpose.

For more information, see
www.debevec.org
or
www.hdrshop.com



Exercise 1: Using an HDR Image as Final Gather Irradiance
13-HDRI_01.ma
  • Open 13-HDRI_01.ma
  • In the Hypershade, select the dome shader.
  • Map a file texture to the dome's Ambient Color.
  • Browse for the nappaValley.tif file in the sourceimages directory (don't worry about Maya's error message – mental ray can read it).
  • In Render Settings, set Final Gather to On.
  • Make sure the number of Final Gather Rays (Accuracy) is set to 100.
  • Render the scene.
  • To adjust the irradiance contribution, go to the Color Balance section of the file texture node.



Exercise 2: Creating an infinite Environment with an IBL node
13-IBL_01.ma
  • Open 13-IBL_01.ma
  • Open the mental ray Render Settings.
  • Indirect Lighting Tab: Environment > Image Based Lighting: click Create. In the Attribute editor for the mentalrayIblShape1 node, under Image Based Lighting Attributes, map nappaValley.tif to Image Name.
  • Render.
  • Experiment with Color Gain and Color Offset.
  • For shadows, you need turn on Emit Light under Light Emission.
  • Set both Quality U and Quality V to 64.
  • Set the Samples parameters to 10 and 4.
  • Render.
Note: Every pixel in the texture is a virtual directional light. The Quality U,V sets the resolution for the control texture. Samples controls the sampling of the strongest lights (first parameter) and the remaining lights (second parameter).





Exercise 3: Physical Sun and Sky
scene_04.mb and simpleSky.mb

  • Open scene_04
  • Render Settings: Indirect Lighting tab, Environment section, hit Create next to Physical Sun and Sky
  • Render
  • Start with a Multiplier of .3 and experiment with the sky and sun attributes


See simpleSky.mb for examples of sky with various mental ray shaders. Be sure to turn on Final Gather.


Exercise 4: Going Deeper into HDRI, with Final Gather and Photon Emission
IBL_Light01

● Open IBL_Light01

● Create an IBL node

● In the Attribute Editor, change Type to Texture and change the texture to white.

● Render



● Enable Final Gathering with Point Interpolation of 20

● Render

● To increase intensity, use Color Gain in the IBL node: increase V to 2

● Render



● From the Type attribute, select Image File. Load the image lat_long_ldr.tiff.

● Reset Color Gain to 1 and Render.



● Replace the image with an HDR version: lat_long.hdr

● Adjust Color Gain and Render



● Replace the file with ANGULAR.hdr and change mapping to Angular



● Disable Final Gather

● Turn on Light Emission and Render

● Chance the image to Spherical, lat_long.hdr and re-render to see the difference



Also in your project is the file apartment05preIBL.ma. This is for you to look at and play around with getting the CG elements to match the background image.
Directions are here. This file has everything done except tweaking the shaders. Make sure the IBL node is turned on and Final Gather is used.

No comments:

Post a Comment