BRDF API

BRDF Evaluation Methods

We provide an interface for users to define a BRDF and its associated methods. All the functions receive an arbitrary void pointer where the programmer can store needed parameters. An "instance" of a BRDF is meant to be located at a certain point and to a certain viewing direction. The programmer must take care of this and store it in the arbitrary data pointer.

typedef AtVector(* AtBRDFEvalSampleFunc )(const void *brdf_data, float rx, float ry)
 Returns a direction according to some distribution based on the reflectance of the BRDF. More...
 
typedef AtColor(* AtBRDFEvalBrdfFunc )(const void *brdf_data, const AtVector *indir)
 Returns the actual reflectance from a given direction to the viewer's direction. More...
 
typedef float(* AtBRDFEvalPdfFunc )(const void *brdf_data, const AtVector *indir)
 Returns the probability density for the above sample function at a certain incoming direction. More...
 

BRDF Integration

AI_API AtColor AiEvaluateLightSample (AtShaderGlobals *sg, const void *brdf_data, AtBRDFEvalSampleFunc eval_sample, AtBRDFEvalBrdfFunc eval_brdf, AtBRDFEvalPdfFunc eval_pdf)
 Returns the direct radiance reflected from a light by the provided BRDF using MIS. More...
 
AI_API AtColor AiBRDFIntegrate (AtShaderGlobals *sg, const void *brdf_data, AtBRDFEvalSampleFunc eval_sample, AtBRDFEvalBrdfFunc eval_brdf, AtBRDFEvalPdfFunc eval_pdf, AtUInt16 ray_type)
 Returns the indirect radiance reflected by the provided BRDF. More...
 

Pre-defined BRDFs

AI_API AtColor AiOrenNayarMISBRDF (const void *brdf_data, const AtVector *indir)
 Returns the Oren-Nayar BRDF multiplied by the cosine of the angle between the incoming light direction and the surface normal. More...
 
AI_API float AiOrenNayarMISPDF (const void *brdf_data, const AtVector *indir)
 Returns the result of the PDF used to importance sample the Oren-Nayar BRDF for the given direction. More...
 
AI_API AtVector AiOrenNayarMISSample (const void *brdf_data, float randx, float randy)
 Returns a sample direction for the Oren-Nayar BRDF given two random values. More...
 
AI_API void * AiOrenNayarMISCreateData (const AtShaderGlobals *sg, float r)
 Returns a pointer to the data required by AiEvaluateLightSample() to sample the Oren-Nayar BRDF using multiple importance sampling. More...
 
AI_API AtColor AiCookTorranceMISBRDF (const void *brdf_data, const AtVector *indir)
 Returns the Cook-Torrance microfacet BRDF multiplied by the cosine of the angle between the incoming light direction and the surface normal. More...
 
AI_API float AiCookTorranceMISPDF (const void *brdf_data, const AtVector *indir)
 Returns the result of the PDF used to importance sample the Cook-Torrance BRDF for the given direction. More...
 
AI_API AtVector AiCookTorranceMISSample (const void *brdf_data, float randx, float randy)
 Returns a sample direction for the Cook-Torrance BRDF given two random values. More...
 
AI_API void * AiCookTorranceMISCreateData (const AtShaderGlobals *sg, const AtVector *u, const AtVector *v, float rx, float ry)
 Returns a pointer to the data required by AiEvaluateLightSample() to sample the Cook-Torrance BRDF using multiple importance sampling. More...
 
AI_API AtColor AiWardDuerMISBRDF (const void *brdf_data, const AtVector *indir)
 Returns the Ward-Duer microfacet BRDF multiplied by the cosine of the angle between the incoming light direction and the surface normal. More...
 
AI_API float AiWardDuerMISPDF (const void *brdf_data, const AtVector *indir)
 Returns the result of the PDF used to importance sample the Ward-Duer BRDF for the given direction. More...
 
AI_API AtVector AiWardDuerMISSample (const void *brdf_data, float randx, float randy)
 Returns a sample direction for the Ward-Duer BRDF given two random values. More...
 
AI_API void * AiWardDuerMISCreateData (const AtShaderGlobals *sg, const AtVector *u, const AtVector *v, float rx, float ry)
 Returns a pointer to the data required by AiEvaluateLightSample() to sample the Ward-Duer BRDF using multiple importance sampling. More...
 
AI_API AtColor AiAshikhminShirleyMISBRDF (const void *brdf_data, const AtVector *indir)
 Returns the Ashikhmin-Shirley BRDF multiplied by the cosine of the angle between the incoming light direction and the surface normal. More...
 
AI_API float AiAshikhminShirleyMISPDF (const void *brdf_data, const AtVector *indir)
 Returns the result of the PDF used to importance sample the Ashikhmin-Shirley BRDF for the given direction. More...
 
AI_API AtVector AiAshikhminShirleyMISSample (const void *brdf_data, float randx, float randy)
 Returns a sample direction for the Ashikhmin-Shirley BRDF given two random values. More...
 
AI_API void * AiAshikhminShirleyMISCreateData (const AtShaderGlobals *sg, const AtVector *u, const AtVector *v, float rx, float ry)
 Returns a pointer to the data required by AiEvaluateLightSample() to sample the Ashikhmin-Shirley BRDF using multiple importance sampling. More...
 
