SSS utility functions. More...
Functions | |
AI_API void | AiBSSRDFEmpirical (const AtShaderGlobals *sg, AtRGB &direct, AtRGB &indirect, const float *mfp, const float *albedo, const AtRGB *weight, unsigned int num=1) |
Calculate direct and indirectly lit SSS using an BSSRDF model that was empirically fitted to match brute-force Monte Carlo scattering. More... | |
AI_API AI_PURE bool | AiShaderGlobalsFromSSS (const AtShaderGlobals *sg) |
SSS utility functions.
AI_API void AiBSSRDFEmpirical | ( | const AtShaderGlobals * | sg, |
AtRGB & | direct, | ||
AtRGB & | indirect, | ||
const float * | mfp, | ||
const float * | albedo, | ||
const AtRGB * | weight, | ||
unsigned int | num | ||
) |
Calculate direct and indirectly lit SSS using an BSSRDF model that was empirically fitted to match brute-force Monte Carlo scattering.
This BSSRDF accounts for both single and multiple scattering.
Note that Fresnel or other layer or mixing weights must be provided separately from the albedo in the weights array, as the albedo affects the shape of the BSSRDF profile.
BSSRDF sampling quality is controlled by the GI_sss_samples
render option.
sg | shader globals to perform the lookup at | |
[out] | direct | variable returning the directly lit part of the result |
[out] | indirect | variable returning the indirectly lit part of the result |
mfp | array of mean free path lengths (mfp = 1/sigmat' = 1/(sigmas' + sigmaa)) | |
albedo | array of diffuse reflectivities | |
weight | array of weights for mixing profiles or applying fresnel | |
num | number of elements in mfp and albedo arrays |