34 #include <cugar/basic/numbers.h> 35 #include <cugar/linalg/vector.h> 52 template <
typename Basis_type,
typename Fun_type>
54 const Basis_type basis,
58 const int32 n_samples,
61 const float w = 4.0f * M_PIf / float(n_samples);
63 for (int32 s = 0; s < n_samples; ++s)
67 uv[0] = float(s) / float(n_samples);
72 const float f = a*fun( dir ) + b;
74 for (int32 i = 0; i < Basis_type::COEFFS; ++i)
75 coeffs[i] += Basis_type::eval( i, dir ) * f * w;
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float radical_inverse(unsigned int n)
Definition: numbers.h:782
Defines various spherical mappings.
void project(const Basis_type basis, const Fun_type &fun, const float a, const float b, const int32 n_samples, float *coeffs)
Definition: project.h:53
Define a vector_view POD type and plain_view() for std::vector.
Definition: diff.h:38
CUGAR_HOST CUGAR_DEVICE Vector3f uniform_square_to_sphere(const Vector2f &uv)
Definition: mappings_inline.h:162