Lighting and Rendering is a process between experience and knowledge. Knowing how RenderMan will behave when you change specific settings is good but knowing why is much better since the process is independent of some variables and can be applied anywhere (even in other renderers). My background is with mainly Arnold (3 years) and these are my notes of the last 2 weeks lighting and rendering with RenderMan.
This scene was originally from Dylan Sisson and was adjusted in composition and shading with a new lighting setup.
The art of light is the art of understanding and vision. The vision first follows the basic understanding of 3D lighting.
- Direct/infinity (sun)
- Spot (RenderMan: Disk light with filters)
Tip: Avoid using mesh lights since they tend to have noisier results (for now).
intension & color
You can change the light strenght by either using intension or exposure. Exposure is intension2 and should be used while intension stays at 1.
In terms of light color you have the options of color and color temperature. Color temperature should be your default pick and color just as an exception for crazy effects (neon signs, unrealistic lights).
Color temperature is described by Kelvin which is a measurement of thermodynamic temperature. This way you can setup lights exactly as they are in reality: candle light with 1800 kelvin.
Falloff describes the intensity drop of the light by distance. In reality we have a falloff by 1/x 2.
Formula: If the object is 5 meters away from the light the lights intensity would be 1/25 (1/52). With 1 meter it would be still 100% (1/12).
b) Lighting the scene
Lighting a CG scene should follow the rules of real life lighting since it helps to define mood, shape, contrast and story.
Sets the dominant light with the main light direction. Even if not seen in the scene you can predict its direction by its highlight on the characters or objects. A clear and well defined key light should be your starting point.
A soft ambient light which eases the opposite side of the hard key light. Its strength is often half or less compared to the key light.
This light accentuates and defines the shape and separates it from the background. Hair light is one type.
It brightens up the background to separate it from the foreground.
Creates light dots in the eyes. Studies have shown that eyes which don't have light reflection, look dead. In reality, it is a sign for not enough eye water which indicates being dead.
Real scene lights (candles, lamps etc.).
- RenderMan/Light Lister: Gives a great and quick overview over the lights in the scene and allows fast solo lighting and changes. Some functions like solo didn't work on my current version and I also missed the option of color temperature.
- Lighting/Light Linking: Is a great help to define which light hits which object. But be careful since you can lose control over the scene very fast. In some cases, light linking is a necessity when for example your light penetrates objects which lead to fireflies (see the candles in the scene).
When working on performance the most important part is the render statistics. Luckily RenderMan provides a well-formatted XML file with every rendering which you should evaluate and compare to previous ones in your browser.
Renderstats are mainly good for one thing: Understanding your scene. By learning to read the scene it allows you to see the bottlenecks and helps you to understand your own workflow and priorities. Maybe you are using a lot of textures or are into complex shaders, many lights or heavy geometry. The result shouldn't be about changing the scene to make it go faster but fixing broken or unnecessary steps to get the best image in the shortest amount of time.
Since our scene has complex caustics and a hidden light behind the barrel I use the VCM integrator which uses bi directional raytracing and is more fitting for such a scene.
Statistics Options: Render Settings/Advanced/Statistics
XML Path: $project\renderman\$scene\rib####\$scene.####.xml
(First Render: 2:37:24 -> Last Render: 28:10 with even better quality)
Utilization (> 90%)
Shows how good the multithreading of your scene is. Good multithreading means an even split of tasks between your CPU cores. The more cores working at the same time the faster the rendering is. A rule of thumb is having a utilization of 90%.
Bottlenecks: Lower utilization can mean heavy IO (reading and writing). This is the case when your reading/writing drive is slow or there are too many or too heavy files (textures or geometry).
Having longer render times for specific parts are mostly a sign of problems. A typical one is when the light is too close or penetrates the geometry (see the candles). This can lead to a lot of noise and even fireflies (bright dots) in the scene.
Scene: In the beginning, the shading was dominating the scene and render time especially in terms of photons and transmission. I noticed that the grapes looked a little bit broken. At first, I thought it was the denoiser but it seemed to be the transmission. So I went from transmission to SSS which created an even better look. The change resulted that the shading was suddenly around 60% faster which meant my rendering was 50% faster by just changing some settings in one shader. Breaking the light linking with the candle lights and parts of the candles also helped to avoid some absurd results.
Pixel Variance (+ Min/Max Samples)
Since it is impossible to send an infinitive number of rays into the scene pixel variance checks the color information's between pixels. If the difference is too high it reacts by sending additional rays to get the in-betweens.
Max and min samples overwrite the pixel variance which allows narrowing down or widening the limits of the pixel variance. Min sampling allows small or hidden objects to be hit by enough rays and to avoid flickering. Max sampling on the other side can stop the integrator to shot too many rays for specific parts which maybe are broken or shot more rays for some parts which would mean to go over the limits of the pixel variance.
Bottleneck: An Unreasonable amount of samples means a lot of rays and compilation time without a big quality impact. So it is important to test out where you would see the threshold of noise. Low average samples can also be an indicator if it is too far away from you min/max samples. Setting min/max Sampling on the same value allows you to determine where more sampling is needed.
Note: Don't use different numLightSamples in VCM (see documentary). I couldn't even get RenderMan to render after I added one custom light sample.
ClampDepth and ClampLuminance effect the outcome of your high lights since they clamp the ray after a specific bounce (depth) or strength (luminance).
More samples mean longer render times but it can also assure to have more realistic results.
Using transmissive objects in the scene forces to have more spec rays. A simple wine glass needs at least 4 spec samples (in-out to get inside the glass and in-out to get outside the glass) not counting for the wine inside the glass. More diffuse samples allow a softer image with stronger color bleeding.
Scene: For our scene, we need at least 8 max spec rays since we have a glass of wine. I used 10 since they are also glass behind glass like with the teapot and the wine bottles. For max diffuse, I use 8 samples since lower results created black outlines on the glass objects and were losing highlights in the shadows.
In theory, it allows you to create a bounding box for a specific part of the scene where you can change a number of photons which are emitted at this position. For example to create an area with less photon emission.
The denoiser is great and creates final looking images very fast. Cross frame has, of course, better results than just single frame denoising since the software can use the surrounding frames to understand the noise pattern in the current image.
Bottleneck: The denoiser can create blurry images if the amount of noise in your scene is too high. Since the scene looks fine in the end he can also cloak problems and long render times in the scene.
Trace Light Paths / Thin Shadows
Most lights have the options Trace Light Paths and Thin Shadows.
Trace Light Paths casts photons which add to realistic shadows, caustic and transmissive reflections to the scene.
Bottlenecks: Thin Shadows is much faster than the photon based Trace Light Paths so it could be wise just to switch on Trace Light Paths on lights which really have an impact on the scene.
Our light setup is mainly inspired by the scene itself and is mimicking old still life paintings. After some time spent on render optimization, we could reduce the render time down to 17% of the original (2:37:24 -> 28:10) which is huge in terms of production rendering. Transmissive objects tend to flicker a lot in a moving image which can increase the ray count significantly.
Let me know what you think about my thoughts in the comments or if you have any corrections or additions. The scene file and a video with a moving camera will follow soon.
Thanks to Christos Obretenov and Paul Kanyuk for the great tutorials and tips and to Dylan Sisson for sharing this scene.
For additional information I would recommend the tutorials about “Debugging and Optimization" and “Still Life with RenderMan 20" which inspired this article:
Also recommended: “The art of 3D computer animation and effects" book