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

CylindricalEnvironment Class Reference

A class for Lambert Equal-Area Cylindrical environment maps. More...

#include <lightshaders/CylindricalEnvironment.h>

Inheritance diagram for CylindricalEnvironment:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 CylindricalEnvironment (const Image *image)
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
rgb value (const Vector3 &direction) const
void directionToUV (const Vector3 &direction, unsigned int &u, unsigned int &v) const
 given a direction, find the image coordinates (u,v)
Vector3 UVtoDirection (unsigned int u, unsigned int v) const
 given a pixel, find the corresponding direction

Public Attributes

EnvironmentSamplerenv_sampler
 EnvironmentSampler for looking up probabilities and generating samples.
const Imageenvironment
 The actual environment map image.
unsigned int w
 stored width and height of the image (for performance)
unsigned int h

Detailed Description

A class for Lambert Equal-Area Cylindrical environment maps.

Todo:
Remove the attempt to open a filename (take an image instead)


Member Function Documentation

void CylindricalEnvironment::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 CylindricalEnvironment::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 CylindricalEnvironment::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 CylindricalEnvironment::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:21 2005 for galileo by  doxygen 1.4.3