AI_API AtColor AiStretchedPhongMISBRDF (const void *brdf_data, const AtVector *indir)
 Returns the Stretched-Phong BRDF multiplied by the cosine of the angle between the incoming light direction and the surface normal. More...
 
AI_API float AiStretchedPhongMISPDF (const void *brdf_data, const AtVector *indir)
 Returns the result of the PDF used to importance sample the Stretched-Phong BRDF for the given direction. More...
 
AI_API AtVector AiStretchedPhongMISSample (const void *brdf_data, float randx, float randy)
 Returns a sample direction for the Stretched-Phong BRDF given two random values. More...
 
AI_API void * AiStretchedPhongMISCreateData (const AtShaderGlobals *sg, float pexp)
 Returns a pointer to the data required by AiEvaluateLightSample() to sample the Stretched-Phong BRDF using multiple importance sampling. More...
 

Deprecated BRDF Evaluation API

AI_API float AiOrenNayarBRDF (const AtVector *L, const AtVector *V, const AtVector *N, float r)
 Oren-Nayar diffuse BRDF. More...
 
AI_API float AiLommelSeeligerBRDF (const AtVector *L, const AtVector *V, const AtVector *N)
 Lommel-Seeliger diffuse BRDF (aka lunar dust) More...
 
AI_API float AiCookTorranceBRDF (const AtVector *L, const AtVector *V, const AtVector *N, const AtVector *u, const AtVector *v, float rx, float ry)
 Cook-Torrance microfacet BRDF. More...
 
AI_API float AiWardBRDF (const AtVector *L, const AtVector *V, const AtVector *N, const AtVector *u, const AtVector *v, float rx, float ry)
 Ward anisotropic BRDF. More...
 
AI_API float AiWardDuerBRDF (const AtVector *L, const AtVector *V, const AtVector *N, const AtVector *u, const AtVector *v, float rx, float ry)
 Improved Ward-Duer anisotropic BRDF. More...
 
AI_API float AiAshikhminShirleyBRDF (const AtVector *L, const AtVector *V, const AtVector *N, const AtVector *u, const AtVector *v, float nx, float ny)
 Ashikhmin-Shirley anisotropic specular BRDF. More...
 
AI_API float AiStretchedPhongBRDF (const AtVector *L, const AtVector *V, const AtVector *N, float n, bool retro=false)
 Stretched-Phong BRDF. More...
 

Deprecated BRDF Integration API

AI_API AtColor AiOrenNayarIntegrate (const AtVector *N, AtShaderGlobals *sg, float r)
 Returns the reflected indirect-radiance with an Oren-Nayar BRDF. More...
 
AI_API AtColor AiLommelSeeligerIntegrate (const AtVector *N, AtShaderGlobals *sg)
 Returns the reflected indirect-radiance with a Lommel-Seeliger BRDF. More...
 
AI_API AtColor AiCookTorranceIntegrate (const AtVector *N, AtShaderGlobals *sg, const AtVector *u, const AtVector *v, float rx, float ry)
 Returns the reflected indirect-radiance with a Cook-Torrance microfacet BRDF. More...
 
AI_API AtColor AiWardIntegrate (const AtVector *N, AtShaderGlobals *sg, const AtVector *u, const AtVector *v, float rx, float ry)
 Returns the reflected indirect-radiance with the Ward BRDF. More...
 
AI_API AtColor AiWardDuerIntegrate (const AtVector *N, AtShaderGlobals *sg, const AtVector *u, const AtVector *v, float rx, float ry)
 Returns the reflected indirect-radiance with an improved Ward-Duer BRDF. More...
 
AI_API AtColor AiAshikhminShirleyIntegrate (const AtVector *N, AtShaderGlobals *sg, const AtVector *u, const AtVector *v, float nx, float ny)
 Returns the reflected indirect-radiance with the Ashikhmin-Shirley BRDF. More...
 
AI_API AtColor AiMicrofacetBTDFIntegrate (const AtVector *N, AtShaderGlobals *sg, const AtVector *u, const AtVector *v, float rx, float ry, float eta_i, float eta_o, AtColor transmittance)
 Computes the refracted indirect-radiance with a microfacet BTDF. More...
 
AI_API AtColor AiStretchedPhongIntegrate (const AtVector *N, AtShaderGlobals *sg, float exp)
 Returns the reflected indirect-radiance with a stretched-Phong BRDF. More...
 

Detailed Description

Typedef Documentation

typedef AtVector(* AtBRDFEvalSampleFunc)(const void *brdf_data, float rx, float ry)

Returns a direction according to some distribution based on the reflectance of the BRDF.

typedef AtColor(* AtBRDFEvalBrdfFunc)(const void *brdf_data, const AtVector *indir)

Returns the actual reflectance from a given direction to the viewer's direction.

typedef float(* AtBRDFEvalPdfFunc)(const void *brdf_data, const AtVector *indir)

Returns the probability density for the above sample function at a certain incoming direction.

Function Documentation

