Crash Course 

Ray Tracing with Delux


Introduction  - Delux


Pixar's RenderMan supports a variety of ray tracing calls and operations. The Delux Shading Model allows you to assemble many different shading components together. Because Delux is so versatile, the most straightforward way to add raytracing to a shader is just to build it into a Delux Shading Model. Understanding how to ray trace with Delux will help you understand how Delux can be used to create all sorts of shading models. 
 


In this Lesson

We'll take a look at Delux. We'll use Delux to create ray-traced effects like: reflections, refractions, subsurface scattering, and indirect illumination.  


Ray Tracing with Delux


1 -   Open the Maya Scene


For this tutorial, open the scene: 

/mtor/scenes/rays/rays.mb

(Where are the scene files?)


2 - Enable Ray Tracing


Before we start ray tracing, we must enable ray tracing in MTOR. Open the Rays tab in the RenderMan Globals and "Enable Ray Tracing" via the checkbox. By default ray tracing is disabled.


Be sure to enable Ray Tracing


3 - Ray Tracing General Controls


The General Attributes tab of the RenderMan Globals contains several controls which affect reflections, these can be overridden on a per Ensemble basis. The defaults are fine, but here's a glossy overview:

Max Specular Depth - Limits how many times reflections bounce. When inter-reflections are required, this can be increased. Otherwise a lower value, like 2, is fine. 

Trace Displacements - This setting only affects how objects appear in reflections. When this is enabled, displacements will appear in reflected objects, which is more accurate, but slower. 

Trace Bias - Controls how close to the surface rays are fired. If ray traced effects begin to pull away from surfaces, this can be adjusted.

Sample Motion - When enabled, reflections of objects will be blurred.  

 


The General Attributes Tab


4 - Delux


Next, in Slim, create an Ensemble and connect a Delux shading model to the “Surface”. Attach the Delux Ensemble to the sphere and render. You should see something similar to the image on the right. 

It's worth noting that Delux provides the ability to perform all kinds of shading model operations, but only performs ray tracing calculations if they are explicitly built into Delux. 

 


The Scene Rendered


5 - Delux: Adding a Reflection Component


The Delux shading model lets you build your own custom shading model with only those elements that you need, diffuse and/or specular and/or reflections, etc. These different elements that can be assembled together are called Shading Components.

Delux contains a diffuse component by default. To create ray traced reflections, we'll add a reflection component.

A) First look at the image of Delux on the right. Click on the big "+" (plus sign) next to the "Shading Components" entry. A new component, "V2", appears. 

B) Next click on the orange button next to the "B" in the image at right. A pull-down menu will appear. Select Reflection from the list. 

Use the triangle next to the "V2" to toggle your menu open and closed. 

Congratulations. You've added a reflection component to the Delux. Woot! 

   


Reflection Strength
Now render the scene. You should see something like the image on the right. 

Now the Delux shading model has both a diffuse and reflection component. Note the intensity for both values is "1". 

 

 


Reflection Intensity "1"


Increase Reflection Fidelity
In the image above, the reflection looks alright. Occasionally ray-traced reflections appear "jagged", with blocky artifacts. By casting more samples we add more sampling to the reflection, effectively anti-aliasing the effect. In such a case the samples could be increased to a value like "6". Higher samples increase detail as well as render times. 

For more info on multi-sampling for anti-aliasing effects see: Multi-sampling.

 



Blurry Reflections
Reflections can be blurred and multi-sampled. Next change the reflection Blur to "1" and change the reflection Samples to "6". Render. The result will be much smoother.

Remember, when blurring, higher samples are required to avoid dotty artifacts. 

For more info about blurring and multi-sampling see: Multi-sampling.


Blur "1" ~ Samples "1"

 


Parameter Tweaking
When a new shading component is created its default values will need to be adjusted depending on the kind of material you want to create. A diffuse and reflection intensity of "1" is too much. Set the reflection intensity to "0.5" and diffuse intensity to "0.25".

Note: before going on the next step, set the Reflection Samples to "1" and the Blur to "0". Things will render faster this way. 

 


Diffuse with an intesity of "0.25"
Reflections with an intesity of "0.5"
Reflection blur is set to "0"


6 - Delux: Adding a Specular Component


Specular Component
Specular highlights are an important element of shiny, reflective, surfaces. We can add a specular highlight to this Delux shading model just like we added the reflections.

First, add a new shading component. Do this as outlined above.

A) Create a new Shading Component by clicking the "+"

B) Click the orange component button and select "Specular". 

Now render the swatch and behold the specular highlight.

 

 

 


Specular shading component added to the Delux


6 - Delux: Adding a Refraction Component


Create Refractions

We currently have a nice shiny surface, but let's say we'd like to make a glass object. We can add a refraction node to do that. A refraction node is added in the same manner as the other shading components.

A) Create a new Shading Component by clicking the "+".

B) Click the Orange component button and select "Refractions". 

After creating the Refraction component, set its intensity to "0.75" and the Reflection intensity to "0.25" to get a more realistic effect. 


Note that the Max Specular Depth in the Ray Tracing General Controls limits how many times a ray will bounce. For this effect at least two bounces are needed to send the rays through the back side of the object. 




Now render. You should get something similar to the image on the right. 
Refractions ~ Max Specular Depth "2"
Default Index of Refraction: "1.5"
Index of Refraction

The index of refraction determines how much an object will bend light. The default is "1.5", which will bend the light quite a bit. The value of the index of refraction for some common objects is listed below.

Some Common I.O.R. Values

Vacuum 1.00
Air ( 1 atmosphere ) 1.000278
Water 1.33
Magnesium fluoride 1.39
Fused Silica 1.46
Zinc crown glass 1.53
Crystal quartz 1.55
Optical glass 1.51 - 1.81
Heavy flint glass 1.66
Sapphire 1.77
Diamond 2.43


Index of Refraction 1.02
 

Index of Refraction 1.33


Index of Refraction 2.43


Blur Refractions
Refractions can be blurred just like reflections.

Set the index of refraction to "1.5", the refraction Blur to "1", and the refraction Samples to "6". Render.


Refraction Blur "1.75" ~ Samples "6"


Reflections & Refractions
That's how reflections and refractions work with the Delux Shading Model. When creating these effects pay attention to the surface normals of the object and make sure they are pointing in the correct direction. 

 


9 - Conclusion


Delux is a shading model that allows you to construct a custom collection of surface attributes. Using Delux it becomes easy to add ray-traced effects to a shader. As you become familiar with the ray tracing concepts you'll see that many of these effects can be created in other ways.

A familiarity with the MTOR Ray Tracing documentation is a good place to continue from here: RenderMan Artist Tools- Ray Tracing

Also See:
RAT Tutorial- Baking Occlusion     
RAT Tutorial- Caustics


 

Pixar Animation Studios
(510) 752-3000 (voice)   (510) 752-3151 (fax)
Copyright © 1996- Pixar. All rights reserved.
RenderMan® is a registered trademark of Pixar.