PhotonMapShader Class Reference

#include <PhotonMapShader.h>

Inheritance diagram for PhotonMapShader:

RTShader GlobalShader Shader GRAObject List of all members.

Public Types

enum  Mapping { SCENE_MAPS, MAPS_PER_SHAPE }

Public Member Functions

 PhotonMapShader (PhotonTracing *m, Caustics *c, PhotonMapping *n, DiffuseBRDF *db, SpecularBRDF *sb, unsigned p, Mapping mapping, bool u)
virtual void setScene (Scene *o)
virtual void distributeEnergy (void)
virtual bool setRenderedShape (SceneGraphObject *pShape, const Matrix4 *pTrMat)
virtual Color3f * illuminatePoint (const Vector3 &location, const Vector3 &normal, const Vector3 &eyeDir, float eyeDist, double *pNV, const Matrix4 *pTrMat)

Protected Member Functions

void _create_scene_maps (List< PhotonMapEnergy > &, List< SceneGraphObject > &)
void _create_maps_per_shape (List< PhotonMapEnergy > &, List< SceneGraphObject > &)
PointEnv * _emit_global_photon (const Vector3 &, const Vector3 &)
PointEnv * _emit_caustic_photon (const Vector3 &, const Vector3 &)

Protected Attributes

PhotonTracing_pPhotonTracing
Caustics_pCausticsEmittion
LightArray * _pLights
unsigned _photonsPerLight
Mapping _mapping
bool _userDefinedBehaviour
ReflectionModel_pReflectionModel
SceneGraphObject * _pShape
Scene_pScene
DiffuseBRDF * _pDefaultDiffBRDF
SpecularBRDF * _pDefaultSpecBRDF

Detailed Description

Shader for photon mapping.

Definition at line 21 of file PhotonMapShader.h.


Member Enumeration Documentation

enum Mapping
 

Enumerator:
SCENE_MAPS  single global and caustics map for entire scene
MAPS_PER_SHAPE  global and caustics maps per each shape

Definition at line 23 of file PhotonMapShader.h.


Constructor & Destructor Documentation

PhotonMapShader PhotonTracing m,
Caustics c,
PhotonMapping n,
DiffuseBRDF *  db,
SpecularBRDF *  sb,
unsigned  p,
Mapping  mapping,
bool  u
[inline]
 

Constructor.

Parameters:
m reflection model for photons emmition (first stage)
c reflection model for caustics (first stage)
n reflection model for final photon mapping (second stage)
db default diffuse BRDF
sb default specular BRDF
p num. photons emiited per light
mapping strategy of the creation fo photon maps
u wheter to use user-predefined photon map behaviour

Definition at line 57 of file PhotonMapShader.h.


Member Function Documentation

void _create_maps_per_shape List< PhotonMapEnergy > &  ,
List< SceneGraphObject > & 
[protected]
 

Definition at line 69 of file PhotonMapShader.cc.

References Shader::_pScene, PhotonMapShader::_userDefinedBehaviour, and Scene::root().

Referenced by PhotonMapShader::distributeEnergy().

void _create_scene_maps List< PhotonMapEnergy > &  ,
List< SceneGraphObject > & 
[protected]
 

Definition at line 8 of file PhotonMapShader.cc.

References Shader::_pScene, PhotonMapShader::_userDefinedBehaviour, and Scene::root().

Referenced by PhotonMapShader::distributeEnergy().

PointEnv * _emit_caustic_photon const Vector3 &  ,
const Vector3 & 
[protected]
 

Definition at line 157 of file PhotonMapShader.cc.

References Shader::_pScene, and Scene::root().

PointEnv * _emit_global_photon const Vector3 &  ,
const Vector3 & 
[protected]
 

Definition at line 125 of file PhotonMapShader.cc.

References Shader::_pScene, and Scene::root().

Referenced by PhotonMapShader::distributeEnergy().

void distributeEnergy void   )  [virtual]
 

View-independent global energy distribution in the whole scene (first stage of the global illumination process)

Reimplemented from RTShader.

Definition at line 190 of file PhotonMapShader.cc.