AI_API AtColor AiEvaluateLightSample ( AtShaderGlobals sg,
const void *  brdf_data,
AtBRDFEvalSampleFunc  eval_sample,
AtBRDFEvalBrdfFunc  eval_brdf,
AtBRDFEvalPdfFunc  eval_pdf 
)

Returns the direct radiance reflected from a light by the provided BRDF using MIS.

This function takes a light sample from sg and a BRDF to estimate the light coming from the light source in a robust way using multiple importance sampling (MIS).

Parameters
sgShading globals
brdf_dataAn arbitrary data pointer that will be passed to the BRDF functions where you can store BRDF-specific parameters like roughness etc.
eval_sampleSampling function for this BRDF
eval_brdfBRDF evaluation function
eval_pdfProbability distribution function for the given sampling funcion (normalized)
Returns
Reflected radiance from the current light and the input BRDF.
See Also
ai_shader_brdf.h
AI_API AtColor AiBRDFIntegrate ( AtShaderGlobals sg,
const void *  brdf_data,
AtBRDFEvalSampleFunc  eval_sample,
AtBRDFEvalBrdfFunc  eval_brdf,
AtBRDFEvalPdfFunc  eval_pdf,
AtUInt16  ray_type 
)

Returns the indirect radiance reflected by the provided BRDF.

Applies the importance sampling Monte Carlo integration technique to compute an estimate of the indirect light that gets reflected by the provided BRDF in the direction sg->Rd.

The eval_pdf and eval_sample parameters are a matching pair of functions that describe a sample probability density and its corresponding quantile function, respectively. Any pair of PDF and quantile functions that sample the entire non-zero region of the BRDF should in theory converge upon the same result given enough samples, however sample distributions that are specifically tuned to the provided BRDF should have a much faster rate of convergence.

This function ignores the reflected direct radiance contribution from light sources. Direct lighting is computed separately in a sampling loop of the shader.

Note
As with the BRDFs provided in the MIS shading API, this function does not follow the strict definition of a BRDF. Instead, it expects the provided BRDF to be pre-multiplied by the cosine of the angle between the incoming light direction and the surface normal.
Parameters
sgShading globals
brdf_dataAn arbitrary data pointer that will be passed to the BRDF functions where you can store BRDF-specific parameters like roughness etc.
eval_sampleSampling function for this BRDF
eval_brdfBRDF evaluation function
eval_pdfProbability distribution function for the given sampling function (normalized)
ray_typeType of indirect sample rays this BRDF traces (AI_RAY_DIFFUSE or AI_RAY_GLOSSY)
Returns
Reflected radiance along the viewing direction sg->Rd
AI_API AtColor AiOrenNayarMISBRDF ( const void *  brdf_data,
const AtVector indir 
)

Returns the Oren-Nayar BRDF multiplied by the cosine of the angle between the incoming light direction and the surface normal.

This function is useable by AiEvaluateLightSample() to perform MIS of the built-in Oren-Nayar BRDF.

Parameters
brdf_datapointer to the data structure created by AiOrenNayarMISCreateData
indirincoming light direction
Returns
reflected radiance scaled by NdotL along the viewing direction sg->Rd
See Also
AiOrenNayarBRDF
AI_API float AiOrenNayarMISPDF ( const void *  brdf_data,
const AtVector indir 
)

Returns the result of the PDF used to importance sample the Oren-Nayar BRDF for the given direction.

This function is useable by AiEvaluateLightSample() to perform MIS of the built-in Oren-Nayar BRDF.

Parameters
brdf_datapointer to the data structure created by AiOrenNayarMISCreateData
indirincoming light direction
Returns
PDF value for the given indir
See Also
AiOrenNayarBRDF
AI_API AtVector AiOrenNayarMISSample ( const void *  brdf_data,
float  randx,
float  randy 
)

Returns a sample direction for the Oren-Nayar BRDF given two random values.

The samples are generated using importance sampling and have a probability density defined by AiOrenNayarMISPDF(). This function is useable by AiEvaluateLightSample() to perform MIS of the built-in Oren-Nayar BRDF.

Parameters
brdf_datapointer to the data structure created by AiOrenNayarMISCreateData
randxuniformly random number in the [0,1) range.
randyuniformly random number in the [0,1) range.
Returns
Direction to sample or AI_V3_ZERO if sampling is not possible with the given inputs
See Also
AiOrenNayarBRDF
AI_API void* AiOrenNayarMISCreateData ( const AtShaderGlobals sg,
float  r 
)

Returns a pointer to the data required by AiEvaluateLightSample() to sample the Oren-Nayar BRDF using multiple importance sampling.

The returned data is allocated in a pixel pool and does not need to be freed by the caller.

Parameters
sgshader globals context
rsurface roughness, normalized in the [0, 1] range
Returns
pointer to the data structure required by AiEvaluateLightSample()
See Also
AiOrenNayarBRDF
AI_API AtColor AiCookTorranceMISBRDF ( const void *  brdf_data,
const AtVector indir 
)

Returns the Cook-Torrance microfacet BRDF multiplied by the cosine of the angle between the incoming light direction and the surface normal.

This function is useable by AiEvaluateLightSample() to perform MIS of the built-in Cook-Torrance BRDF.

