EDIT

{{article.title}}

modified {{article.lastModStr}}
{{videoUrlObj.title || videoUrlObj.oEmbed.title}}
{{videoUrlObj.description || videoUrlObj.oEmbed.description}}
{{ article.videoUrls | totalDuration }}

RenderMan 21

Robot Room

Created by Leif Pedersen | @leif3d


Overview

Robot Room started as an interior study for indirect illumination and progressed into a scene with a robot couple taking a break while building their first robot son...what can I say, I like robots...

The scene was created to take advantage of many of the production-ready features in RenderMan for Maya and their integration with Nuke and Fusion, including various Pixar Surface materials, Maya Paint Effects, Daylight simulation, IES profiles and Volumes. We also touch on several crucial compositing features, such as AOVs, LPEs, Light Groups and Deep Data compositing.

Scene Breakdown

The technical goal of this scene, was to achieve realism in an interior setting without compromising speed, so I made objects clean and simple in order to rely on shading detail.

We are using textures downloaded from texturise.club for most of the scene, including our wall. We are also using Pixar Surface Material (PxrSurface) for most of the scene, as it provides an extensive amount of controls for our surfaces.

The scene also uses native Pixar procedural patterns as much as possible, including paint flakes and several noise patterns. Keeping shaders procedural allows us to tweak and extend them easily.

Shaders

The shaders in the scene are pretty varied, but they are all meant to look synthetic. From fabrics to metals, the scene is very tailored to the Robot's fancy lifestyle. The scene relies heavily on indirect rays, with indirect diffuse providing a lot of the interior lighting and indirect specular providing a lot of the robot's shininess.

Recommended shader library to get started with RenderMan shading networks: Get it here.

Diffuse

We are using simple diffuse surfaces to describe our walls and carpets. Not everything needs to be shiny, especially since not having to calculate specular saves us rendering time.

In order to keep things realistic, I usually add a little bit of irregular diffuse response. We can do this by adding some roughness to PxrSurface, this gives surfaces a micro-facet diffuse response thanks to RenderMan's Oren-Nayar diffuse model, instead of a traditional Lambert model, which is designed to simulate perfect diffusion, and we all know most surfaces are not.

The diffuse maps can be hooked up to the shader with a PxrTexture node or a Maya file node, RenderMan supports both natively. I've chosen PxrTexture for this scene, but you might want to use the Maya file node for better viewport feedback.

Color Management

When we use typical 8-bit color textures to drive color channels in our shader, we need to make sure we set our PxrTexture to Linearize. This will convert the color profile from sRGB to Linear, which will provide accurate representation of color and lighting. When using textures to drive data inputs, such as roughness or bump, there is no need to linearize.

It's very important to keep color management (gamma correction) in mind, or we will get inaccurate lighting results.

Suggested tutorial on Color Management and Linear Workflow in RenderMan: Check it out.

Fabric

The fabric is meant to be synthetic, so we've used iridescence to give it an otherworldly feel, combined with some fuzz and a normal map, we have a strange-looking, but robot friendly fabric.

It is best to use normal maps when possible because normal maps encode all required values in the RGB channels. The only cost is loading the texture tile, which is amortized by RenderMan's texture cache. Bump is more expensive because we need to evaluate the input 3 times instead of 1 to compute the orientation of the normal (tip by Pixar's Philippe Leprince)

To use normal maps in RenderMan, we need to use the PxrNormalMap pattern. We can load a file texture from the pattern itself or we can connect a procedural to the input normal attribute.

Metal

As expected, there are many metals in the scene, from shiny to dull or realistic to fantastic, so we're using a mixture of artistic and physical specular response in Pixar Surface to get have as much freedom as possible. A great way of getting good values for Refraction and Extinction coefficient when using physical mode, is going to refractiveindex.info, where we can choose convenient values from the 3D category and get very accurate results for our metals.

Extinction coefficient is particularly important, as it will be the determining factor for how energy is distributed across the surface. This can have a dramatic impact in realism for our shaders.

