bgPortalLight_t Class Reference

#include <bgportallight.h>

Inheritance diagram for bgPortalLight_t:
Inheritance graph
[legend]
Collaboration diagram for bgPortalLight_t:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 bgPortalLight_t (unsigned int msh, int sampl)
virtual ~bgPortalLight_t ()
virtual void init (scene_t &scene)
 allow for preprocessing when scene loading has finished
virtual color_t totalEnergy () const
 total energy emmitted during whole frame
virtual color_t emitPhoton (float s1, float s2, float s3, float s4, ray_t &ray, float &ipdf) const
 emit a photon
virtual color_t emitSample (vector3d_t &wo, lSample_t &s) const
 create a sample of light emission, similar to emitPhoton, just more suited for bidirectional methods
virtual bool diracLight () const
 indicate whether the light has a dirac delta distribution or not
virtual bool illumSample (const surfacePoint_t &sp, float s1, float s2, color_t &col, float &ipdf, ray_t &wi) const
virtual bool illumSample (const surfacePoint_t &sp, lSample_t &s, ray_t &wi) const
 illuminate a given surface point, generating sample s, fill in s.sp if not NULL; Set ray to test visibility by integrator
virtual bool illuminate (const surfacePoint_t &sp, color_t &col, ray_t &wi) const
 illuminate a given surfance point; Set ray to test visibility by integrator. Only for dirac lights.
virtual int nSamples () const
virtual bool canIntersect () const
 indicate whether the light can intersect with a ray (by the intersect function)
virtual bool intersect (const ray_t &ray, PFLOAT &t, color_t &col, float &ipdf) const
 intersect the light source with a ray, giving back distance, energy and 1/PDF
virtual float illumPdf (const surfacePoint_t &sp, const surfacePoint_t &sp_light) const
 get the pdf for sampling the incoming direction wi at surface point sp (illumSample!)
virtual void emitPdf (const surfacePoint_t &sp, const vector3d_t &wi, float &areaPdf, float &dirPdf, float &cos_wo) const
 get the pdf values for sampling point sp on the light and outgoing direction wo when emitting energy (emitSample, NOT illumSample)

Static Public Member Functions

static light_tfactory (paraMap_t &params, renderEnvironment_t &render)

Protected Member Functions

void initIS ()
void sampleSurface (point3d_t &p, vector3d_t &n, float u, float v) const

Protected Attributes

unsigned int objID
pdf1D_tareaDist
const triangle_t ** tris
int samples
int nTris
 gives the array size of uDist
float area
float invArea
triangleObject_tmesh
triKdTree_ttree
background_tbg
point3d_t worldCenter
int * stats

Detailed Description

Definition at line 36 of file bgportallight.h.


Constructor & Destructor Documentation

__BEGIN_YAFRAY bgPortalLight_t::bgPortalLight_t ( unsigned int  msh,
int  sampl 
)

Definition at line 32 of file bgportallight.cc.

bgPortalLight_t::~bgPortalLight_t (  )  [virtual]

Definition at line 39 of file bgportallight.cc.


Member Function Documentation

virtual bool bgPortalLight_t::canIntersect (  )  const [inline, virtual]

indicate whether the light can intersect with a ray (by the intersect function)

Reimplemented from light_t.

Definition at line 50 of file bgportallight.h.

virtual bool bgPortalLight_t::diracLight (  )  const [inline, virtual]

indicate whether the light has a dirac delta distribution or not

Implements light_t.

Definition at line 45 of file bgportallight.h.

void bgPortalLight_t::emitPdf ( const surfacePoint_t sp,
const vector3d_t wo,
float &  areaPdf,
float &  dirPdf,
float &  cos_wo 
) const [virtual]

get the pdf values for sampling point sp on the light and outgoing direction wo when emitting energy (emitSample, NOT illumSample)

Reimplemented from light_t.

Definition at line 232 of file bgportallight.cc.

color_t bgPortalLight_t::emitPhoton ( float  s1,
float  s2,
float  s3,
float  s4,
ray_t ray,
float &  ipdf 
) const [virtual]