References PhotonMapShader::_create_maps_per_shape(), PhotonMapShader::_create_scene_maps(), PhotonMapShader::_emit_global_photon(), PhotonMapShader::_mapping, PhotonMapShader::_pCausticsEmittion, Shader::_pDefaultDiffBRDF, Shader::_pDefaultSpecBRDF, PhotonMapShader::_photonsPerLight, PhotonMapShader::_pLights, PhotonMapShader::_pPhotonTracing, Shader::_pScene, PhotonTracing::illuminatePoint(), PhotonMapShader::MAPS_PER_SHAPE, Scene::root(), PhotonMapShader::SCENE_MAPS, RayTracing::setDiffuseBRDF(), RayTracing::setScene(), and RayTracing::setSpecularBRDF().

Color3f * illuminatePoint const Vector3 &  location,
const Vector3 &  normal,
const Vector3 &  eyeDir,
float  eyeDist,
double *  pNV,
const Matrix4 *  pTrMat
[virtual, inherited]
 

View-restricted illumination of individual points on surface (second stage of the global illumination process). Two combinations of parametters are possible: 1) Vectors are not transformed and the transformation matrix is identical to the matrix of the setRenderedShape() function. 2) Vectors are already transformed and the matrix is NULL.

Parameters:
location point's location on surface (space coords.)
normal normalized normal vector
eyeDir normalized direction from towards viewer
eyeDist distance to viewer
pNV cross-product of normal and eyeDir, or NULL
pTrMat transformation matrix or NULL
Returns:
final color of the point on success, NULL otherwise

Implements Shader.

Definition at line 5 of file RTShader.cc.

References Shader::_pReflectionModel, Shader::_pShape, and ReflectionModel::illuminatePoint().

virtual bool setRenderedShape SceneGraphObject *  pShape,
const Matrix4 *  pTrMat
[inline, virtual]
 

Sets the shape of interest used for per-surface point illumination, see illuminatePoint().

Parameters:
pShape shape of interest
pTrMat transformation matrix of the shape

Reimplemented from Shader.

Definition at line 97 of file PhotonMapShader.h.

References Shader::setRenderedShape().

virtual void setScene Scene o  )  [inline, virtual]
 

Sets the scene for energy distribution, see distributeEnergy().

Parameters:
o scene

Reimplemented from Shader.

Definition at line 78 of file PhotonMapShader.h.

References Shader::setScene().


Member Data Documentation

Mapping _mapping [protected]
 

Definition at line 33 of file PhotonMapShader.h.

Referenced by PhotonMapShader::distributeEnergy().

Caustics* _pCausticsEmittion [protected]
 

Definition at line 30 of file PhotonMapShader.h.

Referenced by PhotonMapShader::distributeEnergy().

DiffuseBRDF* _pDefaultDiffBRDF [protected, inherited]
 

Definition at line 39 of file Shader.h.

Referenced by PhotonMapShader::distributeEnergy().

SpecularBRDF* _pDefaultSpecBRDF [protected, inherited]
 

Definition at line 40 of file Shader.h.

Referenced by PhotonMapShader::distributeEnergy().

unsigned _photonsPerLight [protected]
 

Definition at line 32 of file PhotonMapShader.h.

Referenced by PhotonMapShader::distributeEnergy().

LightArray* _pLights [protected]
 

Definition at line 31 of file PhotonMapShader.h.

Referenced by PhotonMapShader::distributeEnergy().

PhotonTracing* _pPhotonTracing [protected]
 

Definition at line 29 of file PhotonMapShader.h.

Referenced by PhotonMapShader::distributeEnergy().

ReflectionModel* _pReflectionModel [protected, inherited]
 

Definition at line 36 of file Shader.h.

Referenced by RadShader::distributeEnergy(), and RTShader::illuminatePoint().

Scene* _pScene [protected, inherited]
 

Definition at line 38 of file Shader.h.

Referenced by PhotonMapShader::_create_maps_per_shape(), PhotonMapShader::_create_scene_maps(), PhotonMapShader::_emit_caustic_photon(), PhotonMapShader::_emit_global_photon(), PhotonMapShader::distributeEnergy(), and RadShader::setScene().

SceneGraphObject* _pShape [protected, inherited]
 

Definition at line 37 of file Shader.h.

Referenced by RTShader::illuminatePoint(), and GLShader::setRenderedShape().

bool _userDefinedBehaviour [protected]
 

Definition at line 34 of file PhotonMapShader.h.

Referenced by PhotonMapShader::_create_maps_per_shape(), and PhotonMapShader::_create_scene_maps().


The documentation for this class was generated from the following files:
Generated on Tue Nov 21 15:11:43 2006 for gra by  doxygen 1.4.6