Wednesday, September 30, 2009

Session 6: Indirect Illumination




Outline

• Intro to mental ray and indirect lighting methods

• Caustics
Exercise: cognacGlass_01.ma

• Global Illumination
Exercise: global_01.ma

• Final Gathering
Exercise: finalGather_01.ma

• Homework:
FgGi_01.ma


cognacGlass_01.ma demo


A demonstration of creating caustics with mental ray






Focused specular light reflections and refractions cause caustics. In order to simulated the effects of caustics we need to tell mental ray to

a.) cast photons from our lights and

b.) enable photon mapping in the Render Settings.



Let's start with the light. In a spot light, open the mental ray tab. Look for Caustics and Global Illumination. Here, check the Emit Photons button.



In the Render Settings, choose mental ray as the render engine. Then, set the Quality Preset to Preview Caustics.



Tweak raytrace settings in the mental ray tab:

Refractions : 6

Max Trace Depth (reflections plus refractions): 8



Under Photon Tracing, Increase Max Photon Depth and Photon Refractions to 6.



Tweaks:

Turn up Caustic Radius (1.5 or 2)

Turn up Accuracy to smooth out caustics. (Changes the number of photons used to compute the local intensity of global illumination. The default number is 100; larger numbers make the global illumination smoother but increase render time.) Also change the caustic filter type to Cone for more smoothness.

Finally, in the light's Caustic section, turn up Caustic Photons (20,000)



Also Try:

Turn ON Direct Illumination Shadow Effects (This should be turned ON if you use transparent shadows with Global illumination and/or caustics.)

Turn up Raytracing > Shadows in the mental ray render settings.

Under Caustics and Global Illumination, turn on Enable Map Visualizer to see photons in scene after render.

Experiment further with the light's Photon Intensity, Caustic Photons and Exponent values (exponent works like decay).

 

Global Illumination




● Open global_01.ma. This is a flying saucer in a garage, with the garage door animated to open.



● Go to the last frame of animation where the illumination is at its fullest. Render the scene.



● Switch to mental ray and select the Quality Preset PreviewGlobalIllum



● Select the spotlight

● Set Intensity to 0.3

● Set Emit Photons to On

Test render



● It is dark because the Exponent acts as decay on the photons and none are hitting the objects. Set Exponent to 1 and re-render.



● To brighten scene, set Photon Intensity to 15000 (from 8000) and re-render.



● To decrease blotchiness, under Global Illumination in Render Settings, set Radius higher



● When you reach the point where changing Global Illumination Radius has little effect, start increasing Global Illum Accuracy (smoothing effect).



● Experiment with adding soft raytraced shadows to your light.





Tip: When optimizing render time, go to the Render > Render Current Frame Option Box and turn Verbosity Level to Progress Messages. This will display information in your command shell during your render. After a render, the wallclock time is the time it took to complete the render.


Final Gather





With Final Gather, mental ray calculates the scene irradiance or total incoming illumination in the scene.

Final Gather is affected by the Final Gather settings in the Render settings window, as well as:

● the camera background color

● colored incandescence in the scene

● ambient color in the scene

● irradiance contributions from shaders

● irradiance color mapping contributions from shaders

● whether there are lights in the scene and their locations



Sample Scene:



Open finalGather_01.ma

This scene contains one light with Illuminates by Default turned off. A dome above the saucer has a slight Incandescence value.



● Switch to mental ray, turn on Final Gathering in the mental ray render settings and render.

● Experiment with incandescence levels on the dome's shader.



Color bleed with lights:

● In the light's Attribute Editor, turn Illuminates by Default ON. Render.

● In the mental ray section of the floor shader's attribute editor, decrease Irradiance Color slightly to decrease color bleed and darken the floor.



Color bleed, no lights:

● Turn back off Illuminates by Default in light.

● Adjust the Ambient Color or add incandescence to the ship's ramp shader. Render.



● Try changing the camera's background color to adjust lighting levels.

Settings:

Accuracy represents the number of rays used to compute indirect illumination. Increasing the value reduces noise.

Point Interpolation is an inexpensive way to smooth the result (set to higher values).

Point Density controls the number of points to be computed (expensive, so use higher values carefully).

Scale lets you control the Intensity and Color of the Final Gather contribution on a global scene level.


Tip:
To use IPR with Final Gather or Global Illumination, in Render View window select IPR > IPR Quality > Render Settings.



GI and FG Together




Open the file FgGi_01.ma



The scene contains 7 lights:

3 spots over the translucent panels

2 spots for the lampshade over the dining area

1 spot outside for interior direct illumination and shadows

1 directional light for exterior lighting



Change these attributes on spotlight5:

Decay rate to Quadratic, Intensity to 2500, enable Raytrace Shadows



On the following lights, turn off Illuminates by Default and then link them as follows:

spotlight1 to panel1

spotlight2 to panel2

spotlight3 to panel3

directionalLight1 to wall1

spotlight6 to lamp1



Change these attributes on spotlight4:

Decay Rate to Quadratic, Intensity to 45, enable Raytrace Shadows



Global Illumination Setup



Render Settings: Turn Global Illumination on

Accuracy: 450

Radius: 6

Spotlight4: Emit Photons: ON

Photon Intensity: 2000

Exponent: 2.0

Global Illumination Photons: 25000

Render



Final Gather Setup



Disable Global Illumination (turn off Emit Photons in spotlight4, GI to Off in Render Settings)

Turn Final Gather on in Render Settings

Accuracy: 125 (good for test rendering - later set this to 400-600)

You can turn up Point Interpolation for smoothness.

If render is too bright, adjust intensity of lights.

If some areas appear splotchy, apply Jitter



FG & GI Together



Toggle back on Global Illumination

In the Final Gather section of the Render Settings, turn on Pre-compute Photon Lookup (arranges irradiance to be stored with the GI photon map. Fewer Final Gather points are required with this option.)

Turn back on Emit Photons in spotlight4.




No comments:

Post a Comment