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

toxic::Photon Class Reference

#include <photon.h>

List of all members.

Public Member Functions

 Photon ()
void SetPosition (const sheep::Point3 &position)
sheep::Point3 GetPosition () const
void SetPower (const Color3 &power)
void ScalePower (sheep::Real scale)
Color3 GetPower () const
void SetIncidentDirection (const sheep::Vector3 &direction)
sheep::Vector3 GetIncidentDirection () const
void SetSplittingPlaneAxis (int axis)
int GetSplittingPlaneAxis () const
bool HasPrecomputedRadiance () const
 Returns true if this photon carries a precomputed radiance.

void SetPrecomputedRadiance (const Color3 &radiance)
 Radiance is expressed in W.m^-2.sr^-1.

Color3 GetPrecomputedRadiance () const
void SetSurfaceNormal (const sheep::Vector3 &normal)
sheep::Vector3 GetSurfaceNormal () const
void WriteToStream (sheep::BinaryStream &os) const
void ReadFromStream (sheep::BinaryStream &is)

Public Attributes

sheep::float32 m_position [3]
 Position (12 bytes).


Private Attributes

sheep::float32 m_power [3]
 Full precision power (12 bytes). Expressed in W.

sheep::uint8 m_qphi
sheep::uint8 m_qtheta
 Compressed incident direction (2 bytes). Expressed in world space (away from the surface).

sheep::float32 m_radiance [3]
 Full precision precomputed radiance (12 bytes). Expressed in W.m^-2.sr^-1.

sheep::uint8 m_qnormal
 Normal of the surface at the photon position (1 byte).

sheep::uint16 m_flags
sheep::uint8 m_padding [3]


Detailed Description

The photon map implementation is based on the reference implementation provided by Henrik Wann Jensen in his book "Realistic Image Synthesis Using Photon Mapping".

Definition at line 42 of file photon.h.


Constructor & Destructor Documentation

toxic::Photon::Photon  )  [inline]
 

Definition at line 141 of file photon.h.


Member Function Documentation

sheep::Vector3 toxic::Photon::GetIncidentDirection  )  const [inline]
 

Returns the photon incident direction. The returned direction is a unit-length vector going away from the surface carrying the photon, and is expressed in world space.

Definition at line 203 of file photon.h.

Referenced by toxic::PhotonMap::ApproximateRadiance(), toxic::PhotonMap::BuildPhotonDirectionHistogram(), and toxic::PhotonMap::ComputeRadiance().

sheep::Point3 toxic::Photon::GetPosition  )  const [inline]
 

Definition at line 154 of file photon.h.

Referenced by toxic::PhotonMap::PrecomputeRadiances().

Color3 toxic::Photon::GetPower  )  const [inline]
 

Definition at line 189 of file photon.h.

Referenced by toxic::PhotonMap::ApproximateRadiance(), toxic::PhotonMap::BuildPhotonDirectionHistogram(), and toxic::PhotonMap::ComputeRadiance().

Color3 toxic::Photon::GetPrecomputedRadiance  )  const [inline]
 

Definition at line 242 of file photon.h.

Referenced by toxic::PhotonMap::GetPrecomputedRadiance().

int toxic::Photon::GetSplittingPlaneAxis  )  const [inline]
 

Definition at line 215 of file photon.h.

Referenced by toxic::PhotonMap::locate_nearest_photon_with_irradiance(), and toxic::PhotonMap::locate_photons().

sheep::Vector3 toxic::Photon::GetSurfaceNormal  )  const [inline]
 

Returns the surface normal at the photon position. The returned normal is unit-length and is expressed in world space.

Definition at line 258 of file photon.h.

Referenced by toxic::PhotonMap::ApproximateRadiance(), toxic::PhotonMap::BuildPhotonDirectionHistogram(), toxic::PhotonMap::ComputeRadiance(), toxic::PhotonMap::locate_nearest_photon_with_irradiance(), and toxic::PhotonMap::PrecomputeRadiances().

