sphereLight_t Class Reference

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

List of all members.

Public Member Functions

 sphereLight_t (const point3d_t &c, PFLOAT rad, const color_t &col, CFLOAT inte, int nsam)
 ~sphereLight_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 bool canIntersect ()
virtual bool intersect (const ray_t &ray, PFLOAT &t, color_t &col, float &ipdf)
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 &wo, 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)
virtual int nSamples () const

Static Public Member Functions

static light_tfactory (paraMap_t &params, renderEnvironment_t &render)

Protected Attributes

point3d_t center
PFLOAT radius
PFLOAT square_radius
PFLOAT square_radius_epsilon
color_t color
 includes intensity amplification! so...
int samples
unsigned int objID
float area
float invArea

Detailed Description

sphere lights are *drumroll* lights with a sphere shape. They only emit light on the outside! On the inside it is somewhat pointless, because in that case, sampling from BSDF would _always_ be at least as efficient, and in most cases much smarter, so use just geometry with emiting material... The light samples from the cone in which the light is visible, instead of directly from the sphere surface (thanks to PBRT for the hint)

Definition at line 37 of file spherelight.cc.


Constructor & Destructor Documentation

sphereLight_t::sphereLight_t ( const point3d_t c,
PFLOAT  rad,
const color_t col,
CFLOAT  inte,
int  nsam 
)

Definition at line 65 of file spherelight.cc.

sphereLight_t::~sphereLight_t (  ) 

Definition at line 75 of file spherelight.cc.


Member Function Documentation

virtual bool sphereLight_t::canIntersect (  )  [inline, virtual]

Definition at line 50 of file spherelight.cc.

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

indicate whether the light has a dirac delta distribution or not

Implements light_t.

Definition at line 46 of file spherelight.cc.

void sphereLight_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)

unfinished! use real normal, sp.N might be approximation by mesh...

Reimplemented from light_t.

Definition at line 196 of file spherelight.cc.

color_t sphereLight_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 204 of file spherelight.cc.

color_t sphereLight_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 215 of file spherelight.cc.

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

Definition at line 229 of file spherelight.cc.

virtual bool sphereLight_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 49 of file spherelight.cc.

float sphereLight_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 186 of file spherelight.cc.

bool sphereLight_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 136 of file spherelight.cc.

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

Definition at line 103 of file spherelight.cc.

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

allow for preprocessing when scene loading has finished

Reimplemented from light_t.

Definition at line 77 of file spherelight.cc.

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

Definition at line 169 of file spherelight.cc.

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

Reimplemented from light_t.

Definition at line 54 of file spherelight.cc.

color_t sphereLight_t::totalEnergy (  )  const [virtual]

total energy emmitted during whole frame

Implements light_t.

Definition at line 87 of file spherelight.cc.


Member Data Documentation

float sphereLight_t::area [protected]

Definition at line 62 of file spherelight.cc.

Definition at line 57 of file spherelight.cc.

includes intensity amplification! so...

Definition at line 59 of file spherelight.cc.

float sphereLight_t::invArea [protected]

Definition at line 62 of file spherelight.cc.

unsigned int sphereLight_t::objID [protected]

Definition at line 61 of file spherelight.cc.

PFLOAT sphereLight_t::radius [protected]

Definition at line 58 of file spherelight.cc.

int sphereLight_t::samples [protected]

Definition at line 60 of file spherelight.cc.

PFLOAT sphereLight_t::square_radius [protected]

Definition at line 58 of file spherelight.cc.

Definition at line 58 of file spherelight.cc.


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

Generated on 18 Dec 2009 for YafaRay by  doxygen 1.6.1