Clarisse 5.0 SP8 SDK  5.0.5.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
PbrSphericalFunction< DEGREE, Scalar > Class Template Reference

Represents a spherical function on the basis of tesseral spherical harmonics up to _Degree. More...

Public Types

typedef GMathVec3< Scalar > Vec3
 
typedef Scalar(* BasisFunction )(Vec3 const &)
 

Public Member Functions

 PbrSphericalFunction (PbrSphericalFunction const &other)
 
void set_zero ()
 
template<typename T >
Scalar operator() (GMathVec3< T > const &dir) const
 
template<typename T >
Scalar evaluate (GMathVec3< T > const &dir, const Scalar dist) const
 
template<int L, typename T >
Scalar eval_band (GMathVec3< T > const &dir) const
 
Scalar operator[] (unsigned int i) const
 
Scalar & operator[] (unsigned int i)
 
PbrSphericalFunction operator+ (PbrSphericalFunction const &other) const
 
PbrSphericalFunctionoperator+= (PbrSphericalFunction const &other)
 
PbrSphericalFunction operator* (Scalar const &value) const
 
PbrSphericalFunction operator*= (Scalar const &value)
 
template<class SF >
bool operator== (const SF &other) const
 

Static Public Member Functions

static constexpr int get_degree ()
 
static constexpr int get_band_count ()
 
static constexpr int get_coeff_count (int d=DEGREE)
 
template<int L>
static Scalar get_val_attenuate (const Scalar dist)
 
static BasisFunction get_basis_function (unsigned int n)
 Returns a pointer to the n-th basis function (in top-to-bottom pyramidal order).
 
template<typename T >
static PbrSphericalFunction
< DEGREE, Scalar > 
unilateral_projection (const GMathVec3< T > &n, T const a=Scalar(1.0))
 Creates a SphericalFunction representing the unilaterally projected area of a planar surface oriented by its normal n and having area a.
 
template<typename T >
static PbrSphericalFunction
< DEGREE, Scalar > 
bilateral_projection (const GMathVec3< T > &n, T const a=Scalar(1.0))
 Equivalent to unilateral_projection(n, a) + unilateral_projection(-n,a)
 

Static Public Attributes

static constexpr Scalar PI = 3.1415926535897932
 
static constexpr Scalar SQRT_PI = 1.7724538509055159
 
static constexpr Scalar SQRT_PI_OVER_THREE = 1.0233267079464885
 
static constexpr Scalar SQRT_FIVE_PI = 3.963327297606011
 
static constexpr Scalar SQRT_FIFTEEN_PI = 6.864684246478268
 
static constexpr Scalar ONE_OVER_TWO_SQRT_PI = 0.2820947917738782
 
static constexpr Scalar HALF_SQRT_THREE_OVER_PI = 0.4886025119029199
 
static constexpr Scalar HALF_SQRT_FIFTEEN_OVER_PI = 1.092548430592079
 
static constexpr Scalar FORTH_SQRT_FIVE_OVER_PI = 0.31539156525252
 
static constexpr Scalar FORTH_SQRT_FIFTEEN_OVER_PI = 0.5462742152960395
 
static constexpr Scalar FORTH_SQRT_THIRTYFIVE_OVER_TWO_PI = 0.5900435899266435
 
static constexpr Scalar HALF_SQRT_ONEHUNDREDFIVE_OVER_PI = 2.890611442640554
 
static constexpr Scalar FORTH_SQRT_ONEHUNDREDFIVE_OVER_PI = 1.445305721320277
 
static constexpr Scalar FORTH_SQRT_TWENTYONE_OVER_TWO_PI = 0.4570457994644657
 
static constexpr Scalar FORTH_SQRT_SEVEN_OVER_PI = 0.3731763325901154
 
static constexpr int N = get_coeff_count(DEGREE)
 

Friends

CoreLogStreamoperator<< (CoreLogStream &os, const PbrSphericalFunction &v)
 

Detailed Description

template<int DEGREE, typename Scalar = float>
class PbrSphericalFunction< DEGREE, Scalar >

Represents a spherical function on the basis of tesseral spherical harmonics up to _Degree.

Tesseral coefficients are stored in m_data in the following order: (0,0),(1,-1),(1,0),(1,1) etc.

Member Function Documentation

template<int DEGREE, typename Scalar = float>
template<typename T >
static PbrSphericalFunction<DEGREE, Scalar> PbrSphericalFunction< DEGREE, Scalar >::unilateral_projection ( const GMathVec3< T > &  n,
T const  a = Scalar(1.0) 
)
inlinestatic

Creates a SphericalFunction representing the unilaterally projected area of a planar surface oriented by its normal n and having area a.

Unilateral here means that the projected area in any direction in the half-space opposed to n is zero.