Fermat
|
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 |
|
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.
_w1 | the weight of the first BSDF |
_w2 | the weight of the second BSDF |
|
inline |
evaluate the BSDF f(V,L)
|
inline |
evaluate the BSDF and the pdf in a single call
|
inline |
evaluate the BSDF/pdf ratio f(V,L)/p(V,L) wrt projected solid angle
|
inline |
given V and L and u, compute the probability of sampling u by inversion of V and L
|
inline |
given V and L, invert the sampling functions used to generate L from V
|
inline |
evaluate the pdf of sampling L given V, p(L|V) = p(V,L)
|
inline |
sample L given V and return both the pdf p and the value g = f/p, wrt projected solid angle