Fermat
Public Types | Public Methods | Static Public Methods | Public Members | List of all members
cugar::GGXSmithBsdf Struct Reference

Detailed description

Implements the GGX bsdf with the Smith height-correlated shadow-masking model, as described in:

https://hal.archives-ouvertes.fr/hal-01509746/document

#include <ggx_smith.h>

Public Types

typedef GGXSmithMicrofacetDistribution distribution_type
 

Public Methods

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE GGXSmithBsdf (const float _roughness, bool _transmission=false, float _int_ior=1.0f, float _ext_ior=1.0f)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE bool is_transmissive () const
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE bool is_reflective () const
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float get_eta (const float NoV) const
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE GGXSmithMicrofacetDistribution distribution () const
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float get_inv_eta (const float NoV) const
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float PredividedSmithJointApprox (const float NoV, const float NoL) const
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float PredividedSmithJoint (const float NoV, const float NoL) const
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float PredividedSmithG1V (const float NoV, const float NoL) const
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float SmithJoint (const float NoV, const float NoL) const
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float SmithG1 (const float NoV) const
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float dwo_dh_transmission_factor (const float VoH, const float LoH, const float eta, const float inv_eta) const
 
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 DifferentialGeometry &geometry, const Vector3f H, const Vector3f V, Vector3f &L, Vector3f &g, float &p, float &p_proj) 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
 

Static Public Methods

CUGAR_FORCEINLINE static CUGAR_HOST_DEVICE float clamp_inf (const float p)
 

Public Members

float roughness
 
float inv_roughness
 
float int_ior
 
float ext_ior
 

Constructor & Destructor Documentation

◆ GGXSmithBsdf()

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE cugar::GGXSmithBsdf::GGXSmithBsdf ( const float  _roughness,
bool  _transmission = false,
float  _int_ior = 1.0f,
float  _ext_ior = 1.0f 
)
inline

Constructor

Parameters
_roughnessthe surface roughness
_transmissionwhether this is a transmissive or reflective BSDF
_int_iorthe "interior" ior, on the opposite side of the surface normal
_ext_iorthe "exterior" ior, on the same side of the surface normal

Member Function Documentation

◆ distribution()

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE GGXSmithMicrofacetDistribution cugar::GGXSmithBsdf::distribution ( ) const
inline

return the microfacet distribution

◆ f()

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

evaluate the BRDF f(V,L)

◆ f_and_p()

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

◆ f_over_p()

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector3f cugar::GGXSmithBsdf::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

◆ get_eta()

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float cugar::GGXSmithBsdf::get_eta ( const float  NoV) const
inline

fetch the exterior/interior IOR ratio

◆ get_inv_eta()

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float cugar::GGXSmithBsdf::get_inv_eta ( const float  NoV) const
inline

fetch the interior/exterior IOR ratio

◆ inverse_pdf()

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

◆ PredividedSmithG1V()

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float cugar::GGXSmithBsdf::PredividedSmithG1V ( const float  NoV,
const float  NoL 
) const
inline

roughness

◆ PredividedSmithJoint()

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float cugar::GGXSmithBsdf::PredividedSmithJoint ( const float  NoV,
const float  NoL 
) const
inline

roughness

◆ PredividedSmithJointApprox()

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float cugar::GGXSmithBsdf::PredividedSmithJointApprox ( const float  NoV,
const float  NoL 
) const
inline

roughness

◆ sample() [1/2]

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE void cugar::GGXSmithBsdf::sample ( const DifferentialGeometry geometry,
const Vector3f  H,
const Vector3f  V,
Vector3f L,
Vector3f g,
float &  p,
float &  p_proj 
) const
inline

sample L given V and H, and return both the pdf p and the value g = f/p

◆ sample() [2/2]

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

◆ SmithG1()

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float cugar::GGXSmithBsdf::SmithG1 ( const float  NoV) const
inline

roughness


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