Parameters
brdf_datapointer to the data structure created by AiCookTorranceMISCreateData
indirincoming light direction
Returns
reflected radiance scaled by NdotL along the viewing direction sg->Rd
See Also
AiCookTorranceBRDF
AI_API float AiCookTorranceMISPDF ( const void *  brdf_data,
const AtVector indir 
)

Returns the result of the PDF used to importance sample the Cook-Torrance BRDF for the given direction.

This function is useable by AiEvaluateLightSample() to perform MIS of the built-in Cook-Torrance BRDF.

Parameters
brdf_datapointer to the data structure created by AiCookTorranceMISCreateData
indirincoming light direction
Returns
PDF value for the given indir
See Also
AiCookTorranceBRDF
AI_API AtVector AiCookTorranceMISSample ( const void *  brdf_data,
float  randx,
float  randy 
)

Returns a sample direction for the Cook-Torrance BRDF given two random values.

The samples are generated using importance sampling and have a probability density defined by AiCookTorranceMISPDF(). This function is useable by AiEvaluateLightSample() to perform MIS of the built-in Cook-Torrance BRDF.

Parameters
brdf_datapointer to the data structure created by AiCookTorranceMISCreateData
randxuniformly random number in the [0,1) range.
randyuniformly random number in the [0,1) range.
Returns
Direction to sample or AI_V3_ZERO if sampling is not possible with the given inputs
See Also
AiCookTorranceBRDF
AI_API void* AiCookTorranceMISCreateData ( const AtShaderGlobals sg,
const AtVector u,
const AtVector v,
float  rx,
float  ry 
)

Returns a pointer to the data required by AiEvaluateLightSample() to sample the Cook-Torrance BRDF using multiple importance sampling.

The returned data is allocated in a pixel pool and does not need to be freed by the caller.

Warning
The u , v and ry variables are currently not being used and will have no effect in the output of this BRDF. The current implementation is isotropic and uses rx as its roughness parameter.
Parameters
sgshader globals context
usurface tangent vector along the U coordinate
vsurface tangent vector along the V coordinate
rxspecular roughness along the U direction
ryspecular roughness along the V direction
Returns
pointer to the data structure required by AiEvaluateLightSample()
See Also
AiCookTorranceBRDF
AI_API AtColor AiWardDuerMISBRDF ( const void *  brdf_data,
const AtVector indir 
)

Returns the Ward-Duer microfacet BRDF multiplied by the cosine of the angle between the incoming light direction and the surface normal.

This function is useable by AiEvaluateLightSample() to perform MIS of the built-in Ward-Duer BRDF.

Parameters
brdf_datapointer to the data structure created by AiWardDuerMISCreateData
indirincoming light direction
Returns
reflected radiance scaled by NdotL along the viewing direction sg->Rd
See Also
AiWardDuerBRDF
AI_API float AiWardDuerMISPDF ( const void *  brdf_data,
const AtVector indir 
)

Returns the result of the PDF used to importance sample the Ward-Duer BRDF for the given direction.

This function is useable by AiEvaluateLightSample() to perform MIS of the built-in Ward-Duer BRDF.

Parameters
brdf_datapointer to the data structure created by AiWardDuerMISCreateData
indirincoming light direction
Returns
PDF value for the given indir
See Also
AiWardDuerBRDF
AI_API AtVector AiWardDuerMISSample ( const void *  brdf_data,
float  randx,
float  randy 
)

Returns a sample direction for the Ward-Duer BRDF given two random values.

The samples are generated using importance sampling and have a probability density defined by AiWardDuerMISPDF(). This function is useable by AiEvaluateLightSample() to perform MIS of the built-in Ward-Duer BRDF.

Parameters
brdf_datapointer to the data structure created by AiWardDuerMISCreateData
randxuniformly random number in the [0,1) range.
randyuniformly random number in the [0,1) range.
Returns
Direction to sample or AI_V3_ZERO if sampling is not possible with the given inputs
See Also
AiWardDuerBRDF
AI_API void* AiWardDuerMISCreateData ( const AtShaderGlobals sg,
const AtVector u,
const AtVector v,
float  rx,
float  ry 
)

Returns a pointer to the data required by AiEvaluateLightSample() to sample the Ward-Duer BRDF using multiple importance sampling.

The returned data is allocated in a pixel pool and does not need to be freed by the caller.

Parameters
sgshader globals context
usurface tangent vector along the U coordinate
vsurface tangent vector along the V coordinate
rxspecular roughness along the U direction
ryspecular roughness along the V direction
Returns
pointer to the data structure required by AiEvaluateLightSample()
See Also
AiWardDuerBRDF
AI_API AtColor AiAshikhminShirleyMISBRDF ( const void *  brdf_data,
const AtVector indir 
)

Returns the Ashikhmin-Shirley BRDF multiplied by the cosine of the angle between the incoming light direction and the surface normal.

This function is useable by AiEvaluateLightSample() to perform MIS of the built-in Ashikhmin-Shirley BRDF.

Parameters
brdf_datapointer to the data structure created by AiAshikhminShirleyMISCreateData
indirincoming light direction
Returns
reflected radiance scaled by NdotL along the viewing direction sg->Rd
See Also
AiAshikhminShirleyBRDF
AI_API float AiAshikhminShirleyMISPDF ( const void *  brdf_data,
const AtVector indir 
)