bool toxic::Photon::HasPrecomputedRadiance  )  const [inline]
 

Returns true if this photon carries a precomputed radiance.

Definition at line 223 of file photon.h.

Referenced by toxic::PhotonMap::locate_nearest_photon_with_irradiance().

void toxic::Photon::ReadFromStream sheep::BinaryStream is  )  [inline]
 

Definition at line 312 of file photon.h.

Referenced by toxic::PhotonMap::CreateFromFile().

void toxic::Photon::ScalePower sheep::Real  scale  )  [inline]
 

Definition at line 170 of file photon.h.

void toxic::Photon::SetIncidentDirection const sheep::Vector3 direction  )  [inline]
 

Sets the photon incident direction. The direction vector must be unit-length, must go away from the surface carrying the photon and must be expressed in world space.

Definition at line 198 of file photon.h.

Referenced by toxic::PhotonMap::StorePhoton().

void toxic::Photon::SetPosition const sheep::Point3 position  )  [inline]
 

Definition at line 147 of file photon.h.

Referenced by toxic::PhotonMap::StorePhoton().

void toxic::Photon::SetPower const Color3 power  )  [inline]
 

Definition at line 159 of file photon.h.

Referenced by toxic::PhotonMap::StorePhoton().

void toxic::Photon::SetPrecomputedRadiance const Color3 radiance  )  [inline]
 

Radiance is expressed in W.m^-2.sr^-1.

Definition at line 229 of file photon.h.

Referenced by toxic::PhotonMap::PrecomputeRadiances().

void toxic::Photon::SetSplittingPlaneAxis int  axis  )  [inline]
 

Definition at line 208 of file photon.h.

Referenced by toxic::PhotonMap::balance_segment().

void toxic::Photon::SetSurfaceNormal const sheep::Vector3 normal  )  [inline]
 

Sets the surface normal at the photon position. The normal must be unit-length and must be expressed in world space.

Definition at line 253 of file photon.h.

Referenced by toxic::PhotonMap::StorePhoton().

void toxic::Photon::WriteToStream sheep::BinaryStream os  )  const [inline]
 

Definition at line 265 of file photon.h.


Member Data Documentation

sheep::uint16 toxic::Photon::m_flags [private]
 

Various flags and data (2 bytes). Bits 1-0: splitting plane axis (for kd-tree construction). Bit 2: 1 if the photon carries an irradiance estimate, 0 otherwise. Do not change the size of this member unless you apply the change everywhere.

Definition at line 112 of file photon.h.

sheep::uint8 toxic::Photon::m_padding[3] [private]
 

Todo:
Adjust padding according to the various #defines.

Definition at line 115 of file photon.h.

sheep::float32 toxic::Photon::m_position[3]
 

Position (12 bytes).

Definition at line 44 of file photon.h.

Referenced by toxic::PhotonMap::balance_segment(), toxic::PhotonMap::locate_nearest_photon_with_irradiance(), toxic::PhotonMap::locate_photons(), and toxic::PhotonMap::median_split().

sheep::float32 toxic::Photon::m_power[3] [private]
 

Full precision power (12 bytes). Expressed in W.

Definition at line 94 of file photon.h.

sheep::uint8 toxic::Photon::m_qnormal [private]
 

Normal of the surface at the photon position (1 byte).

Definition at line 105 of file photon.h.

sheep::uint8 toxic::Photon::m_qphi [private]
 

Definition at line 97 of file photon.h.

sheep::uint8 toxic::Photon::m_qtheta [private]
 

Compressed incident direction (2 bytes). Expressed in world space (away from the surface).

Definition at line 97 of file photon.h.

sheep::float32 toxic::Photon::m_radiance[3] [private]
 

Full precision precomputed radiance (12 bytes). Expressed in W.m^-2.sr^-1.

Definition at line 103 of file photon.h.


The documentation for this class was generated from the following file:
Generated on Tue May 11 01:31:57 2004 for toxic by doxygen 1.3.6