Renderman

How to improve shadow quality


Presenter 3D does a good job handling shadows for RenderMan projects, but there's room for improvement. This page will show how to improve shadow quality by adjusting a couple of shadow parameters that are missing from Presenter 3D's user interface. It would be a simple task for VIDI will add the missing parameters to the user interface, but this workaround will do the trick for now.

To illustrate the technique, let's start with a simple model of a sphere sitting on a square panel. Here is the scene rendered with a "sun" type light for global illumination, with no shadows.

Now, substitute the sun with a spotlight and turn on the shadow-casting options. Here is what we get:

Note the sharp edges at the edge of the light beam, and in the shadow of the sphere. The jaggies are quite apparent.


The Soft Edge

The image can be improved by setting the "Soft Edge Angle" parameter in the spotlight attributes window.

The Field of View and Soft Edge Angle parameter can also be adjusted and viewed in the graphical view.

Rendering with the Soft Edge Angle option gives a smoother falloff at the edge of the beam:

This is an improvement, but the shadow cast by the sphere still has a noisy, hard edge. This problem will be corrected in the next step.


The Case of the Missing Parameters

The Presenter 3D spotlight uses a standard RenderMan shader called "shadowspot" to generate the light source. (Shadowspot is documented in the release note MRM Shader Notes Part 2, included with MacRenderMan).

It turns out that Presenter 3D is missing controls for a couple of important parameters: samples and width. Since Presenter 3D does not specify a value for them, MacRenderMan uses the default values. The defaults are optimized for speed over quality.

According to the documentation, "samples" controls the sampling rate for filtering the shadow map. Higher values will produce less noisy-looking shadows, but will take significantly longer to render. The default value is samples=16.

The "width" parameter controls overfiltering. Higher values will give shadows more blurry edges, which can be used as an effect or to hide the jagged edges of a low-resolution shadow map. The default value is width=1.

So the trick is to control the samples and width parameters passed to the shadowspot shader in the RIB file. Here is another rendering of the image, with width=4 and samples=24.

With the modified width and samples values, the shadow cast by the sphere is softer and more natural-looking.


Working around the problem

Although Presenter 3D does not directly control the width and samples parameters, there are a few ways to work around the problem. Here are a few ways:


Modifying shadowspot shader for better quality

 

 

HOME

NEW

LINKS

GALLERY

ARTICLES

PLUG-INS

RENDERMAN

Switch to Frame View




Copyright © 1997 by WebNation
All trademarks are the property of their respective holders