emit a photon

Implements light_t.

Definition at line 175 of file bgportallight.cc.

color_t bgPortalLight_t::emitSample ( vector3d_t wo,
lSample_t s 
) const [virtual]

create a sample of light emission, similar to emitPhoton, just more suited for bidirectional methods

fill in s.dirPdf, s.areaPdf, s.col and s.flags, and s.sp if not NULL

Reimplemented from light_t.

Definition at line 187 of file bgportallight.cc.

light_t * bgPortalLight_t::factory ( paraMap_t params,
renderEnvironment_t render 
) [static]

Definition at line 241 of file bgportallight.cc.

virtual bool bgPortalLight_t::illuminate ( const surfacePoint_t sp,
color_t col,
ray_t wi 
) const [inline, virtual]

illuminate a given surfance point; Set ray to test visibility by integrator. Only for dirac lights.

Implements light_t.

Definition at line 48 of file bgportallight.h.

float bgPortalLight_t::illumPdf ( const surfacePoint_t sp,
const surfacePoint_t sp_light 
) const [virtual]

get the pdf for sampling the incoming direction wi at surface point sp (illumSample!)

this method requires an intersection point with the light (sp_light). Otherwise, use intersect()

Reimplemented from light_t.

Definition at line 224 of file bgportallight.cc.

bool bgPortalLight_t::illumSample ( const surfacePoint_t sp,
lSample_t s,
ray_t wi 
) const [virtual]

illuminate a given surface point, generating sample s, fill in s.sp if not NULL; Set ray to test visibility by integrator

fill in s.pdf, s.col and s.flags

Implements light_t.

Definition at line 143 of file bgportallight.cc.

bool bgPortalLight_t::illumSample ( const surfacePoint_t sp,
float  s1,
float  s2,
color_t col,
float &  ipdf,
ray_t wi 
) const [virtual]

Definition at line 116 of file bgportallight.cc.

void bgPortalLight_t::init ( scene_t scene  )  [virtual]

allow for preprocessing when scene loading has finished

Reimplemented from light_t.

Definition at line 68 of file bgportallight.cc.

void bgPortalLight_t::initIS (  )  [protected]

Definition at line 47 of file bgportallight.cc.

bool bgPortalLight_t::intersect ( const ray_t ray,
PFLOAT &  t,
color_t col,
float &  ipdf 
) const [virtual]

intersect the light source with a ray, giving back distance, energy and 1/PDF

Reimplemented from light_t.

Definition at line 203 of file bgportallight.cc.

virtual int bgPortalLight_t::nSamples (  )  const [inline, virtual]

Reimplemented from light_t.

Definition at line 49 of file bgportallight.h.

void bgPortalLight_t::sampleSurface ( point3d_t p,
vector3d_t n,
float  u,
float  v 
) const [protected]

Definition at line 81 of file bgportallight.cc.

color_t bgPortalLight_t::totalEnergy (  )  const [virtual]

total energy emmitted during whole frame

Implements light_t.

Definition at line 97 of file bgportallight.cc.


Member Data Documentation

float bgPortalLight_t::area [protected]

Definition at line 64 of file bgportallight.h.

Definition at line 60 of file bgportallight.h.

Definition at line 67 of file bgportallight.h.

float bgPortalLight_t::invArea [protected]

Definition at line 64 of file bgportallight.h.

Definition at line 65 of file bgportallight.h.

int bgPortalLight_t::nTris [protected]

gives the array size of uDist

Definition at line 63 of file bgportallight.h.

unsigned int bgPortalLight_t::objID [protected]

Definition at line 59 of file bgportallight.h.

int bgPortalLight_t::samples [protected]

Definition at line 62 of file bgportallight.h.

int* bgPortalLight_t::stats [protected]

Definition at line 70 of file bgportallight.h.

Definition at line 66 of file bgportallight.h.

const triangle_t** bgPortalLight_t::tris [protected]

Definition at line 61 of file bgportallight.h.

Definition at line 68 of file bgportallight.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 18 Dec 2009 for YafaRay by  doxygen 1.6.1