MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/OpenShadingLanguage / sample

Function sample

src/testrender/background.h:75–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73 }
74
75 Vec3 sample(float rx, float ry, Dual2<Vec3>& dir, float& pdf) const {
76 float row_pdf, col_pdf;
77 unsigned x, y;
78 ry = sample_cdf(rows, res, ry, &y, &row_pdf);
79 rx = sample_cdf(cols + y * res, res, rx, &x, &col_pdf);
80 dir = map(x + rx, y + ry);
81 pdf = row_pdf * col_pdf * invjacobian;
82 return values[y * res + x];
83 }
84
85private:
86 Dual2<Vec3> map(float x, float y) const {

Callers

nothing calls this directly

Calls 1

sample_cdfFunction · 0.85

Tested by

no test coverage detected