Fermat
Classes | Enumerations | Functions
LightsModule

Detailed Description

Classes

struct  VPL
 
struct  Light
 
struct  DiskLight
 
struct  DirectionalLight
 
struct  MeshLight
 
struct  VTL
 

Enumerations

enum  LightType {
  kPoint = 0, kDisk = 1, kRectangle = 2, kDirectional = 3,
  kMesh = 4, kVTL = 5
}
 

Functions

FERMAT_HOST_DEVICE bool Light::sample (const float *Z, uint32_t *prim_id, cugar::Vector2f *uv, VertexGeometry *geom, float *pdf, Edf *edf) const
 
FERMAT_HOST_DEVICE bool Light::sample (const cugar::Vector3f p, const float *Z, uint32_t *prim_id, cugar::Vector2f *uv, VertexGeometry *geom, float *pdf, Edf *edf) const
 
FERMAT_HOST_DEVICE void Light::intersect (const Ray ray, float2 *uv, float *t) const
 
FERMAT_HOST_DEVICE void Light::map (const uint32_t prim_id, const cugar::Vector2f &uv, VertexGeometry *geom, float *pdf, Edf *edf) const
 
FERMAT_HOST_DEVICE void Light::map (const uint32_t prim_id, const cugar::Vector2f &uv, const VertexGeometry &geom, float *pdf, Edf *edf) const
 

Function Documentation

◆ intersect()

FERMAT_HOST_DEVICE void Light::intersect ( const Ray  ray,
float2 *  uv,
float *  t 
) const
inline

intersect the given ray with the light source

Parameters
raythe input ray
uvthe output uv coordinates on the sampled primitive
tthe output ray intersection distance

◆ map() [1/2]

FERMAT_HOST_DEVICE void Light::map ( const uint32_t  prim_id,
const cugar::Vector2f uv,
VertexGeometry geom,
float *  pdf,
Edf edf 
) const
inline

map a (prim,uv) pair to a surface element

Parameters
prim_idthe input primitive index, in case the light is made of a mesh
uvthe input uv coordinates on the sampled primitive
geomthe output sample's differential geometry
pdfthe output sample's area pdf
edfthe output sample's EDF

◆ map() [2/2]

FERMAT_HOST_DEVICE void Light::map ( const uint32_t  prim_id,
const cugar::Vector2f uv,
const VertexGeometry geom,
float *  pdf,
Edf edf 
) const
inline

map a (prim,uv) pair and a (precomputed) surface element to the corresponding edf/pdf

Parameters
prim_idthe input primitive index, in case the light is made of a mesh
uvthe input uv coordinates on the sampled primitive
geomthe input sample's differential geometry
pdfthe output sample's area pdf
edfthe output sample's EDF

◆ sample() [1/2]

FERMAT_HOST_DEVICE bool Light::sample ( const float *  Z,
uint32_t *  prim_id,
cugar::Vector2f uv,
VertexGeometry geom,
float *  pdf,
Edf edf 
) const
inline

sample a point on the light source

Parameters
Zthe input random numbers
prim_idthe output primitive index, in case the light is made of a mesh
uvthe output uv coordinates on the sampled primitive
geomthe output sample's differential geometry
pdfthe output sample's area pdf
edfthe output sample's EDF
Returns
true iff the pdf is singular

◆ sample() [2/2]

FERMAT_HOST_DEVICE bool Light::sample ( const cugar::Vector3f  p,
const float *  Z,
uint32_t *  prim_id,
cugar::Vector2f uv,
VertexGeometry geom,
float *  pdf,
Edf edf 
) const
inline

sample a point on the light source given a shading point (or receiver)

Parameters
pthe input shading point
Zthe input random numbers
prim_idthe output primitive index, in case the light is made of a mesh
uvthe output uv coordinates on the sampled primitive
geomthe output sample's differential geometry
pdfthe output sample's area pdf
edfthe output sample's EDF
Returns
true iff the pdf is singular