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... | |
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.
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.
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).
sg | Shading globals |
brdf_data | An arbitrary data pointer that will be passed to the BRDF functions where you can store BRDF-specific parameters like roughness etc. |
eval_sample | Sampling function for this BRDF |
eval_brdf | BRDF evaluation function |
eval_pdf | Probability distribution function for the given sampling funcion (normalized) |
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.
sg | Shading globals |
brdf_data | An arbitrary data pointer that will be passed to the BRDF functions where you can store BRDF-specific parameters like roughness etc. |
eval_sample | Sampling function for this BRDF |
eval_brdf | BRDF evaluation function |
eval_pdf | Probability distribution function for the given sampling function (normalized) |
ray_type | Type of indirect sample rays this BRDF traces (AI_RAY_DIFFUSE or AI_RAY_GLOSSY) |
sg->Rd
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.
brdf_data | pointer to the data structure created by AiOrenNayarMISCreateData |
indir | incoming light direction |
sg->Rd
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.
brdf_data | pointer to the data structure created by AiOrenNayarMISCreateData |
indir | incoming light direction |
indir
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.
brdf_data | pointer to the data structure created by AiOrenNayarMISCreateData |
randx | uniformly random number in the [0,1) range. |
randy | uniformly random number in the [0,1) range. |
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.
sg | shader globals context |
r | surface roughness, normalized in the [0, 1] range |
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.
brdf_data | pointer to the data structure created by AiCookTorranceMISCreateData |
indir | incoming light direction |
sg->Rd
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.
brdf_data | pointer to the data structure created by AiCookTorranceMISCreateData |
indir | incoming light direction |
indir
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.
brdf_data | pointer to the data structure created by AiCookTorranceMISCreateData |
randx | uniformly random number in the [0,1) range. |
randy | uniformly random number in the [0,1) range. |
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.
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.sg | shader globals context |
u | surface tangent vector along the U coordinate |
v | surface tangent vector along the V coordinate |
rx | specular roughness along the U direction |
ry | specular roughness along the V direction |
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.
brdf_data | pointer to the data structure created by AiWardDuerMISCreateData |
indir | incoming light direction |
sg->Rd
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.
brdf_data | pointer to the data structure created by AiWardDuerMISCreateData |
indir | incoming light direction |
indir
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.
brdf_data | pointer to the data structure created by AiWardDuerMISCreateData |
randx | uniformly random number in the [0,1) range. |
randy | uniformly random number in the [0,1) range. |
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.
sg | shader globals context |
u | surface tangent vector along the U coordinate |
v | surface tangent vector along the V coordinate |
rx | specular roughness along the U direction |
ry | specular roughness along the V direction |
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.
brdf_data | pointer to the data structure created by AiAshikhminShirleyMISCreateData |
indir | incoming light direction |
sg->Rd
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.
brdf_data | pointer to the data structure created by AiAshikhminShirleyMISCreateData |
indir | incoming light direction |
indir
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.
brdf_data | pointer to the data structure created by AiAshikhminShirleyMISCreateData |
randx | uniformly random number in the [0,1) range. |
randy | uniformly random number in the [0,1) range. |
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.
sg | shader globals context |
u | surface tangent vector along the U coordinate |
v | surface tangent vector along the V coordinate |
nx | specular glossiness factor along the U coordinate |
ny | specular glossiness factor along the V coordinate |
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.
brdf_data | pointer to the data structure created by AiStretchedPhongMISCreateData |
indir | incoming light direction |
sg->Rd
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.
brdf_data | pointer to the data structure created by AiStretchedPhongMISCreateData |
indir | incoming light direction |
indir
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.
brdf_data | pointer to the data structure created by AiStretchedPhongMISCreateData |
randx | uniformly random number in the [0,1) range. |
randy | uniformly random number in the [0,1) range. |
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.
sg | shader globals context |
pexp | Phong exponent used to control the glossiness of the BRDF |
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.
L | direction towards the light |
V | direction towards the viewer |
N | surface normal |
r | surface roughness (sigma), normalized in the [0, 1] range |
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).
L | direction towards the light |
V | direction towards the viewer |
N | surface normal |
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.
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.L | direction towards the light |
V | direction towards the viewer |
N | surface normal |
u | surface tangent vector along the U coordinate |
v | surface tangent vector along the V coordinate |
rx | surface roughness along the U direction |
ry | surface roughness along the V direction |
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
L | direction towards the light |
V | direction towards the viewer |
N | surface normal |
u | surface tangent vector along the U coordinate |
v | surface tangent vector along the V coordinate |
rx | surface roughness along the U direction, in [0, 1.0] |
ry | surface roughness along the V direction, in [0, 1.0] |
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.
L | direction towards the light |
V | direction towards the viewer |
N | surface normal |
u | surface tangent vector along the U coordinate |
v | surface tangent vector along the V coordinate |
rx | surface roughness along the U direction, in [0, 1.0] |
ry | surface roughness along the V direction, in [0, 1.0] |
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
L | direction towards the light |
V | direction towards the viewer |
N | surface normal |
u | surface tangent vector along the U coordinate |
v | surface tangent vector along the V coordinate |
nx | specular glossiness factor along the U coordinate |
ny | specular glossiness factor along the V coordinate |
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.
L | direction towards the light |
V | direction towards the viewer |
N | surface normal |
n | Phong exponent, in [2,inf) |
retro | this is a rarely-used, optional argument; if enabled, the specular lobe is retro-reflective |
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.
N | normal vector that defines the hemisphere of incoming radiance |
sg | shader globals context where reflected radiance is coming from |
r | surface roughness, normalized in the [0, 1] range |
sg->Rd
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.
N | normal vector that defines the hemisphere of incoming radiance |
sg | shader globals context where reflected radiance is coming from |
sg->Rd
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.
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.N | normal vector that defines the hemisphere of incoming radiance |
sg | shader globals context where reflected radiance is coming from |
u | surface tangent vector along the U coordinate |
v | surface tangent vector along the V coordinate |
rx | specular roughness along the U direction |
ry | specular roughness along the V direction |
sg->Rd
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.
N | normal vector that defines the hemisphere of incoming radiance |
sg | shader globals context where reflected radiance is coming from |
u | surface tangent vector along the U direction |
v | surface tangent vector along the V direction |
rx | specular roughness along the U direction, in [0,1] |
ry | specular roughness along the V direction, in [0,1] |
sg->Rd
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.
N | normal vector that defines the hemisphere of incoming radiance |
sg | shader globals context where reflected radiance is coming from |
u | surface tangent vector along the U direction |
v | surface tangent vector along the V direction |
rx | specular roughness along the U direction, in [0,1] |
ry | specular roughness along the V direction, in [0,1] |
sg->Rd
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
N | normal vector that defines the hemisphere of incoming radiance |
sg | shader globals context where reflected radiance is coming from |
u | surface tangent vector along the U direction |
v | surface tangent vector along the V direction |
nx | specular glossiness factor along the U coordinate |
ny | specular glossiness factor along the V coordinate |
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.
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.N | normal vector that defines the hemisphere of incoming radiance |
sg | shader globals context where reflected radiance is coming from |
u | surface tangent vector along the U coordinate |
v | surface tangent vector along the V coordinate |
rx | specular roughness along the U direction |
ry | specular roughness along the V direction |
eta_i | refractive index of the volume traversed by the incident ray (eta_i >= 1) |
eta_o | refractive index of the volume traversed by the transmitted rays (eta_o >= 1) |
transmittance | transmitted light according to Beer's law |
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.
N | normal vector that defines the hemisphere of incoming radiance |
sg | shader globals context where reflected radiance is coming from |
pexp | Phong exponent, in [2,inf) |
sg->Rd