solid_angle
float solid_angle(bsdf b, int mask)
b
BSDF to sample.
mask
A bitmask indicating which types of bounces to evaluate.
See bouncemask for information on component label bitmasks.
Examples
examples
// Split BSDF into component lobesbsdf lobes[] = split_bsdf(hitF);
// Get solid angle of lobesfloat angles[];resize(angles, len(lobes));for (int i = 0; i < len(lobes); i++){ angles[i] = solid_angle(lobes[i], PBR_ALL_MASK);}
// Compute PDF from anglesfloat pdf[] = compute_pdf(angles);
// Compute CDF from PDFfloat cdf[] = compute_cdf(pdf);
// Randomly select a BSDF based on albedo distributionint id = sample_cdf(cdf, sx);
// Do something with the selected BSDF// lobes[id] ...