Returns the result of the PDF used to importance sample the Ashikhmin-Shirley BRDF for the given direction.

This function is useable by AiEvaluateLightSample() to perform MIS of the built-in Ashikhmin-Shirley BRDF.

Parameters
brdf_datapointer to the data structure created by AiAshikhminShirleyMISCreateData
indirincoming light direction
Returns
PDF value for the given indir
See Also
AiAshikhminShirleyBRDF
AI_API AtVector AiAshikhminShirleyMISSample ( const void *  brdf_data,
float  randx,
float  randy 
)

Returns a sample direction for the Ashikhmin-Shirley BRDF given two random values.

The samples are generated using importance sampling and have a probability density defined by AiAshikhminShirleyMISPDF(). This function is useable by AiEvaluateLightSample() to perform MIS of the built-in Ashikhmin-Shirley BRDF.

Parameters
brdf_datapointer to the data structure created by AiAshikhminShirleyMISCreateData
randxuniformly random number in the [0,1) range.
randyuniformly random number in the [0,1) range.
Returns
Direction to sample or AI_V3_ZERO if sampling is not possible with the given inputs
See Also
AiAshikhminShirleyBRDF
AI_API void* AiAshikhminShirleyMISCreateData ( const AtShaderGlobals sg,
const AtVector u,
const AtVector v,
float  nx,
float  ny 
)

Returns a pointer to the data required by AiEvaluateLightSample() to sample the Ashikhmin-Shirley BRDF using multiple importance sampling.

The returned data is allocated in a pixel pool and does not need to be freed by the caller.

Parameters
sgshader globals context
usurface tangent vector along the U coordinate
vsurface tangent vector along the V coordinate
nxspecular glossiness factor along the U coordinate
nyspecular glossiness factor along the V coordinate
Returns
pointer to the data structure required by AiEvaluateLightSample()
See Also
AiAshikhminShirleyBRDF
AI_API AtColor AiStretchedPhongMISBRDF ( const void *  brdf_data,
const AtVector indir 
)

Returns the Stretched-Phong BRDF multiplied by the cosine of the angle between the incoming light direction and the surface normal.

This function is useable by AiEvaluateLightSample() to perform MIS of the built-in Stretched-Phong BRDF.

Parameters
brdf_datapointer to the data structure created by AiStretchedPhongMISCreateData
indirincoming light direction
Returns
reflected radiance scaled by NdotL along the viewing direction sg->Rd
See Also
AiStretchedPhongBRDF
AI_API float AiStretchedPhongMISPDF ( const void *  brdf_data,
const AtVector indir 
)

Returns the result of the PDF used to importance sample the Stretched-Phong BRDF for the given direction.

This function is useable by AiEvaluateLightSample() to perform MIS of the built-in Stretched-Phong BRDF.

Parameters
brdf_datapointer to the data structure created by AiStretchedPhongMISCreateData
indirincoming light direction
Returns
PDF value for the given indir
See Also
AiStretchedPhongBRDF
AI_API AtVector AiStretchedPhongMISSample ( const void *  brdf_data,
float  randx,
float  randy 
)

Returns a sample direction for the Stretched-Phong BRDF given two random values.

The samples are generated using importance sampling and have a probability density defined by AiStretchedPhongMISPDF(). This function is useable by AiEvaluateLightSample() to perform MIS of the built-in Stretched-Phong BRDF.

Parameters
brdf_datapointer to the data structure created by AiStretchedPhongMISCreateData
randxuniformly random number in the [0,1) range.
randyuniformly random number in the [0,1) range.
Returns
Direction to sample or AI_V3_ZERO if sampling is not possible with the given inputs
See Also
AiStretchedPhongBRDF
AI_API void* AiStretchedPhongMISCreateData ( const AtShaderGlobals sg,
float  pexp 
)

Returns a pointer to the data required by AiEvaluateLightSample() to sample the Stretched-Phong BRDF using multiple importance sampling.

The returned data is allocated in a pixel pool and does not need to be freed by the caller.

Parameters
sgshader globals context
pexpPhong exponent used to control the glossiness of the BRDF
Returns
pointer to the data structure required by AiEvaluateLightSample()
See Also
AiStretchedPhongBRDF
AI_API float AiOrenNayarBRDF ( const AtVector L,
const AtVector V,
const AtVector N,
float  r 
)

Oren-Nayar diffuse BRDF.

This is the model described in: "Generalization of Lambert’s reflectance model", Oren and Nayar, SIGGRAPH 1994

This model considers rough surfaces to have a collection of microfacets with a statistical distribution of directions. The surface can be made rougher or smoother by changing the roughness parameter sigma, that controls the standard deviation (in radians) of the angle distribution of the microfacets. If sigma is zero, the surface is perfectly lambertian. Values greater than zero give the surface backscattering properties and a flatter look.

It uses essentially the same microgeometry as the Torrance-Sparrow model, but assumes that the underlying surface is diffuse, rather than specular.

