Computing Gauss-Legendre quadrature points and weights #1244
Unanswered
PolyRocketMatt
asked this question in
Q&A
Replies: 1 comment
-
A lot of stuff could be wrong here, I'm going to need a need bit more information. How are you using the points and weights? Could you provide me with a minimal reproducer, just a dummy BSDF that recreates the error is fine? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In constructing our BRDF plugin for Mitsuba 3, we are required to use a quadrature. Since Mitsuba provides methods to compute both gauss-legendre and gauss-lobatto points and weights in
include/mitsuba/core/quad.h
, this seems like the go-to method. We therefor include this file:The gauss-legendre/lobatto methods return a tuple representing the points and weights. It requires a dynamic type to store these in. Therefore, we constructed a type alias
FloatStorage
which is defined in a similar way as ininlude/mistuba/core/distr_2d.h
as follows:using FloatStorage = DynamicBuffer<Float>;
Next, in the relevant method, we compute the quadrature points and weights:
Float compute_quadrature() { ... std::pair<FloatStorage, FloatStorage> quad_result = quad::gauss_legendre<FloatStorage>(24); ... }
This properly compiles. However, the problem arises whenever we try to evaluate our BRDF (which calls the
compute_quadrature()
function). When running from python, we receive the following error:This is all the information we were able to retrieve. Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions