TUTORIAL 7: Global Illumination & Ambient Occlusion

Similar documents
Chapter 11. Caustics and Global Illumination

Ambient Occlusion Pass

Mia Round Corners Node

Shadows. COMP 575/770 Spring 2013

: CASE STUDY: USING MAYA AND MENTAL RAY FOR PHOTOREALISTIC INTERIOR LIGHTING

TSBK03 Screen-Space Ambient Occlusion

Caustics - Mental Ray

Chapter 4- Blender Render Engines

O Hailey: Chapter 3 Bonus Materials

Oso Toon Shader. Step 1: Flat Color

LEVEL 1 ANIMATION ACADEMY2010

Deferred Rendering Due: Wednesday November 15 at 10pm

ART 268 3D Computer Graphics Texture Mapping and Rendering. Texture Mapping

MAYA; AN INTRODUCTION TO MAYA; EndOfLine.info;

Turn your movie file into the homework folder on the server called Lights, Camera, Action.

Cast Shadows Maya 2013

Lets assume each object has a defined colour. Hence our illumination model is looks unrealistic.

Point based global illumination is now a standard tool for film quality renderers. Since it started out as a real time technique it is only natural

THEA RENDER ADAPTIVE BSD ENGINE

There are many kinds of surface shaders, from those that affect basic surface color, to ones that apply bitmap textures and displacement.

REU Modeling Course Day 1 pt2 AutoDesk Maya - More Modeling

Lesson 11. Polygonal Spaceship

Advanced Maya Texturing and Lighting

Intro to Lights & Rendering Maya 2013

Think about film & lighting

Submerge Camera Shader

AECOsim Building Designer Quick Start Guide

MR Shaders Dielectric Materials Rendering Glass and Simple Caustics

STARTING COMPOSITING PROJECT

3D Space is one of the most rewarding areas

Ok, so to get started we will take a look at the settings in the Render setup. If we were to take a render right now this is what we would see...

OpenGl Pipeline. triangles, lines, points, images. Per-vertex ops. Primitive assembly. Texturing. Rasterization. Per-fragment ops.

Interior space in daylight Elsevier Inc. All rights reserved.

Character Modeling IAT 343 Lab 6. Lanz Singbeil

Autodesk Fusion 360: Render. Overview

Shadows in the graphics pipeline

Table of Contents. Part I Introduction 3. Part II Tutorial: Getting Started 3. Part III Models 19. Part IV IPR Parameter Picking 20.

Advanced Maya e Texturing. and Lighting. Second Edition WILEY PUBLISHING, INC.

Max scene used to generate the image from the second pdf in this tutorial.

Chapter 6- Lighting and Cameras

Rock Tutorial: Creating A Rock Like Seen In Gears Of War With A Focus On Normal

critical theory Computer Science

Shadow Techniques. Sim Dietrich NVIDIA Corporation

CMSC427 Advanced shading getting global illumination by local methods. Credit: slides Prof. Zwicker

Chapter 17: The Truth about Normals

Advanced Distant Light for DAZ Studio

CGDD 4113 Final Review. Chapter 7: Maya Shading and Texturing

LIGHTING - 1. Note. Lights. Ambient occlusion

Glass Gambit: Chess set and shader presets for DAZ Studio

Lighting & 3D Graphics. Images from 3D Creative Magazine

Text Page 1 Chris Shaw

diffuse diffuse reflection refraction diffuse mapping diffuse reflection reflection filter mapping mapping reflection

Flames in Particle Flow

Lighting. To do. Course Outline. This Lecture. Continue to work on ray programming assignment Start thinking about final project

BCC Rays Ripply Filter

Today. Global illumination. Shading. Interactive applications. Rendering pipeline. Computergrafik. Shading Introduction Local shading models

CGS 3220 Lecture 4 Shaders, Textures, and Light

Introduction to Digital Modelling and Animation in Design week 4 Textures

CGS 3220 Lecture 13 Polygonal Character Modeling

Soft shadows. Steve Marschner Cornell University CS 569 Spring 2008, 21 February

Topics and things to know about them:

AR-media TUTORIALS IMPROVING REALISM AMBIENT OCCLUSION. (June, 2011)

Learning Autodesk Maya The Special Effects Handbook. Free Model From Turbo Squid Value US $ Official Autodesk Training Guide

Photo-realism Fundamentals

Chapter 9- Ray-Tracing

MITOCW MIT6_172_F10_lec18_300k-mp4

Design Visualization with Autodesk Alias, Part 2

Problem Set 4 Part 1 CMSC 427 Distributed: Thursday, November 1, 2007 Due: Tuesday, November 20, 2007

