Prev | Next



The stdrsl Library

Introduction

The stdrsl shader library is intended to be a true resource for writing production shaders. The files can be found in $RMANTREE/lib/rsl/include/stdrsl/. The shader compiler is aware of this special location, so clients should refer to stdrsl components like so:

#include <stdrsl/SphericalHarmonics.h>

Header Files

Currently we include the following header files:

AreaSampler.h

Implements methods for generating points on a selection of common shapes. Primarily used by pseudo area lights to both distribute samples across simple geometric shapes and to trace rays against them. Because of the common use case, we rely on RadianceSample for data exchange. Generated samples write to the lightPdf field a worldpsace measure of the solidangle associated with the sample. We always write non-zero PDF values for generated samples. We also squirrel into the radiance field shape-specific parametric coordinates to uniquely identfy the sample. evaluateSamples is the inverse operation and obeys the same conventions as generateSamples.

BSDFComponent.h

This file provides a pure-virtual base class characterizing the standard interface of a BSDF component "by" the build-in integrators.

Fresnel.h

Provides encapsulation of different techniques for approximating Fresnel refraction effects. Currently we support two approxations:

  1. init - uses the default Fresnel shading function.
  2. initSchlick - uses the faster Schlick's approximation.

Lambert.h

The simplest of BSDFComponents - a Lambertian diffuse component parameterized by a diffuse color. Users may wish to separate the color into two terms in the calling environment - Kd and diffuseColor - but should combine the two before invoking init.

Math.h

Provides a central repository for common mathematical constants and useful functions.

RadianceSample.h

__radiancesample is the basic unit of communication between lights and surfaces and is explicitly managed by the renderer's built-in directlighting and indirectspecular integrators. The __radiancesample struct is unique inasmuch as it is built into the renderer and therefore "non-negotiable".

ShadingContext.h

ShadingContext.h provides a container for geometric and other contexts relevant to BSDFs.

SpecularAS.h

This lobe provides the Ashikhmin-Shirley anisotropic specular model and is intended to be used with a separate diffuse component.

SpecularDBRDF.h

This lobe models the single-scatter specular term, and is intended to be used with a separate diffuse component. The key advantage of the DBRDF formulation is that it does not restrict the distribution to any particular shape. This implementation allows the use of the Beckmann and Phong distributions.

SpecularMicrofacet.h

This component can be used in three ways, as governed by the mode parameter:

"refl+refr"

combined component - distributing samples across both refraction and reflection components

"refl"

single specular component - standard non-refraction usage case

"refr"

single refraction component - only useful if a ggx transmission component is to be combined with non-ggx speculars

From Walter, Marschner, Li, and Torrance's Microfacet Models for Refraction through Rough Surfaces; Eurographics Symposium on Rendering 2007.

SpecularMicrofacetDriver.h

This file provides shared code for invoking per-distribution implementation of SpecularMicrofacet.h, above.

SphericalHarmonics.h

This file provides functions for creating, evaluating, convolving, and rotating spherical harmonics. Example usage can be found in the Image-Based Relighting application note.


Prev | Next


Pixar Animation Studios
Copyright© Pixar. All rights reserved.
Pixar® and RenderMan® are registered trademarks of Pixar.
All other trademarks are the properties of their respective holders.