These values many times are significantly beyond a typical 0-1 range, so don't be afraid to push them.

For the dad we're using the PxrFlakes pattern to give him a shiny metallic paint look. The PxrFlakes pattern is not a color pattern, it is a Normal pattern, meaning, it perturbs the normal and acts like a normal map, so we can hook it up directly into the bump attribute of our PxrSurface Material.

Glass

Our robots have retro Edison lightbulbs for eyes, so they need a glass housing (they also serve as robot-bifocals). We are also using a grunge scratch texture to add variation to the roughness of the glass. This will add some realism and diffuse the filaments slightly, adding a nice glow to the eyes of the robots.

Make sure to clamp values to reasonable amounts, we've chosen values between 0.01 - 0.14. Using a PxrRemap pattern is very useful for this, as it allows us to manipulate the input and output values thoroughly.

Glass shading needs many diffuse and specular bounces to allow the ray to pass through the object and shade what's on the other side, which can be computationally expensive. We don't want such high ray depth values for our entire scene, so in order to optimize this, we've assigned diffuse and specular overrides to the glass material. This will help us render the interior much more efficiently, while making the glass nice and rich with many ray bounces.

To add RenderMan special attributes for our Material:

  1. Select the RenderMan Material
  2. In the attribute editor go to attributes > RenderMan > Manage attributes.
  3. Choose Max Specular Depth and Max Diffuse Depth.
  4. Increase values to desired amount. We chose 10 and 10, which are very aggressive values.

When compositing transparent objects like glass onto a background in post, we naturally need a transparent alpha channel, as is the case with the robot mom against the window frame. For this to happen, we need to make sure we turn on accum opacity in the integrator settings, or else the glass will have a solid alpha.

Paint Effects

RenderMan is able to render Maya Paint Effects natively (as curves), without conversion to polygons. This is a great time saver setup-wise and very efficient to render, all we need to do is tell Pixar Surface about the Paint Effects brush colors. We can do this by adding a primitive variable, in this case: Cs (color), which will tell the shader to grab the color values from our paint effects brush.

We need to make sure the Paint Effects Brush Type is set to Paint.

Let's break it down:

  1. Select the Paint Effect shape node
  2. In the attribute editor go to attributes > RenderMan > Manage attributes.
  3. Attach custom RenderMan attribute: Custom Shading Group
  4. Assign a Pixar Surface Shader to Custom Shading Group
  5. Attach a PxrPrimvar to Pixar Surface Shader Color
  6. Set Variable Name to Cs and Variable Type to Color.

For efficiency, RenderMan doesn't generate normals, shadow or allow indirect visibility for Paint Effects, but we need all those things for the sake of realism. Let's add those attributes to our material:

  1. Select the paintEffects material
  2. in the attribute editor, go to Attributes > RenderMan > Manage Attributes
  3. Add Indirect Visibility (specular and diffuse rays), Transmission Visibility (shadows) and Round Curves (normals).

This will make all shaded plants look much more realistic, by adding shading attributes which will make them interact with the rest of the scene in a more cohesive manner.

Note that the Round Curve attribute is designed to work for distant elements, extreme closeups are prone to minor artifacts. For closeups, converting paint effects to polygons might be the better solution.

Lighting

The look-dev goal was to do a dusk environment, for that golden magic-hour feel.

This scene mixes realism and stylization for lighting. Even though we are using a daylight simulator, we are art directing most of the scene with manual kickers and fill lights when necessary. RenderMan provides the best of both worlds, so we can freely art direct our vision.

We are also heavily using light blockers and inverted light blockers to focus the light exactly where we want it, including removal of unwanted specular highlights in the lamp and avoiding excessive washing out of the scene from the rim lights.

The main light blocker is an actual piece of geometry, which is meant to simulate a long hall in the back of our camera, this is to avoid having too much light come in from behind the camera and flatten our scene. This allows us to get higher contrast lighting from the window and soft indirect light subtly bouncing in from behind the camera.

Daylight

