Fermat
Classes | Public Methods | Static Public Methods | Public Members | List of all members
cugar::LTCBsdf Struct Reference

Detailed description

Implements the a bsdf based on a single Linearly Transformed Cosine (LTC). LTC can be used to approximate many isotropic BSDF types.

see:

Real-Time Polygonal-Light Shading with Linearly Transformed Cosines, Eric Heitz, Jonathan Dupuy, Stephen Hill and David Neubelt

#include <ltc.h>

Classes

struct  LTC
 

Public Methods

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE LTCBsdf (const float _roughness, const float4 *_tabM, const float4 *_tabMinv, const float *_tabA, const uint32 _size)
 
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
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE LTC get_ltc (const DifferentialGeometry &geometry, const Vector3f V) const
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float hemispherical_sector_integral (const DifferentialGeometry &geometry, const Vector3f V, const float2 theta, const float2 phi) const
 

Static Public Methods

static void preprocess (const uint32 size, const Matrix3x3f *tabM, float4 *tab, float4 *tab_inv)
 

Public Members

float roughness
 
const float4 * tabM
 
const float4 * tabMinv
 
const float * tabA
 
uint32 size
 

Member Function Documentation

◆ f()

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector3f cugar::LTCBsdf::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::LTCBsdf::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::LTCBsdf::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_ltc()

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE LTC cugar::LTCBsdf::get_ltc ( const DifferentialGeometry geometry,
const Vector3f  V 
) const
inline

get the LTC for a given view vector

◆ hemispherical_sector_integral()

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float cugar::LTCBsdf::hemispherical_sector_integral ( const DifferentialGeometry geometry,
const Vector3f  V,
const float2  theta,
const float2  phi 
) const
inline

return the integral of the LTC within a sector of the local hemisphere defined by the geometry frame (T,B,N)

◆ inverse_pdf()

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

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


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