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

SurfaceShader Class Reference

The virtual base class for all material properties. More...

#include <core/SurfaceShader.h>

Inheritance diagram for SurfaceShader:

Inheritance graph
[legend]
List of all members.

Public Member Functions

virtual rgb sampleKernel (const Vector3 &w_out, const HitRecord &rec, Context &context, Vector3 &w_in, double &pdf) const
virtual double pdfDirection (const Vector3 &w_out, const Vector3 &w_in, const HitRecord &rec, Context &context) const
virtual rgb kernel (const Vector3 &w_out, const Vector3 &w_in, const HitRecord &rec, Context &context) const
virtual rgb radiance (const HitRecord &rec, Context &context) const
rgb radianceMIS (const HitRecord &rec, Context &context) const
rgb radianceMD (const HitRecord &rec, Context &context) const
rgb radiancePath (const HitRecord &rec, Context &context) const

Detailed Description

The virtual base class for all material properties.

This class is a base class for surface shaders in the galileo renderer. Volumes are treated as surfaces and must implement this class as well to describe phase functions (volume scattering functions).

All shaders that inherit from this class should do one of the following two choices:

The w_in and w_out vectors passed to the kernel, pdfDirection and sampleKernel functions are all normalized to be unit-length and follow the convention that they point away from the surface (more formally, the dot product of w_in or w_out with the normal is non-negative).


Member Function Documentation

rgb SurfaceShader::sampleKernel const Vector3 w_out,
const HitRecord rec,
Context context,
Vector3 w_in,
double &  pdf
const [virtual]
 

Sample a SurfaceShader kernel.

Parameters:
[in] w_out Unit-length vector pointing away from the surface.
[in] rec HitRecord associated with the point to be shaded.
[in,out] context The rendering context.
[out] w_in Generated directional sample (unit-length vector).
[out] pdf Value of pdf for generated sample (w_in).
Returns:
The value of the kernel for the pair w_out, w_in.

Reimplemented in AshikhminShader, HGScatterer, LambertianShader, RayleighScatterer, and WardShader.

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

Evaluate the pdf of sampling w_in given w_out. This must be consistent with the sampleKernel function.

Parameters:
[in] w_out Unit-length vector pointing away from the surface.
[in] w_in Unit-length vector used to sample incident radiance.
[in] rec HitRecord associated with point to be shaded.
[in,out] context The rendering context.
Returns:
The evaluated value of the pdf for w_in given w_out.

Reimplemented in AshikhminShader, HGScatterer, LambertianShader, RayleighScatterer, and WardShader.

rgb SurfaceShader::kernel const Vector3 w_out,
const Vector3 w_in,
const HitRecord rec,
Context context
const [virtual]
 

Returns the value of the kernel ($brdfcos(\theta)$ for surfaces or $\Lambda p(\omega_o, \omega_i)$ for volumes) for the given incoming and outgoing directions. This function must be consistent with the value returned by the sampleKernel function.

Parameters:
[in] w_out Unit-length vector pointing away from the surface.
[in] w_in Unit-length vector used to sample incident radiance.
[in] rec HitRecord associated with point to be shaded.
[in,out] context The rendering context.
Returns:
The value of the kernel for the given directions.

Reimplemented in AshikhminShader, HGScatterer, LambertianShader, RayleighScatterer, and WardShader.

rgb SurfaceShader::radiance const HitRecord rec,
Context context
const [virtual]
 

Calculate the radiance at the shading point towards the viewer (-context.ray.direction).

Parameters:
[in] rec HitRecord associated with point to be shaded.
[in,out] context The rendering context.
Returns:
The radiance along the viewing ray for the shading point.

Reimplemented in Dielectric, and SpectralDielectric.

rgb SurfaceShader::radianceMIS const HitRecord rec,
Context context
const
 

Evaluate the radiance at the shading point using MIS.

Parameters:
[in] rec HitRecord associated with point to be shaded.
[in,out] context The rendering context.
Returns:
The radiance along the viewing ray for the shading point.

rgb SurfaceShader::radianceMD const HitRecord rec,
Context context
const
 

Evaluate the radiance at the shading point using Mixture Density sampling.

Parameters:
[in] rec HitRecord associated with point to be shaded.
[in,out] context The rendering context.
Returns:
The radiance along the viewing ray for the shading point.

rgb SurfaceShader::radiancePath const HitRecord rec,
Context context
const
 

Evaluate the radiance at the shading point using kernel sampling. This is essentially naive path tracing.

Parameters:
[in] rec HitRecord associated with point to be shaded.
[in,out] context The rendering context.
Returns:
The radiance along the viewing ray for the shading point.


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