To simulate a sun-drenched dusk, we used the RenderMan Daylight simulator. This tool provides a very handy "manual" mode which we are using to art direct the sun exactly where we need it. It also provides a great way to quickly setup lighting by stipulating a date, time and place, which is a great way of playing time traveler (I wonder what the day was like on January 28th, 1980...)

Note: Due to internal optimizations, the daylight simulator doesn't support portal lights...so don't go crazy trying to make it work!

Blocker

Thanks to light blockers we can redirect light exactly where we want it. Going as far as removing specular highlights or specifying a perimeter of illumination for our light. All we have to do is right click in the light's Light Filter attribute and choose from a selection of Light Filters. We've chosen PxrBlocker for most of the scene.

In order to use the blockers as area of influence for the lights, we just need to invert the blocker. This will do the opposite of blocking light, it will only allow light emission inside the blocker area.

IES

A great way to add realism to our scene is to add IES profiles to our lights. These photometric data maps provide physical light distribution straight from manufacturer specifications, creating interesting patterns of light. We can also create custom stylized IES profiles for a balance between realism and artistic control.

Note that using IES profiles will affect the intensity of the light, sometimes by a big margin, so ideally start lighting you scene with the IES profiles already assigned to your lights. For example, in our Robot Room, the IES profile has an exposure of 8 and emits about the same light as a default sphere light with an exposure of 20.

Suggested IES profiles in the RenderMan Community: Check it out.

Normalize

We are also using light normalization in most of our lights. This allows us to scale lights without having to worry about them changing intensity. Note that this is not physical, if we have two lights of equal intensity in the real world, the bigger light will be more intense than a smaller light...but it is nice to break the rules sometimes...

Temperature

Another nice feature is light temperature. We are using temperature for all our lights, including the robot eyes (filaments), this gives the scene a pleasing and realistic light color based kelvin light temperature, for example, the average home lightbulb has a temperature of 2700 and an office neon has a temperature of 4200, we're taking this into account when choosing light temperatures for our Robots...we want them to feel at home...

Overall, it's important to keep in mind that this is a creative tool, so don't be afraid to add lights and direct the eye where you want the viewer too look in order to tell the best story. In this simple example, I've tried to emphasize a little easter egg, so I've placed some lighting which will help the legibility of the books...these books will help the robots deal with any existential crisis...

Volumes

With volumes we can add a sense of atmosphere to a space, by providing some light rays and particles. With RenderMan, we need to think physically, but we also need to make sure we are efficient when rendering these effects, as they can be expensive to render.

Light Ray

The rays of light coming through the window are done using a simple volume primitive, which encompasses the entire living room. We need to attach a PxrVolume material to the volume primitive and set the Density to 0.001, which will mimic a very fine amount of material in the air. We can also increase the sampling slightly for efficiency and change the anisotropic response, so that the rays are coming in more dramatically.

