Fermat
Public Methods | Public Members | List of all members
cugar::GGXBsdf Struct Reference

Detailed description

Implements the GGX bsdf with the V-cavities shadow-masking model, using the importance sampling scheme described in Algorithm 3 of:

https://hal.inria.fr/hal-00996995v1/document

#include <ggx.h>

Public Methods

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE GGXBsdf (const float _roughness)
 
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 roughness
 
float inv_roughness
 

Member Function Documentation

◆ f()

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector3f cugar::GGXBsdf::f ( const DifferentialGeometry geometry,
const Vector3f  V,
const Vector3f  L 
) const
inline

evaluate the BRDF f(V,L)

NoH

◆ f_and_p()

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE void cugar::GGXBsdf::f_and_p ( const DifferentialGeometry geometry,
const Vector3f  V,
const Vector3f  L,
Vector3f f,
float &  p,
const SphericalMeasure  measure = kProjectedSolidAngle 
) const
inline

evaluate the BRDF and the pdf in a single call

NoH

◆ f_over_p()

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector3f cugar::GGXBsdf::f_over_p ( const DifferentialGeometry geometry,
const Vector3f  V,
const Vector3f  L 
) const
inline

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

◆ inverse_pdf()

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE void cugar::GGXBsdf::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 RandomGeneratorT >
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE bool cugar::GGXBsdf::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()

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float cugar::GGXBsdf::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)

NoH

◆ sample()

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE void cugar::GGXBsdf::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

NoH


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