October 28, 2018
The original Robot Room training was made to produce feature film quality images in RenderMan. Our goal in this Broadcast training is to take a look at cheaper ways of producing a great looking image for episodic work, such as Star Wars Rebels, Sofia the First, and other animated television series which require very low render times in order to meet their tight deadlines.
We're aiming for around 5 minutes a frame on a 16 thread workstation in this exercise.
The scene was originally created to take advantage of many of the advanced rendering features in RenderMan for Maya and their integration with Nuke and Fusion, but this training will focus on getting images straight out of the renderer without post-processing, as television work typically has little time for post-processing.
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. This notion still holds true for the broadcast version, geometric complexity was very efficient to begin with, so we don't have to modify the models in any way. If this is not the case with your scene, make sure geometric complexity is as simple as possible.
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 number of controls for our surfaces. We will be keeping the same shaders as the original scene, but we will modify them to meet new shading goals.
The original scene used native Pixar procedural patterns as much as possible, including paint flakes and several noise patterns, but in this training we will see that using traditional texture maps or baking out procedurals works best for keeping render times down.
Let's take a look at the original version of Robot Room...
This is our target quality and look...
So what makes the broadcast renders above any different from a typical film production render?
Mainly indirect rays. These rays give us effects such as global illumination, subsurface, refractions, reflections, among others. As you can see, indirect rays are responsible for a lot of the subtlety present in realistic CG images.
How do we do this in RenderMan?
This is simple to do in RenderMan. All we need to do is dial down specular and diffuse rays to zero in the render settings. Even though this will change the look of our image, we can override the specular and diffuse rays on a per-shader basis if we need to keep some of the visual appeal on key assets, such as glass or metal.
Wouldn't direct lighting make my image look flat and unappealing?
No, with RenderMan's new RIS renderer, you will always have shadowing in the scene, meaning the direct camera ray will stop at the surface and occlude other surfaces, so you will never have to worry about unrealistic shadowing or light bleeding typical in the early days of computer graphics.
In practical terms, the result will be similar to a technique called "Reflection Occlusion," which was pioneered by ILM for the movie Star Wars: episode 1.
As we can see in the image above, with only direct lighting, we would expect something like the top-right image, but with reflection occlusion, we can get realistic shadowing and specular lookups for very cheap.
Even though it is not strictly the same effect under the hood, it is the same idea and a similar result...essentially, how do we shadow with 0 rays? Well, RenderMan can fire a single ray to determine where the geometry is and thus provide very fast occlusion results. This means we don't have to have ugly ambient lighting, including our environment lights.
In the image below we can see the effects of setting the render settings to 0 rays. You'd probably expect something like the image on the left, but RenderMan shadows by default, so you don't need to fear the 80's CG look!
Actually, sorry 80's, Tron still looks pretty great.
This touches on a point we will constantly reference: Art Direction. It is crucial to keep these limitations in mind in order to art direct your images appropriately.
Let's see how our image looks once we eliminate indirect rays form the scene (but keep them on for glass).
It is clear that our image doesn't look very compelling anymore, this is because we are trying to convert a production image into a broadcast image without taking these limitations into account. Objects are now overwhelmed with black metallic surfaces because they depend on indirect specular. Also, the lack of indirect diffuse is bringing a lot of unwanted darkness to areas which were previously rich in color thanks to "global illumination," such as room corners and underneath the furniture.
On the positive side, we've managed to turn our 1 hour render into a 20 minute render with a single change, that is compelling!
Let's see how we can continue improving our art direction and render times even further.
The shaders in the scene have to be redesigned. Indirect rays are expensive, so we need to make sure we can achieve a good look without them. Let's take a (quick!) trip down CG history to understand why...
Once upon a time...in the early years of computer graphics, specular highlights were made to fake the reflection of light sources because real reflections were too expensive to compute...how the world has changed! well, not for broadcast...
Since RenderMan is a pathtracer and not a rasterizer, it comes with many perks, this means we don't have to sacrifice many of the advanced shading results, such as energy conserving shaders and lights, shadows, or dome lights, these are all very quick to render in RenderMan.
Before I start with the shading tricks, let's understand some shading basics.
Dielectrics are non-metallic surfaces, such as plastics, fabrics, wood, etc. Dielectrics always have a white specular color.
Conductors are metallic surfaces, such as copper, tin, gold, etc. They are called this way because, yes, you've guessed it...they conduct electricity. Conductors always use the same color for both their specular and diffuse.
We are using simple diffuse surfaces to describe our walls and carpets...and we've gone further in this Broadcast version by removing all subsurface and transmission effects in furniture, plants, or fabrics. You will get some darkening of course, so lighting and color choices become important, but more on that later...
Faking plastic is pretty easy, the only thing we are sacrificing is indirect specular and diffuse, and we already have direct diffuse for all our plastics, so we don't need to make any drastic shader changes.
As we can see in the image below, we lose some appealing indirect shading, but the results are acceptable. You might need to adjust your color to be more vibrant in order to compensate for the loss in luminosity.
Metallic surfaces don't absorb light, they reflect it. That's why we always turn off the diffuse lobe in our metal surfaces and rely only on reflections for realism, but here comes the problem, we are turning off indirect specular (reflections), so now our metal shaders will be mostly black, and this is not acceptable for our look. The good news is we can resort to shading workarounds.
All we need to do is add Diffuse to our Metal shaders, which traditionally only have specular (reflective) properties. This is technically not accurate, but it's an acceptable trick to bring back the color lost when we got rid of reflections.
BTW, we can still use "Physical" or "Artistic" specular, there is no significant render time difference.
I have chosen to not use PxrFlakes on the robots, as sampling such minute detail can be expensive and will likely be missed by Denoise with our aggressive variance settings.
The fabric has been simplified. We have taken out the translucent shading and displacements. We are now relying purely on normals maps to convey texture and value. The shading parameters for everything else can stay, as adding fuzz is not an issue for render times.
In this example I've cranked the intensity values way up so that the "Fuzz" is visible, but in the final image, it is much more subtle.
Our robots have retro Edison light bulbs for eyes, so they need a glass housing. This is crucial to our look, so we can't use a solid material to convey the same effect. For this, we are adding diffuse and specular overrides to all glass surfaces to ensure they refract and reflect correctly. This is our only compromise in the scene.
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.
Paint Effects are very cheap to render, so we don't have to make any modifications from our original Robot Room Tutorial.
Lighting is very simple in both setups.
The Sci-Fi version uses an HDRI from Pixar's Piper collection, and some Rect lights. The Rect lights are adding about 2 minutes of render time. This choice is for visual appeal in the glass and some bounce light, since the scene becomes a bit too dark. The need for direct lighting could be overcome with a more sophisticated texture for our Env light.
The Kids version only uses a single Env Light with a solid white color, which will simulate an occlusion-style render, no other direct lights are in the scene.
Using plugins such as HDR Light Studio are a great way to create efficient light rigs by only using a single light source.
For Episodic or Broadcast shows, it is more likely you'll be using an Env light with an HDRI texture map to fake reflections via direct specular, so we've used a Piper HDRI texture map for the Sci-Fi scene and a solid white dome for the Kids scene. They are both very effective at providing an interesting look for very cheap.
Light Blockers are not a significant sampling concern, so we can use them in the scene if needed. Since the lighting rigs are so simple in both broadcast scenes, I didn't need to use any blockers.
A Portal Light is used to focus sampling in a chosen area. We are using them in both Broadcast versions, specifically the windows and frontal opening of the room. Sampling will be much more efficient this way.
All we need to do is create a Portal Light from the Portals section of our Dome Light. Once we have created the Portal Light, we can position, rotate and scale it to match the opening we are trying to focus sampling through.
Make sure the Portal Light doesn't touch geometry.
It's good to pick your battles for quality. Is an IES profile crucial to the look of the scene? If so, try to use it only with light sources which will make a big visual impact in the scene. I've chosen to use an IES profile for the main lamp, since it provides an appealing light pattern.
Suggested IES profiles in the RenderMan Community: Check it out.
Another nice feature is light temperature and we can use it without affecting our render times. We are in fact mixing color temperature and colors in our lights, just like a gaffer would use a light with a gel on set...sans the fire hazard...
Using geometric lights in this scene increased render times about 20%, so it wasn't too bad, but it took the render times to almost 9 minutes a frame, which I considered to be too much of an increase from our original goal of 5 minutes. In the end, the visual appeal of having glowing paintings and cords wasn't enough to warrant the increase either, so it was a good compromise to use a Constant shader...but guess what? Our robot eyes (filaments) are within the budget, so we are able to use Geometric Area Lights for them. This is crucial, because we can illuminate our surroundings, including the walls and furniture with the eyes. Fancy!
In the event we need to use emissive geometry, it is crucial we use Geometric Area Lights, instead of the "glow" attribute in PxrSurface shader. This last feature will rely on indirect lighting to provide the illumination, while a Geometric Area Light will rely on direct illumination, effectively making our geometry an actual light source.
in order to avoid compositing workflows, the background sky is a very simple plane and gradient, being shaded with a PxrConstant shader. I have also turned off all shadowing in the plane's render attributes. The clouds in the kids version are spline curves converted into NURBS objects, which RenderMan can render natively without having to poly convert.
This setup is very cheap to render.
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. Let's go over some of the ones that stood out for this particular Broadcast scene.
As described in our introduction, we are art directing this scene with the limitation of 0 diffuse and specular rays, except some selective overrides on glass and liquids when needed. This is the most crucial of all render settings.
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.
These broadcast scenes are very low in shading and modeling complexity, so they are using less than 2GB or RAM, which is very low and will fit in an average home computer. It should especially be no problem for the average render farm or professional workstation.
Using RenderMan's powerful Denoiser is crucial to keeping render times down. In this scene, the speedups are not as significant as the film version of Robot Room, because convergence is reached very quickly, but we are still deferring the last 20%-10% convergence to the Denoiser.
The Denoiser is doing a great job even though we are using an unusually high "Variance" amount (0.01). It works well for our scene because shading and texturing is simple.
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 personally like to make a separate "stats" directory. It helps retrieval.
These files are viewable with a web browser and provide some very useful visual cues and sampling breakdowns for our scene.
Advanced understanding of sampling and optimizations in RenderMan: Check it out.
The above statistic files compare the original Robot Room with the new Kids version of the Robot Room and the difference is striking! Sampling costs have fallen dramatically. Glass is the only thing RenderMan is spending significant time on, all other surfaces are rendering very quickly.
Just to reiterate the efficiency gains, that's 60 minutes down to 3 minutes!
...and finally, after lots of efficiency talk, let's take a look at our finalized broadcast versions!
This is slightly above our budget of 5 minutes, but we have notable perks in our lighting rig. We were able to keep:
Those are a lot of fancy tricks for around 7 minutes!
Well, this is below our budget of 5 minutes! We are not using a single direct light besides our Env light, which makes sampling a breeze for RenderMan. We are also using fake plastic liquid for our wine glasses.
This scene is much simpler, but it has an acceptable quality for a kids show at we are not sacrificing everything.
Differences in indirect lighting and post-processing are visible, but they are perfectly adequate for broadcast quality.
RenderMan allows deep customizations via shading, lighting and render settings, in order to reach tight deadlines inherent in broadcast and episodic work.
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.