We have 2 light rigs:

  • Daylight + robot lights + volume multiscatter
  • Distant Light + robot lights + single scatter.
  • One provides a haze and the other more traditional light rays, this will give us nice control in post.

    We then create a separate scene and used Dynamic Shader Binding to non-destructively override the shading of the entire scene with a matte object, we can see this process in more detail below.

    Dynamic Shader Binding

    It is always best not to touch the scene for overrides, in production you might not have access to the original asset, or setting up render layers might be too time consuming. That's where Dynamic Shader Binding comes to the rescue, allowing us to override shading and attributes right before render time.

    Dynamic Shader Binding uses xpath expressions and we are using the following simple code to isolate the override to all objects inside the " everything" group:

    //everything//*
    
    Suggested Xpath expression examples: Learn more.

    Let's follow some steps to get familiar with the process:

    1. Make new PxrConstant shader, let's call it matteShader
    2. Attach a custom RenderMan attribute to the shader called matte object
    3. Open the Dynamic Rules Editor from the RenderMan shelf
    4. Right click on an empty space in the editor and select: Insert Rule
    5. Write //everything//* under the path tab
    6. Right click under the Payload tab (it will say "empty")
    7. Select Insert Payload
    8. Choose matteshader

    Particles

    For the scene particulate we are using Maya nParticle Sprites. This will allow us to attach a simple procedural shader that mimics dust, and with the help of a simple script we can randomly scale and rotate the particles upon creation. We'll follow very similar instructions to our Paint Effects shader attachment, as well as using Dynamic Shader Binding to render them separately, which will give us more flexibility if we make changes.

    Let's follow some steps for shader creation:

    1. Select the nParticle shape node
    2. In the attribute editor go to attributes > RenderMan > Manage attributes.
    3. Attach custom RenderMan attribute: Custom Shading Group
    4. Assign a Pixar Surface Shader to Custom Shading Group
    5. Make material double sided and add some transmit gain
    6. Make procedural pattern or import your own painted dust file texture
    7. Attach the pattern to the material's presence.

    Now that we have a shader attached, we can add some variance to the rotation and scale of our sprites by adding an expression to the Sprite's Twist PP and Scale PP.

    nParticleShape1.spriteScaleYPP = rand(1.2,3);  
    nParticleShape1.spriteScaleXPP = rand(1.2,3);  
    nParticleShape1.spriteTwistPP = rand(0,360);
    

    Render Settings

    For all projects there are optimizations to consider, and this robot scene was no exception. We had to consider many optimizations and advanced features to make sure we were rendering in a reasonable amount of time and without artifacts. Lets go over some of the ones that stood out for this particular scene...

    Rays

    First, I optimized specular and indirect rays as much as possible. We are only using 1 diffuse bounce and 4 specular bounces, because I didn't consider the added bounces of light to have a significant effect on the look I was trying to achieve. This is insufficient for several surfaces, so for any further shading detail, such as the glass, we are manually increasing these attributes on a per-shader basis in order to keep track of our shader interactions.

    Dicing

    In order to avoid any seams in our displacements, we need to turn on dice watertight in the advanced menu, this will ensure any UV seams are sown together for a clean displacement result.

    Useful Zbrush to RenderMan workflow: Learn more.

    Animation

    When doing animation with displacements (in our case a flythrough), it is very important to keep in mind dicing. RenderMan will dice the displacement every frame in camera space, which might create flickering due to slight dicing discrepancies in every frame. To avoid this, we are adding a RenderMan attribute called "dice rasterorient" to all our shaders which have displacements. This will tell RenderMan not to calculate the dicing every frame.

    Caches

    Another important factor when rendering, is understanding the cache settings. We need to make sure we have enough memory to crunch all the data in the scene, in order to avoid going to virtual memory (swapping) which will be significantly slower. For this, increasing the modest (and safe for most computers) default cache amounts is important. Even though the scene is very memory efficient, I chose to use a total of 16gb for this scene to be on the safe side.

    Typical memory usage should be around 80% of system memory, this leaves enough for the operating system and other applications to run reliably. When rendering locally, you will need to allocate less if your Maya session is very heavy and already using considerable amounts of memory.

    Diagnostics

    Using Statistic files is incredibly useful to understand where the most expensive parts of our renders are. The heat map helps us identify problem areas which might need optimizations. These areas are usually not obvious to the naked eye, so having a complete breakdown of our scene is very helpful.

    We can turn the stats files on in the advanced render settings by specifying a name in the Statistics XML File...for example, /scenes/robotRoom.xml which will give us an xml file in our project's scenes directory...I like to make a separate "stats" directory myself.

    These files are viewable with a web browser and provide some very useful visual cues for our scene.

    Advanced understanding of sampling and optimizations in RenderMan: Check it out.

    Denoise

    Using RenderMan's powerful Denoiser is crucial to keeping render times down. In this scene we are seeing significant speedups by deferring the last 20%-10% convergence to the Denoiser. We are also separating the beauty and volume passes into separate renders in order to take advantage of unique Denoise strategies.

    Compositing

    I used Fusion for the still version of the Robot Room, and for the animated fly through I used Nuke, as I needed Deep Data support. Both comps are available in the download section. We are not doing any mayor compositing, only some color correction, DOF, vignetting and camera shakes, since most creative choices were able to be finalized in the Maya session.

    AOVs

    These passes, or Arbitrary Output Variables, are practically free in RenderMan, because we are just requesting this already available data to be written to disk, they do not function as a traditional render layer or render pass, where data has to be recomputed.

    Useful AOVs include: Depth, Normal and Motion Vectors, all useful for post effects, such as Depth of Field, Relighting and Motion Blur. We're not necessarily using any of them for this scene, so we are not outputting any.

    Suggested compositing training: The Grand Tour: Compositing

    LPE

    Light Path Expressions or LPE for short, are also practically free, since the lighting data is already available, we are only requesting RenderMan to write it into a new image on disk. There is no computational overhead. We can even separate each lobe from pixar Surface Material, giving us incredible flexibility for manipulating our scene in post.

    Even though we outputted most LPEs in order to have as much flexibility as possible in post, I only used a couple for color correction. For example, it is useful to have indirect diffuse or specular LPEs to add a punch of luminosity or saturation to a certain part of the image, this allows us to to art direct the viewer's focus in post.

    Light Groups

    We are using Light Groups, which in Maya are referred as Light Sets, to separate the main light rigs, which I have arbitrarily separated into 4 categories called: House Lights, Sun Light, Robot Lights and Rim Lights. We're creating these Light Groups in RenderMan's Light Lister, accessible in the RenderMan Maya Shelf.

    This allows us to bring extra emphasis to a specific light rig, in our case we are using the Rim lights and the Robot lights in order to increase contrast and lighting intensity on the walls.

    Using Light Groups is a great way to completely redo your lighting in post. Below we can see I was able to change my lighting to a night time lighting scheme just by using the Robot Lights, Rim Lights and a very small amount of the Sun Light rig.

    Deep Data

    RenderMan is able to output Deep Data through DeepEXR (exr) and DeepIMAGE (dtex). DeepEXR is the newer and more versatile image format, providing scanline decoding support and several other features which speed up compositing.

    Suggested article on Deep Compositing by FXguide: Check it out.

    The output process is pretty simple, all we need to do is attach deep data onto an arbitrary output:

    1. First, we need to create any output. I've chosen Ci (beauty).
    2. Then we need to choose deepexr as the output image format.
    3. Lastly, we need to make sure the EXR file is output in scanline format. For that, let's attach an optional attribute called openEXR Storage Type. We'll set it to Scanline.Our output window will look like this:

    Double click on the output and change the name to something more useful, such as DeepEXR.

    Recap

    RenderMan allows us to iterate quickly and make many look development changes during an interactive session, which is a great way of minimizing post work in order to achieve our vision as close as possible in-render.

  • Remember to optimize shaders when needed, not all surfaces need to be specular, especially if the visual impact is negligible.
  • Adding surface detail and abrasion to our surfaces is crucial for realism.
  • Extend Maya's rendering capabilities greatly with Custom RenderMan attributes.
  • Don't get caught up in over emphasizing realism in exchange of creativity, RenderMan plays well with both aesthetics.
  • Make separate render passes for volumes to take advantage of volume-specific denoising.
  • Make sure to understand render settings well and what optimizations work best for your particular scene.
  • Use AOVs and LPEs to extend your art direction greatly in post, but remember RenderMan allows you to iterate qucikly in Maya.
  • Use Deep Data compositing to do incredibly accurate DOF in Nuke.

  • About the Author

    From pitch to delivery, Leif Pedersen is a CG Generalist who's worn many hats in production for over 10 years. His background in traditional arts mixed with technical foundations has allowed him to work with a varied client list in both television and commercial work, and has now joined Pixar's RenderMan team.




    Project Assets
    Tags
    • {{tag.name}}

    Log in to post a comment

    {{ commentBody.length || "0"}} / 10 characters

    No Comments, Yet

    Comments