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

Scene Class Reference

A Scene class holds all information necesssary to render an image. More...

#include <core/Scene.h>

List of all members.

Public Member Functions

void preProcess (const Context &context)
void clear ()
rgb radiance (Context &context)
void sampleAreaLights (Vector3 &w_in, double &pdf, const HitRecord &rec, Context &context)
bool sampleSingularLights (const HitRecord &rec, Context &context, Vector3 &w_in, double &distance, rgb &radiance)
bool unoccluded (const Vector3 &w_in, double dist, const HitRecord &rec, Context &context)
double lightPdf (const Vector3 &w_in, const HitRecord &rec, Context &context) const

Public Attributes

Surfacesurfaces
 The scene geometry.
LightShaderbackground
 The background.
DynArray< Surface * > area_lights
 The list of area lights.
DynArray< LightShader * > lights
 The list of singular lights.


Detailed Description

A Scene class holds all information necesssary to render an image.

The Scene class holds information such as scene geometry, the area light list, the singular light list and the shader for the background illumination. Member functions are provided to interact with this information.


Member Function Documentation

void Scene::preProcess const Context context  ) 
 

Perform any preprocessing necessary.

Parameters:
[in] context Contains all rendering options.

void Scene::clear  ) 
 

Free all scene data.

rgb Scene::radiance Context context  ) 
 

Calculate incident radiance in direction context.ray.direction()

Parameters:
[in,out] context Contains rendering info, random seeds, etc.
Returns:
Incident radiance in direction context.ray.direction()

void Scene::sampleAreaLights Vector3 w_in,
double &  pdf,
const HitRecord rec,
Context context
 

Sample direct lighting by sampling a single light from area_lights.

Parameters:
[out] w_in Direction to the light from point being shaded.
[out] pdf The evaluation of the light sampling pdf.
[in] rec HitRecord describing the point to be shaded.
[in] context Rendering Context containing random seeds.
Returns:
A directional sample will be generated with probability pdf.

bool Scene::sampleSingularLights const HitRecord rec,
Context context,
Vector3 w_in,
double &  distance,
rgb radiance
 

Sample the singular light sources and return the scaled intensity.

Parameters:
[in] rec HitRecord describing the point to be shaded.
[in] context Rendering Context holding random seeds.
[out] w_in The directional sample.
[out] distance The distance to the singular light source.
[out] radiance The scaled radiance value.
Returns:
True if a light was sampled.

bool Scene::unoccluded const Vector3 w_in,
double  dist,
const HitRecord rec,
Context context
 

Test if the point is occluded in a given direction within the given distance.

Parameters:
[in] w_in Unit length vector in direction of light.
[in] dist Distance to light.
[in] rec HitRecord for point being shaded.
[in] context Contains all rendering options and random seeds.
Returns:
True if there is nothing blocking the path.

double Scene::lightPdf const Vector3 w_in,
const HitRecord rec,
Context context
const
 

Evaluate the pdf of the given direction from rec.p over all area lights.

Parameters:
[in] w_in The direction to the light from the point being shaded.
[in] rec HitRecord for the point being shaded.
[in] context Rendering Context containing random seeds.
Returns:
Evaluation of the light sampling pdf for the input direction.


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