The Special Effects Handbook

Screen Space Ambient Occlusion TSBK03: Advanced Game Programming

ARCHITECTURE & GAMES. A is for Architect Simple Mass Modeling FORM & SPACE. Industry Careers Framework. Applied. Getting Started.

Topic 12: Texture Mapping. Motivation Sources of texture Texture coordinates Bump mapping, mip-mapping & env mapping

Lecture 18: Primer on Ray Tracing Techniques

Topic 11: Texture Mapping 11/13/2017. Texture sources: Solid textures. Texture sources: Synthesized

BCC Rays Streaky Filter

Shadow Casting in World Builder. A step to step tutorial on how to reach decent results on the creation of shadows

Today. Global illumination. Shading. Interactive applications. Rendering pipeline. Computergrafik. Shading Introduction Local shading models

Caustics - Mental Ray

Modeling Technology Group

Topic 11: Texture Mapping 10/21/2015. Photographs. Solid textures. Procedural

Computergrafik. Matthias Zwicker. Herbst 2010

FAQ - Podium v1.4 by Jim Allen

CGS 3220 Lecture 17 Subdivision Surfaces

Advanced Rendering CHAPTER. Render Window. Learning Objectives. Image Pane

Photo Studio Optimizer

Autodesk Viz Render Illuminated Speaker; Charles Busa

CSE 167: Introduction to Computer Graphics Lecture #6: Lights. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016

Polygon Modeling Basics Chapter 1 - Vertices

audio, 57 auto-orientation, 215 automatic mapping, 243 average vertices, 239 axis, 3-6, 12, 94, 126, 149, 191, 199, 290

Draw Guide. Chapter 7 Working with 3D Objects

Table of Contents. What are Ghost Lights? What is Two-sided? What is Kcdm2?

Visualization Insider A Little Background Information

V-RAY MATERIAL SETTINGS

Ambien Occlusion. Lighting: Ambient Light Sources. Lighting: Ambient Light Sources. Summary

IBL/GI & GLASS. Getting Realistic Results By Yon Resch. The Three Types of GI lighting and Glass

Lesson 03: We will add water and will set the placing conditions for the material. WorldBuilder 3.5. for. About Digital Element Tutorials:

2. Drag and drop the cloud image onto your desktop to be used later in the tutorial.

INFOGR Computer Graphics. J. Bikker - April-July Lecture 10: Ground Truth. Welcome!

3 Polygonal Modeling. Getting Started with Maya 103

Chapter 12- NURBS & Meta Shape Basics

Transcription:

TUTORIAL 7: Global Illumination & Ambient Occlusion The goal of this short tutorial is to introduce a few select aspects of mental ray so that you may consider incorporating them in your projects if appropriate. These include global illumination and ambient occlusion. We ll focus on the key attributes that are useful in optimizing each, and use different scenes to simplify and facilitate the demonstration of each effect. We ll also explore another feature of mental ray the approximation editor that is unrelated to lighting. Global Illumination Global illumination ( GI ) is a method of indirect lighting photons are emitted from one or several light sources and are bounced around your scene. As they hit surfaces with a diffuse light component to their shader, they bounce off that surface and in the process accumulate color as well (i.e. color bleeding ). Objects that bounce photons become secondary light sources in themselves. The following simple example shows you how to enable GI in a Maya scene and, in particular, how to optimize GI settings to achieve a smooth lighting result. Geometry set-up To demonstrate the GI effect, we ll model a simple forked tube that has a spotlight inside one of its side branches. The main trunk of the tube will have no lights and will therefore only be lit from the spotlight emanating from this side tube. Without GI, the spotlight will cast a single area of light inside the tube with GI enabled, however, photons emitted from the spotlight will hit the wall of the tube and then continue to bounce thereby extending the area of illumination inside the tube. This basic set-up will help to exaggerate GI s contribution to lighting in a scene (an effect that can otherwise be very subtle). We ll begin by modeling the forked tube using polygons and explore how mental ray s approximation editor can take care of smoothing the surface at render without the need to convert to subdivision surfaces. 1. Create a polygon cube at the origin and set the scale x y z to 6 6 & 60 respectively. Set the subdivisions depth to 12. Scaled cube. cube smoothened with 1 division 2. Smooth the cube once (i.e. 1 subdivision only using the default settings). 3. Select a few faces (see image on the right) such that you have 2 that are on the same side and 1 face apart and offset by 1 row (the idea is to select faces that are not too far apart or the selected faces on one side (one more selected on other side) 1

indirect lighting will not reach far enough to light the extrusions/forks you will create from these faces). 4. Extrude the faces (make a small extrusion first that scales the face in and out a bit and then a second extrusion that pulls out the face quite a bit see figure on right). 5. Now create a new camera and rename RENDERCAM look through it, turn on its resolution gate (the default 640 x 480 is fine) and position it inside the main tube such that it sees the openings of the 3 extruded faces (it s already inside the main tube by default, but rotate it a bit to off-center it). extruded faces At this point if you were to fire a render, by default the Maya software renderer would launch and you would automatically get Maya s default light turned on for you to avoid returning a black render of your scene. Next we ll add a spotlight inside the top right extrusion (from the RENDERCAM s point of view in the image to the right). RENDERCAM set-up inside the tube with 3 openings visible Create the spotlight (using default settings) then move it with the transform/move manipulator (or simply look through selected and then use your camera motions to position it) so that it faces down the side tube towards the main trunk (see image on right). Approximation Editor Before we set-up GI lighting let s take quick look at mental ray s approximation editor. This allows you to override Maya s tessellation for objects with instructions derived from mental ray. The powerful thing about this method is that it all happens at render time - so there is no need to use a higher poly-count version of your model or to convert it to a subd model. scene set-up with spotlight inside the an extrusion To open the approximation editor, go to Window -> Rendering Editors -> mental ray -> Approximation Editor. The window that opens gives you a few choices depending on the type of geometry you want to add a surface approximation to. For our purposes, select your polygonal object and click on the Create button that is in the second panel labeled Subdivisions (Polygon and Subdiv. Surfaces). Nothing seems to happen other than the Create button becomes grayed out. If you look through your Approximation Editor: finding it (above) & the options window (below) Finding the Approximation Editor 2