See Also
http://www1.cs.columbia.edu/CAVE/publications/pdfs/Oren_SIGGRAPH94.pdf
Parameters
Ldirection towards the light
Vdirection towards the viewer
Nsurface normal
rsurface roughness (sigma), normalized in the [0, 1] range
Returns
reflectance value
AI_API float AiLommelSeeligerBRDF ( const AtVector L,
const AtVector V,
const AtVector N 
)

Lommel-Seeliger diffuse BRDF (aka lunar dust)

The Lommel-Seeliger volumetric scattering BRDF is a simple BRDF predicting scattering from a dusty surface. Dusty surfaces scatter the reflected light in all directions toward grazing angles to the surface. The BRDF is:

brdf(wi,wo) = 1 / (N.wi)+(N.wo)

The Lommel-Seeliger function is essentially a "distillation" of the Hapke function that does not contain the more complicated terms. It relies on the incidence and emergence angles alone. It ignores masking and shadowing.

The Lambert and Lommel-Seeliger functions represent end-members on a scale that ranges from an "icy-type" surface (Lambert) to a "lunar-type" surface (Lommel-Seeliger).

See Also
Parameters
Ldirection towards the light
Vdirection towards the viewer
Nsurface normal
Returns
reflectance value
AI_API float AiCookTorranceBRDF ( const AtVector L,
const AtVector V,
const AtVector N,
const AtVector u,
const AtVector v,
float  rx,
float  ry 
)

Cook-Torrance microfacet BRDF.

This is the specular BRDF described in: "Microfacet Models for Refraction through Rough Surfaces", by Walter, Marschner, Li and Torrance, Eurographics 2007. The paper presents a variation of the original Cook-Torrance BSDF extended to simulate transmission through rough surfaces, but here we only use the BRDF (reflection) part, not the full BSDF. We use the Beckmann microfacet distribution.

Note
The implementation used here DOES NOT include the Fresnel term described in the paper at all, and it is up to the caller to scale the result.
See Also
http://www.graphics.cornell.edu/~bjw/microfacetbsdf.pdf
Warning
The u , v and ry variables are currently not being used and will have no effect in the output of this BRDF. The current implementation is isotropic and uses rx as its roughness parameter.
Parameters
Ldirection towards the light
Vdirection towards the viewer
Nsurface normal
usurface tangent vector along the U coordinate
vsurface tangent vector along the V coordinate
rxsurface roughness along the U direction
rysurface roughness along the V direction
Returns
reflectance value
AI_API float AiWardBRDF ( const AtVector L,
const AtVector V,
const AtVector N,
const AtVector u,
const AtVector v,
float  rx,
float  ry 
)

Ward anisotropic BRDF.

Ward's anisotropic BRDF, as described in: "Measuring and Modeling Anisotropic Reflection", Gregory J. Ward, SIGGRAPH 1992

With corrections and improvements from: "Notes on the Ward BRDF", Bruce Walter, Cornell University Technical report PCG-05-06

Note
NULL values for u and v may be provided. However if the caller provides non-NULL vectors, it is expected that they form an orthonormal basis with N. It is also expected that all vectors be of unit length.
See Also
http://www.graphics.cornell.edu/pubs/2005/Wal05.html
Deprecated:
This BRDF suffers from severe edge darkening and is here mainly for legacy reasons; use AiWardDuerBRDF() instead.
Parameters
Ldirection towards the light
Vdirection towards the viewer
Nsurface normal
usurface tangent vector along the U coordinate
vsurface tangent vector along the V coordinate
rxsurface roughness along the U direction, in [0, 1.0]
rysurface roughness along the V direction, in [0, 1.0]
Returns
reflectance value
AI_API float AiWardDuerBRDF ( const AtVector L,
const AtVector V,
const AtVector N,
const AtVector u,
const AtVector v,
float  rx,
float  ry 
)

Improved Ward-Duer anisotropic BRDF.

Improved Ward-Duer anisotropic specular BRDF as described in: "Bounding the Albedo of the Ward Reflectance Model", D. Geisler-Moroder and A. Duer, Technical Report, University of Innsbruck, March 2010

This solves two major problems with the (Walter-corrected) Ward BRDF: the severe darkening as you move towards grazing angles, and the divergence of the albedo at highly grazing angles.

Note
NULL values for u and v may be provided. However if the caller provides non-NULL vectors, it is expected that they form an orthonormal basis with N. It is also expected that all vectors be of unit length.
See Also
http://www.uibk.ac.at/mathematik/personal/geisler-moroder/publications/dgmad_bounding_albedo_ward_brdf_tr.pdf
Parameters
Ldirection towards the light
Vdirection towards the viewer
Nsurface normal
usurface tangent vector along the U coordinate
vsurface tangent vector along the V coordinate
rxsurface roughness along the U direction, in [0, 1.0]
rysurface roughness along the V direction, in [0, 1.0]
Returns
reflectance value
AI_API float AiAshikhminShirleyBRDF ( const AtVector L,
const AtVector V,
const AtVector N,
const AtVector u,
const AtVector v,
float  nx,
float  ny 
)

Ashikhmin-Shirley anisotropic specular BRDF.

