Main Page | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

ConstantEnvironment Class Reference

An environment that returns the same radiance for all directions. More...

#include <lightshaders/ConstantEnvironment.h>

Inheritance diagram for ConstantEnvironment:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 ConstantEnvironment (rgb _color)
void estimateRadiance (const HitRecord &rec, Context &context, Vector3 &w_in, double &distance, rgb &radiance) const
rgb estimateBGRadiance (const HitRecord &rec, const Vector3 &w_in, Context &context) const
bool sampleDirection (const HitRecord &rec, Context &context, Vector3 &w_in, double &pdf) const
double pdfDirection (const Vector3 &w_in, const HitRecord &rec, Context &context) const

Detailed Description

An environment that returns the same radiance for all directions.


Member Function Documentation

void ConstantEnvironment::estimateRadiance const HitRecord rec,
Context context,
Vector3 w_in,
double &  distance,
rgb radiance
const [virtual]
 

Estimate the radiance this light deposits towards a point in the scene. The light should not attempt an intersection with the scene to determine if an occlusion exists. Occlusion testing can be performed by the caller with the retured 'w_in' and 'distance'. Singular light sources, such as point lights, would only implement this function and allow the caller to test for occlusion. LightShaders intended for area lights may also implement this function as it may allow for importance sampling of luminaires based on estimated radiance.

Parameters:
[in] rec HitRecord for the point asking for a radiance estimate.
[in] context The standard rendering context.
[out] w_in The unit length vector to the light.
[out] distance Distance from the shading point to the light.
[out] radiance The radiance estimate.

Reimplemented from LightShader.

rgb ConstantEnvironment::estimateBGRadiance const HitRecord rec,
const Vector3 w_in,
Context context
const [virtual]
 

Estimate the radiance this light produces along the ray given by the input direction and the hit point in rec. This function is intended for background environments and should be called for rays that leave the scene without intersecting any geometry.

Parameters:
[in] rec HitRecord for the point being lit.
[in] w_in Unit length vector towards the light.
[in] context The standard rendering context.
Returns:
rgb value representing the incident radiance.

Reimplemented from LightShader.

bool ConstantEnvironment::sampleDirection const HitRecord rec,
Context context,
Vector3 w_in,
double &  pdf
const [virtual]
 

Attempt to generate a directional sample towards this light source.

Parameters:
[in] rec The HitRecord for the point being lit.
[in] context The standard rendering context.
[out] w_in Unit length vector pointing towards the light source.
[out] pdf The value of the pdf for this vector.
Returns:
True if a sample was generated.

Reimplemented from LightShader.

double ConstantEnvironment::pdfDirection const Vector3 w_in,
const HitRecord rec,
Context context
const [virtual]
 

Evaluate the pdf of generating the sampled direction.

Parameters:
[in] w_in Unit length vector.
[in] rec The HitRecord of the point being lit.
[in] context The standard rendering context.
Returns:
Evaluation of the pdf for the direction.

Reimplemented from LightShader.


The documentation for this class was generated from the following files:
Generated on Wed Jul 20 16:15:20 2005 for galileo by  doxygen 1.4.3