perspective camera, frame one of the extrusions on your main tube and render it (with Maya software), you ll see the expected boxy appearance. Now switch the renderer to mental ray in the render settings, render again, and the model now appears smooth (as if it had been converted to a subd surface). If you look closely, you ll notice that there are still some visible edges that might be nice to remove. To access the settings for the surface approximation that mental ray calculates at render time, either go back to the approximation editor, select the surface and click the Edit button, or select the surface in the viewport and open the Hypergraph:Connections window and click on the mentalraysubdivapprox1 node. In both cases, this opens the settings in the Attribute Editor the key setting is the N Subdivisions value: set it to 4 to smooth out the approximation even more and rerender to make sure you are satisfied with this value (see image on the right). Now if you go back and look through the RENDERCAM and fire a render, you ll notice that the pattern of light cast by the spotlight on the inside of the main tube wall is smooth (due to mental ray s surface approximation). However, there is no secondary/indirect light in the scene, so only regions that are directly hit by the spotlight rays are lit and the rest of the geometry is dark. Approximation Editor settings are used increase smoothness The approximation node can be selected in the Hypergraph Render of the inside of the main tube without GI Increasing the N Subdivisions value yields even smoother results 3

Enabling Global Illumination Now that the geometry is set-up and you have a spotlight illuminating the inside tube, we need to start emitting photons from this light so these will bounce around inside and extend the illumination. Notice that in the current render, the other openings created by your extrusion are not visible because the rest of the scene is completely black the goal of our GI set-up will be to use indirect illumination to reveal the opening of the other extrusions you created in the main tube. There are 2 places to enable GI in a Maya scene: the light source and the render settings. With the light source settings you control the number and intensity of the GI photons emitted. In the render settings, you control the radius of the photons and the accuracy of the GI effect. Enabling GI in the mental ray section of the Light Attributes Select the spotlight and let s begin by making a few adjustments to the main Attributes before we enable GI: change the decay to quadratic (which is closest to the behavior of real physical light), set the Penumbra Angle to 10 and increase the intensity to 20. We can come back and adjust these settings after we have worked with GI. In the mental ray panel of the attribute editor, under the Caustic and Global Illumination section, click the Emit photons checkbox. Now open the render settings and, under the mental ray tab, go the Caustics and Global Illumination section and click on the Global Illumination checkbox. GI is now on try rendering the scene from your RENDERCAM. What you should see is a faint indirect lighting effect that s a bit blotchy. Optimizing Global Illumination Optimizing GI in your scene involves a lot of experimentation and tweaking on a number of parameters. The first thing to assess is the pattern of photon boucing in the scene this can be done a couple of ways. There is a utility called the Map Visualizer (at the very bottom of the Caustics and Global Illumination that, when checked, will draw dots for every photon bounce in your viewport. Turn on this option in the render settings and rerender the scene from the RENDERCAM. You should now see a spattering of dots in your viewport. Enabling GI in the Render Settings Opening mental ray s Map Visualizer 4

You can customize some of these display settings by going to Window -> Rendering Editors -> mental ray -> Map Visualizer. The window then provides you with options to control the display of the dots in the viewport as well as the direction photons are bouncing around. To enable this feature, increase the Direction scale to 0.2. You can also increase the point size to 3 to make it easier to see what is the photon and what is the direction tail. Feel free to play with the settings to see how they work return the direction scale to 0 and the point size to ~2 before proceeding with the rest of the tutorial. Another way to assess the pattern of photon bounces in your scene is to do it through the rendered image. In the render settings, under the Global Illumination Options, notice that the Radius value is set to 0. This default value lets Maya decide what to make the radius. Change the value to something small like 0.1 and rerender the scene form the RENDERCAM. You should now see the individual photons as little spots of light along the inside of the tube. Clearly this is not the value we will use for the photons in the final image in fact the radius value is one of the settings we will be using to smooth and blend together the illumination generated by the photons. But in this mode, it provides a useful sense of where the photons are landing and, most importantly, whether we have enough. Even though we are starting to the effect we are after (i.e. the other extrusion openings are becoming faintly visible), we will now increase the number of photons. Make sure to save the images you render into memory at every round of rendering to get a sense for the effect of the settings updates. Go to the attributes for the spotlight and, in the mental ray Caustics & Global Illumination section, increase the Global Illum Photons value to 100,000. Rerender the scene overall, the effect is now brighter. There is also a bit more splotchiness on the surfaces. To brighten the GI effect a bit more, increase the Photon Intensity from 8000 to 16000. Settings in the Map Visualizer Changing the default Radius value from 0 to 0.1 Now to address the splotchiness, we need to tackle the Radius value and GI Accuracy both in the Render Settings. Increase the Radius to 4 and set the Accuracy to 600. You might notice that a tiny amount of smoothing occurred on the walls lets increase the Radius to 8 and the Increasing the number of photons emitted and increasing the photon intensity brightens the GI effect. 5

Accuracy to 900 - rerender. This shows marked improvement in terms of removing some of the blotchiness. The typical workflow here is to increase the Accuracy value until you can no longer tell that it makes a difference. Practically speaking, starting with a value of 600 and increasing in increments of 300 should give you a good rule of thumb. Lets increase the accuracy to 1200 and see if it makes a difference even better. It is getting subtle, but definitely still a discernible effect. Keep going to 1500 and rerender. Still barely an effect lets now leave it at 1500. Depending on the effect you re after you could now play with Photon Intensity (back in the spotlight attributes) to brighten or lighten the indirect illumination effect. Another element we haven t played with yet is light color. You are used to changing the light color, but remember to consider your indirect light color as well this would be set using the Photon Color attribute. A common way to set this for photorealistic effects is to color pick the photon color from the light color swatch. A final attribute to touch upon the Exponent value determines the fall-off for the photon-generated indirect lighting effect. By default, this is set to 2 which corresponds to quadratic fall-off (a would be a linear fall-off). You can test setting this to 1 and you will notice how much brighter the GI effect spread into the tube (it is also overblown!). Make sure to set it back to 2 before proceeding. Finally, we can start to play with the shader on the tube wall. For tweaking purposes we stayed with a grey to accentuate the splotchy GI effects that are seen during optimization with textured surfaces, one can often get away with lower Accuracy values. Since GI photons pick-up diffuse light on objects, changing this setting on our tube shader should have the effect of brightening the scene. First, apply a new lambert to the geometry and color it light red. Take a render. Now increase the Diffuse setting from the default of 0.8 to 1.5 and rerender the scene. Not only does the whole scene appear brighter, but the indirect illumination now extends further into the body of the main tube. Optimized GI Exponent set to 1 (linear) instead of 2 (quadratic) Adding a new red Lambert with the default Diffuse (0.8) GI can be a powerful lighting approach to add soft, indirect lighting to your scenes. However make sure that it is warranted as you have no doubt noticed, GI means significant increases in render time as well as more time to optimize the effect properly. Increasing the Diffuse value to 1.5 extends the GI effect 6

Ambient Occlusion Ambient occlusion is another technique that improves realism in your renders it calculates the degree of occlusion between objects and darkens this region based on the distance between the objects. Unlike the GI process that adds light to the scene by emitting GI photons from light sources (and these photons bounce around picking up color information as they go), ambient occlusion does not take into consideration any lighting information only the proximity of objects to one another. It works by darkening these areas and thereby adds realism by removing light from the scene. There are several ways to get ambient occlusion into your renders either as part of a color pass (i.e. where the ambient occlusion shader is part of a shading network that also takes lights and color into consideration) or as a separate pass generated from a render layer preset. We will begin with the latter as it is simpler to set-up using render layer presets. Open the handheld.ma file that is provided along with this tutorial. You ll notice a device (initially modeled as a polygon and then converted to a subdivision surface) that is sitting a flat surface (the benchtop ). It is also broken into pieces to facilitate applying different shaders in this exercise (see the Outliner). Take a render from the RENDERCAM to see what the default scene looks like. To take advantage of mental ray s out-of-thebox occlusion preset, select all the objects in the scene using the Outliner and go to the render layers section of the channel box column click on the right-most icon (the one with the little blur ball sitting atop a grey layer). This will automatically create a new render layer for you and automatically add all the selected geometry to it. Notice that a default masterlayer is also created for you this contains all of the objects in your scene with their normal or existing lighting shading information. Double click on the new layer (labeled layer 1) and rename it to occlusion. To apply the ambient occlusion setting, RMB-click on the layer and select Presets - Occlusion. This turns all objects in your current viewport to black (if you click on the masterlayer, things return to normal so this is specific to the shading information on this particular layer). Render the scene. Default render of the handheld scene Creating a new render layer and applying the occlusion preset Occlusion preset applied and rendered to all objects in the scene 7

Notice the soft shadows that are generated at the base of the device where it is closest to the benchtop. Again, these are not real shadows as we think of them because they are not a result of lighting information simply proximity between geometry. Let s now take a look at how Maya applied the preset and where to find the occlusion pass settings for optimization. The easiest way to access the settings is to click on the blue sphere icon that is to the left of the render layer name. This opens the attribute editor with a surface shader node loaded into it. Notice that ambient occlusion is not a shader per se but a texture in the case of the render layer preset, the texture has been piped into the Out Color channel of a surface shader - the latter is ideal for generating a compositing pass because it returns a constant color value for the underlying geometry to which it is applied (and discards any lighting or other shading information). Indeed, the occlusion pass is typically set to the Multiply blend mode atop other layers in a composite any areas of the pass that are white (i.e. that have a value of 1) will not affect the color pixels values of the underlying passes, whereas darker areas of the occlusion pass (with values less than 1 all the way to 0) will reduce the underlying RGB pixel values and thereby blend in only the shadowed areas. To access the ambient occlusion texture from the surface shader node in the attribute editor, simply click on the upstream connections arrowhead to the left of the word Focus at the top of the attribute editor. The name of the node should now read mib_amb_occlusion. The key attribute to quickly improve the quality of your occlusion render pass is the Samples try bumping this value up from the default of 16 to 64. Now compare the new render to the previous one you should see a marked improvement in the smoothness of the handheld s surrounding shadows (they are now less blotchy ). Also noticed what happened to the render time! Another set-up that is less common for generating a separate render pass is to add the ambient occlusion effect as part of a larger shading network that also includes other types of information (such as color, lighting etc ). The same mib_amb_occlusion node is used as in the render preset but this time it is plugged into the Ambient Color channel of a typical A smoother result is generated by setting the Samples to 64. An example of a composite generated using the occlusion preset render pass mib_amb_occlusion outvalue is connected to ambient color Example of shading network where multiple shaders conveniently draw upon the same mib_amb_occlusion node 8

shader like a lambert of a blinn for example. A convenient set-up is to connect the same mib_amb_occlusion node to the Ambient Color channel of multiple shaders (this lets you adjust ambient occlusion settings for all the shaders at the same time). It would be very difficult to achieve this kind of soft surrounding shadows occlusion provides using methods that shoot photons/rays into a scene from lights or cameras because of the number of rays that would be required to enter these increasingly small spaces between objects. Instead, by generating rays from the surfaces themselves, the ambient occlusion texture is able to sample areas of close proximity. Example of a scene where multiple shaders make use of the occlusion texture driving their ambient color channels. Also note that mental ray s ambient occlusion texture can be used for creative effects. For example if you switch the dark and light color swatches in the attribute editor for this texture, the result will be to to generate light patterns in areas of object proximity one can create halo/ghost effects with this technique. Refer to Eric Keller s Abusing Ambient Occlusion: The SciFi Scanner section (p32) in his book Maya Visual Effects The innovator s Guide for a more complete description of how to set up this kind of effect. Inverting the light and dark color swatches in the ambient occlusion texture node and feeding the outvalue of the texture to the incandescence channel of a typical shader (i.e. Lambert) 9