This is the specular part of the BRDF model described in: "An Anisotropic Phong BRDF Model" Michael Ashikhmin, Peter Shirley Journal of Graphics Tools, Volume 5, Issue 2, 2000

See Also
http://www.cs.utah.edu/~shirley/papers/jgtbrdf.pdf
Note
This legacy BRDF suffers from energy loss at grazing angles and lacks an off-specular peak. Consider using the microfacet-based Cook-Torrance BRDF instead.
Parameters
Ldirection towards the light
Vdirection towards the viewer
Nsurface normal
usurface tangent vector along the U coordinate
vsurface tangent vector along the V coordinate
nxspecular glossiness factor along the U coordinate
nyspecular glossiness factor along the V coordinate
Returns
reflectance value
AI_API float AiStretchedPhongBRDF ( const AtVector L,
const AtVector V,
const AtVector N,
float  n,
bool  retro 
)

Stretched-Phong BRDF.

This is the BRDF described in: "Compact Metallic Reflectance Models", by Neumann, Neumann and Szirmay-Kalos, Eurographics'99. It is a physically-plausible BRDF based on modifications of the Phong, Blinn and Ward models. It has some nice properties that make it well suited for Monte Carlo ray tracing.

See Also
http://www.iit.bme.hu/~szirmay/brdf6_link.html
Note
This legacy BRDF suffers from energy loss at grazing angles and lacks an off-specular peak. Consider using the microfacet-based Cook-Torrance BRDF instead.
Parameters
Ldirection towards the light
Vdirection towards the viewer
Nsurface normal
nPhong exponent, in [2,inf)
retrothis is a rarely-used, optional argument; if enabled, the specular lobe is retro-reflective
Returns
reflectance value
AI_API AtColor AiOrenNayarIntegrate ( const AtVector N,
AtShaderGlobals sg,
float  r 
)

Returns the reflected indirect-radiance with an Oren-Nayar BRDF.

Computes the reflected indirect-radiance integrated over the hemisphere and weighted by the Oren-Nayar BRDF. The reflected radiance originates at sg->P and goes along the sg->Rd direction.

Use this as a view-dependant alternative to Lambert-based diffuse global illumination.

Parameters
Nnormal vector that defines the hemisphere of incoming radiance
sgshader globals context where reflected radiance is coming from
rsurface roughness, normalized in the [0, 1] range
Returns
reflected radiance along the viewing direction sg->Rd
See Also
AiOrenNayarBRDF
AI_API AtColor AiLommelSeeligerIntegrate ( const AtVector N,
AtShaderGlobals sg 
)

Returns the reflected indirect-radiance with a Lommel-Seeliger BRDF.

Computes the reflected indirect-radiance integrated over the hemisphere and weighted by the Lommel-Seeliger BRDF. The reflected radiance originates at sg->P and goes along the sg->Rd direction.

Use this as a view-dependant alternative to Lambert-based diffuse global illumination.

Parameters
Nnormal vector that defines the hemisphere of incoming radiance
sgshader globals context where reflected radiance is coming from
Returns
reflected radiance along the viewing direction sg->Rd
See Also
AiLommelSeeligerBRDF
AI_API AtColor AiCookTorranceIntegrate ( const AtVector N,
AtShaderGlobals sg,
const AtVector u,
const AtVector v,
float  rx,
float  ry 
)

Returns the reflected indirect-radiance with a Cook-Torrance microfacet BRDF.

Computes the reflected indirect-radiance integrated over the hemisphere and weighted by the Cook-Torrance BRDF. The reflected radiance originates at sg->P and goes along the sg->Rd direction.

Use this for soft, blurred reflections, aka "glossy" reflection. Unlike in the older "Stretched Phong" BRDF, there is very little darkening at grazing angles, which makes this the recommended BRDF.

This function ignores the reflected direct-radiance contribution from light sources. Direct lighting is usually computed in the shader's light loop block.

See Also
http://www.graphics.cornell.edu/~bjw/microfacetbsdf.pdf
Note
The implementation used here DOES NOT include the Fresnel term described in the paper at all, and it is up to the caller to scale the result. This implementation uses the Beckmann microfacet distribution.
Warning
The u , v and ry variables are currently not being used and will have no effect in the output of this BRDF. The current implementation is isotropic and uses rx as its roughness parameter.
Parameters
Nnormal vector that defines the hemisphere of incoming radiance
sgshader globals context where reflected radiance is coming from
usurface tangent vector along the U coordinate
vsurface tangent vector along the V coordinate
rxspecular roughness along the U direction
ryspecular roughness along the V direction
Returns
reflected radiance along the viewing direction sg->Rd
See Also
AiCookTorranceBRDF
AI_API AtColor AiWardIntegrate ( const AtVector N,
AtShaderGlobals sg,
const AtVector u,
const AtVector v,
float  rx,
float  ry 
)

Returns the reflected indirect-radiance with the Ward BRDF.

Computes the reflected indirect-radiance integrated over the hemisphere and weighted by the Ward BRDF. The reflected radiance originates at sg->P and goes along the sg->Rd direction.

Use this for soft, blurred reflections, aka "glossy" reflection.

