Fermat
Public Methods | Public Members | List of all members
cugar::BlendBsdf< TBsdf1, TBsdf2 > Struct Template Reference

Detailed description

template<typename TBsdf1, typename TBsdf2>
struct cugar::BlendBsdf< TBsdf1, TBsdf2 >

Implements a weighted blending between two BSDFs.

#include <blend.h>

Public Methods

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE BlendBsdf (const float _w1=0.5f, const float _w2=0.5f, const TBsdf1 _bsdf1=TBsdf1(), const TBsdf2 _bsdf2=TBsdf2())
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector3f f (const DifferentialGeometry &geometry, const Vector3f V, const Vector3f L) const
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector3f f_over_p (const DifferentialGeometry &geometry, const Vector3f V, const Vector3f L) const
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE void f_and_p (const DifferentialGeometry &geometry, const Vector3f V, const Vector3f L, Vector3f &f, float &p, const SphericalMeasure measure=kProjectedSolidAngle) const
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float p (const DifferentialGeometry &geometry, const Vector3f V, const Vector3f L, const SphericalMeasure measure=kProjectedSolidAngle) const
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE void sample (const Vector3f u, const DifferentialGeometry &geometry, const Vector3f V, Vector3f &L, Vector3f &g, float &p, float &p_proj) const
 
template<typename RandomGeneratorT >
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE bool invert (const DifferentialGeometry &geometry, const Vector3f V, const Vector3f L, RandomGeneratorT &random, Vector3f &z, float &p, float &p_proj) const
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE void inverse_pdf (const DifferentialGeometry &geometry, const Vector3f V, const Vector3f L, const Vector3f u, float &p, float &p_proj) const
 

Public Members

float w1
 
float w2
 
TBsdf1 bsdf1
 
TBsdf2 bsdf2
 

Constructor & Destructor Documentation

◆ BlendBsdf()

template<typename TBsdf1 , typename TBsdf2 >
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE cugar::BlendBsdf< TBsdf1, TBsdf2 >::BlendBsdf ( const float  _w1 = 0.5f,
const float  _w2 = 0.5f,
const TBsdf1  _bsdf1 = TBsdf1(),
const TBsdf2  _bsdf2 = TBsdf2() 
)
inline

constructor: this method accepts weights _w1 and _w2 for the corresponding BSDF components; the weights must be such that their sum is equal to or less than 1. If it is less, some energy will be absorbed.

Parameters
_w1the weight of the first BSDF
_w2the weight of the second BSDF

Member Function Documentation

◆ f()

template<typename TBsdf1 , typename TBsdf2 >
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector3f cugar::BlendBsdf< TBsdf1, TBsdf2 >::f ( const DifferentialGeometry geometry,
const Vector3f  V,
const Vector3f  L 
) const
inline

evaluate the BSDF f(V,L)

◆ f_and_p()

template<typename TBsdf1 , typename TBsdf2 >
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE void cugar::BlendBsdf< TBsdf1, TBsdf2 >::f_and_p ( const DifferentialGeometry geometry,
const Vector3f  V,
const Vector3f  L,
Vector3f f,
float &  p,
const SphericalMeasure  measure = kProjectedSolidAngle 
) const
inline

evaluate the BSDF and the pdf in a single call

◆ f_over_p()

template<typename TBsdf1 , typename TBsdf2 >
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector3f cugar::BlendBsdf< TBsdf1, TBsdf2 >::f_over_p ( const DifferentialGeometry geometry,
const Vector3f  V,
const Vector3f  L 
) const
inline

evaluate the BSDF/pdf ratio f(V,L)/p(V,L) wrt projected solid angle

◆ inverse_pdf()

template<typename TBsdf1 , typename TBsdf2 >
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE void cugar::BlendBsdf< TBsdf1, TBsdf2 >::inverse_pdf ( const DifferentialGeometry geometry,
const Vector3f  V,
const Vector3f  L,
const Vector3f  u,
float &  p,
float &  p_proj 
) const
inline

given V and L and u, compute the probability of sampling u by inversion of V and L

◆ invert()

template<typename TBsdf1 , typename TBsdf2 >
template<typename RandomGeneratorT >
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE bool cugar::BlendBsdf< TBsdf1, TBsdf2 >::invert ( const DifferentialGeometry geometry,
const Vector3f  V,
const Vector3f  L,
RandomGeneratorT &  random,
Vector3f z,
float &  p,
float &  p_proj 
) const
inline

given V and L, invert the sampling functions used to generate L from V

◆ p()

template<typename TBsdf1 , typename TBsdf2 >
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float cugar::BlendBsdf< TBsdf1, TBsdf2 >::p ( const DifferentialGeometry geometry,
const Vector3f  V,
const Vector3f  L,
const SphericalMeasure  measure = kProjectedSolidAngle 
) const
inline

evaluate the pdf of sampling L given V, p(L|V) = p(V,L)

◆ sample()

template<typename TBsdf1 , typename TBsdf2 >
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE void cugar::BlendBsdf< TBsdf1, TBsdf2 >::sample ( const Vector3f  u,
const DifferentialGeometry geometry,
const Vector3f  V,
Vector3f L,
Vector3f g,
float &  p,
float &  p_proj 
) const
inline

sample L given V and return both the pdf p and the value g = f/p, wrt projected solid angle


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