| 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 | |
| 85 | private: |
| 86 | Dual2<Vec3> map(float x, float y) const { |
nothing calls this directly
no test coverage detected