Note
NULL values for u and v may be provided. However if the caller provides non-NULL vectors, it is expected that they form an orthonormal basis with N. It is also expected that all vectors be of unit length.
Deprecated:
Use AiWardDuerIntegrate() instead.
Parameters
Nnormal vector that defines the hemisphere of incoming radiance
sgshader globals context where reflected radiance is coming from
usurface tangent vector along the U direction
vsurface tangent vector along the V direction
rxspecular roughness along the U direction, in [0,1]
ryspecular roughness along the V direction, in [0,1]
Returns
reflected radiance along the viewing direction sg->Rd
See Also
AiWardBRDF()
AI_API AtColor AiWardDuerIntegrate ( const AtVector N,
AtShaderGlobals sg,
const AtVector u,
const AtVector v,
float  rx,
float  ry 
)

Returns the reflected indirect-radiance with an improved Ward-Duer BRDF.

Computes the reflected indirect-radiance integrated over the hemisphere and weighted by the physically plausible, anisotropic Ward-Duer BRDF. The reflected radiance originates at sg->P and goes along the sg->Rd direction.

Use this for soft, blurred reflections, aka "glossy" reflection.

Note
NULL values for u and v may be provided. However if the caller provides non-NULL vectors, it is expected that they form an orthonormal basis with N. It is also expected that all vectors be of unit length.
Parameters
Nnormal vector that defines the hemisphere of incoming radiance
sgshader globals context where reflected radiance is coming from
usurface tangent vector along the U direction
vsurface tangent vector along the V direction
rxspecular roughness along the U direction, in [0,1]
ryspecular roughness along the V direction, in [0,1]
Returns
reflected radiance along the viewing direction sg->Rd
See Also
AiWardDuerBRDF()
AI_API AtColor AiAshikhminShirleyIntegrate ( const AtVector N,
AtShaderGlobals sg,
const AtVector u,
const AtVector v,
float  nx,
float  ny 
)

Returns the reflected indirect-radiance with the Ashikhmin-Shirley BRDF.

Computes the reflected indirect-radiance integrated over the hemisphere and weighted by the Ashikhmin-Shirley BRDF. The reflected radiance originates at sg->P and goes along the sg->Rd direction.

This is the BRDF described in: "An Anisotropic Phong BRDF Model" Michael Ashikhmin, Peter Shirley Journal of Graphics Tools, Volume 5, Issue 2, 2000

See Also
http://www.cs.utah.edu/~shirley/papers/jgtbrdf.pdf
Parameters
Nnormal vector that defines the hemisphere of incoming radiance
sgshader globals context where reflected radiance is coming from
usurface tangent vector along the U direction
vsurface tangent vector along the V direction
nxspecular glossiness factor along the U coordinate
nyspecular glossiness factor along the V coordinate
Returns
reflected radiance along the viewing direction sg->Rd
AI_API AtColor AiMicrofacetBTDFIntegrate ( const AtVector N,
AtShaderGlobals sg,
const AtVector u,
const AtVector v,
float  rx,
float  ry,
float  eta_i,
float  eta_o,
AtColor  transmittance 
)

Computes the refracted indirect-radiance with a microfacet BTDF.

The refracted radiance originates at sg->P and goes along the sg->Rd direction.

Use this for soft, blurred refractions, aka "glossy" refraction.

This function ignores the refracted direct-radiance contribution from light sources. Direct lighting is usually computed in the shader's light loop block.

See Also
http://www.graphics.cornell.edu/~bjw/microfacetbsdf.pdf
Note
The implementation used here DOES NOT include the Fresnel term described in the paper at all, and it is up to the caller to scale the result.
Warning
The u , v and ry variables are currently not being used and will have no effect in the output of this BTDF. The current implementation is isotropic and uses rx as its roughness parameter.
Parameters
Nnormal vector that defines the hemisphere of incoming radiance
sgshader globals context where reflected radiance is coming from
usurface tangent vector along the U coordinate
vsurface tangent vector along the V coordinate
rxspecular roughness along the U direction
ryspecular roughness along the V direction
eta_irefractive index of the volume traversed by the incident ray (eta_i >= 1)
eta_orefractive index of the volume traversed by the transmitted rays (eta_o >= 1)
transmittancetransmitted light according to Beer's law
Returns
refracted radiance along the viewing direction sg->Rd
AI_API AtColor AiStretchedPhongIntegrate ( const AtVector N,
AtShaderGlobals sg,
float  pexp 
)

Returns the reflected indirect-radiance with a stretched-Phong BRDF.

Computes the reflected indirect-radiance integrated over the hemisphere and weighted by the physically plausible stretched-Phong BRDF. The reflected radiance originates at sg->P and goes along the sg->Rd direction.

Use this for soft, blurred reflections, aka "glossy" reflection.

This function ignores the reflected direct-radiance contribution from light sources. Direct lighting is usually computed in the shader's light loop block.

Parameters
Nnormal vector that defines the hemisphere of incoming radiance
sgshader globals context where reflected radiance is coming from
pexpPhong exponent, in [2,inf)
Returns
reflected radiance along the viewing direction sg->Rd
See Also
AiStretchedPhongBRDF

© 2009-2013 Solid Angle SL · all rights reserved · www.solidangle.com