The stdrsl Library
The stdrsl Library
- Header Files
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:
Currently we include the following header files:
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.
This file provides a pure-virtual base class characterizing the standard interface of a BSDF component "by" the build-in integrators.
Serves as a central repository for common color manipulation functions.
Provides encapsulation of different techniques for approximating Fresnel refraction effects. Currently we support two approxations:
- init - uses the default Fresnel shading function.
- initSchlick - uses the faster Schlick's approximation.
Provides physically plausible components for hair. It includes a diffuse component based on Dan B. Goldman's Fake Fur Rendering, models three specular transport paths:
R (reflection),TRT (Transmission/Reflection/Transmission)TT (Transmission/Transmission)
based on Light Scattering from Human Hair Fibers, by Stephen R. Marschner, Henrik Wann Jensen, Mike Cammarano, Steve Worley, and Pat Hanrahan, and was simplified according to An Artist Friendly Hair Shading System, by Iman Sadeghi, Heather Pritchett, Henrik Wann Jensen, and Rasmus Tamstorf.
A simple BSDFComponent: an anisotropic scattering volumetric specular component parameterized by a color and a scattering parameter "g", which is the mean cosine of scattering interactions. g is between -1 and 1. A value of g > 0 indicates the volume is primarily forward-scattering while g < 0 indicates the volume is backwards-scattering. g = 0 means the volume is isotropic.
A simple BSDFComponent: an isotropic scattering volumetric 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 these before invoking init.
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.
A simple object that can be used to log error messages.
Provides a central repository for common mathematical constants and useful functions.
Provides a microfacet diffuse component parameterized by a diffuse color and roughness. As with other components, 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.
__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".
This component manages sample reduction up various ray trees.
This component manages sample reduction up various ray trees with provisions for sample reduction when the raytrace hider is in path tracing mode.
ShadingContext.h provides a container for geometric and other contexts relevant to BSDFs.
This lobe provides the Ashikhmin-Shirley anisotropic specular model and is intended to be used with a separate diffuse component.
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.
This component can be used in three ways, as governed by the mode parameter:
combined component - distributing samples across both refraction and reflection components
single specular component - standard non-refraction usage case
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.
This file provides shared code for invoking per-distribution implementation of SpecularMicrofacet.h, above.
This file provides functions for creating, evaluating, convolving, and rotating spherical harmonics. Example usage can be found in the Image-Based Relighting application note.