Fermat
Public Methods | Public Members | List of all members
MeshLight Struct Reference

Detailed description

Mesh-light class

#include <lights.h>

Inheritance diagram for MeshLight:
Light

Public Methods

FERMAT_HOST_DEVICE MeshLight (const uint32 _n_prims, const float *_prims_cdf, const float *_prims_inv_area, MeshView _mesh, const MipMapView *_textures, const uint32 _n_vpls, const float *_vpls_cdf, const VPL *_vpls, const float _norm)
 
FERMAT_HOST_DEVICE bool sample_impl (const float *Z, uint32_t *prim_id, cugar::Vector2f *uv, VertexGeometry *geom, float *pdf, Edf *edf) const
 
FERMAT_HOST_DEVICE void intersect_impl (const Ray ray, float2 *uv, float *t) const
 
FERMAT_HOST_DEVICE void map_impl (const uint32_t prim_id, const cugar::Vector2f &uv, VertexGeometry *geom, float *pdf, Edf *edf) const
 
FERMAT_HOST_DEVICE void map_impl (const uint32_t prim_id, const cugar::Vector2f &uv, const VertexGeometry &geom, float *pdf, Edf *edf) const
 
FERMAT_HOST_DEVICE bool invert_impl (const uint32_t prim_id, const cugar::Vector2f &uv, const float *in_Z, float *out_Z, float *out_pdf) const
 
FERMAT_HOST_DEVICE float inverse_pdf_impl (const uint32_t prim_id, const cugar::Vector2f &uv, const float *out_Z) const
 
FERMAT_HOST_DEVICE uint32 vpl_count () const
 
FERMAT_HOST_DEVICE VPL get_vpl (const uint32 i) const
 
FERMAT_HOST_DEVICE void map_vpl (const uint32 vpl_idx, uint32_t *prim_id, cugar::Vector2f *uv, VertexGeometry *geom, float *pdf, Edf *edf) const
 
- Public Methods inherited from Light
FERMAT_HOST_DEVICE Light (LightType _type)
 
FERMAT_HOST_DEVICE bool sample (const float *Z, uint32_t *prim_id, cugar::Vector2f *uv, VertexGeometry *geom, float *pdf, Edf *edf) const
 
FERMAT_HOST_DEVICE bool 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 intersect (const Ray ray, float2 *uv, float *t) const
 
FERMAT_HOST_DEVICE void map (const uint32_t prim_id, const cugar::Vector2f &uv, VertexGeometry *geom, float *pdf, Edf *edf) const
 
FERMAT_HOST_DEVICE void map (const uint32_t prim_id, const cugar::Vector2f &uv, const VertexGeometry &geom, float *pdf, Edf *edf) const
 

Public Members

uint32 n_prims
 
const float * prims_cdf
 
const float * prims_inv_area
 
MeshView mesh
 
const MipMapViewtextures
 
uint32 n_vpls
 
const float * vpls_cdf
 
const VPLvpls
 
float norm
 
- Public Members inherited from Light
LightType type
 

Member Function Documentation

◆ intersect_impl()

FERMAT_HOST_DEVICE void MeshLight::intersect_impl ( const Ray  ray,
float2 *  uv,
float *  t 
) const
inline

intersect the given ray with the light source

◆ inverse_pdf_impl()

FERMAT_HOST_DEVICE float MeshLight::inverse_pdf_impl ( const uint32_t  prim_id,
const cugar::Vector2f uv,
const float *  out_Z 
) const
inline

map a (prim,uv) pair to the original random numbers used to sample it

◆ invert_impl()

FERMAT_HOST_DEVICE bool MeshLight::invert_impl ( const uint32_t  prim_id,
const cugar::Vector2f uv,
const float *  in_Z,
float *  out_Z,
float *  out_pdf 
) const
inline

map a (prim,uv) pair to the original random numbers used to sample it

◆ map_impl() [1/2]

FERMAT_HOST_DEVICE void MeshLight::map_impl ( 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

◆ map_impl() [2/2]

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

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

◆ map_vpl()

FERMAT_HOST_DEVICE void MeshLight::map_vpl ( const uint32  vpl_idx,
uint32_t *  prim_id,
cugar::Vector2f uv,
VertexGeometry geom,
float *  pdf,
Edf edf 
) const
inline

map a given VPL to its surface and sampling info

◆ sample_impl()

FERMAT_HOST_DEVICE bool MeshLight::sample_impl ( 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


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