Fermat
Static Public Methods | Static Public Members | List of all members
cugar::SH_basis< L > Struct Template Reference

Detailed description

template<int32 L>
struct cugar::SH_basis< L >

Spherical harmonics basis functions of order L

#include <sh.h>

Static Public Methods

template<typename Vector3 >
static CUGAR_HOST_DEVICE float eval (const int32 i, const Vector3 &d)
 
static CUGAR_HOST_DEVICE void clamped_cosine (const Vector3f &normal, const float w, float *coeffs)
 
static CUGAR_HOST_DEVICE void constant (float k, float *coeffs)
 
static CUGAR_HOST_DEVICE float integral (const float *coeffs)
 
template<typename Vector_type >
static CUGAR_HOST_DEVICE float integral (const Vector_type &coeffs)
 
static CUGAR_HOST_DEVICE void solve (float *coeffs)
 

Static Public Members

static const int32 ORDER = L
 
static const int32 COEFFS = L*L
 

Member Function Documentation

◆ clamped_cosine()

template<int32 L>
CUGAR_HOST_DEVICE void cugar::SH_basis< L >::clamped_cosine ( const Vector3f normal,
const float  w,
float *  coeffs 
)
static

add a weighted basis expansion of a clamped cosine lobe to a given set of coefficients

Parameters
normalinput normal
wscalar weight
coeffsinput/output coefficients

◆ constant()

template<int32 L>
CUGAR_HOST_DEVICE void cugar::SH_basis< L >::constant ( float  k,
float *  coeffs 
)
static

return the basis expansion of a constant

Parameters
kinput constant
coeffsoutput coefficients

◆ eval()

template<int32 L>
template<typename Vector3 >
CUGAR_HOST_DEVICE float cugar::SH_basis< L >::eval ( const int32  i,
const Vector3 &  d 
)
static

evaluate the i-th coefficient at a given point

Parameters
icoefficient index
ddirection vector

◆ integral() [1/2]

template<int32 L>
static CUGAR_HOST_DEVICE float cugar::SH_basis< L >::integral ( const float *  coeffs)
inlinestatic

return the integral of a spherical hamonics function

◆ integral() [2/2]

template<int32 L>
template<typename Vector_type >
static CUGAR_HOST_DEVICE float cugar::SH_basis< L >::integral ( const Vector_type &  coeffs)
inlinestatic

return the integral of a spherical hamonics function

◆ solve()

template<int32 L>
static CUGAR_HOST_DEVICE void cugar::SH_basis< L >::solve ( float *  coeffs)
inlinestatic

solve the linear least squares projection for a set of coefficients

Parameters
coeffsinput projection coefficients

The documentation for this struct was generated from the following files: