SurfaceShader Class Reference
The virtual base class for all material properties.
More...
#include <core/SurfaceShader.h>
Inheritance diagram for SurfaceShader:
[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:
- Implement the radiance() function, which should be a full description of the shader.
- Implement the kernel(), pdfDirection(), and sampleKernel() functions. This should be done for any shader that can be described by a kernel and a probability distribution of sampling rays. This choice will allow the renderer to use combined sampling to efficiently render a low-variance image. For testing purposes default implementations of kernel() and pdfDirection() are given which, though inefficient, can can be used as baselines for testing new implementations of these functions for correctness.
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
|
|
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. |
|
|
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. |
|
|
Returns the value of the kernel ( for surfaces or 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. |
|
|
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. |
|
|
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.
|
|
|
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.
|
|
|
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:
- SurfaceShader.h
- SurfaceShader.cc
Generated on Wed Jul 20 16:15:28 2005 for galileo by
1.4.3