Material Class Reference

Abstract representation of a surface Material, defined without respect to the underlying surface (loose coupling between Shapes and Materials from the point-of-view of a Material, but all Shapes know about their surface Material). Materials subclass PropertyMap, and it is through this interface that Material properties may be set (ex: diffuse color, texture/bump/color map(s), index of refraction of interior volume, etc.). More...

#include <Material.h>

Inheritance diagram for Material:

PropertyMap

List of all members.

Public Member Functions

Constructors
 Material ()
virtual ~Material ()
Initialization
virtual void init ()
 Performs any initialization that may be necessary before beginning to sample this material.
Main usage interface
virtual bool isEmitter ()
virtual BSDFgetBSDF (SurfacePoint &pt)
 Accessor for instantiating BSDFs used in sampling at various SurfacePoints along an underlying surface comprised of this Material.
virtual EmittergetEmitter (SurfacePoint &pt)
 Accessor for instantiating Emitters used for evaluating emittance along an underlying surface comprised of this Material.
virtual EmittergetEmitter ()
 Accessor for instantiating a representative Emitter at any point on the surface of this Material.
virtual SensorgetSensor (SurfacePoint &pt)
 Accessor for instantiating Sensors used for evaluating importance along an underlying surface comprised of this Material.
virtual void preview (Shape *shape)
 Sets up OpenGL material state (color properties, lights, etc.) to enable a crude/fast preview of geometry to which this Material is applied.
Utility methods for extracting BSDF/Emitter/Sensor parameters
SpectralSampleSet getSpectralSampleSet (const std::string &key, const SpectralSampleSet &defaultValue, const SurfacePoint &pt)
SpectralSampleSet getSpectralSampleSet (const std::string &key, const real_t &defaultValue, const SurfacePoint &pt)
SpectralSampleSet getSpectralSampleSet (const std::string &key, const std::string &defaultValue, const SurfacePoint &pt)
SpectralSampleSet getSpectralSampleSet (const std::string &key, const SurfacePoint &pt)
RgbaHDR getSample (const ImagePtr &image, const UV &uv)
KernelFiltergetFilter ()
Lazy evaluation of SurfacePoint information
virtual void initSurfacePoint (SurfacePoint &pt)

Static Public Attributes

Static members
static SurfacePoint s_nullSurfacePoint
static Emitters_nullEmitter = new NullEmitter(Material::s_nullSurfacePoint)
static Sensors_nullSensor = new NullSensor (Material::s_nullSurfacePoint)

Protected Member Functions

virtual void _initShadingNormal (SurfacePoint &pt)

Protected Attributes

KernelFilterm_filter
std::string m_bsdf
std::string m_emitter
std::string m_bumpMap
real_t m_repeatU
real_t m_repeatV
real_t m_bumpIntensity


Detailed Description

Abstract representation of a surface Material, defined without respect to the underlying surface (loose coupling between Shapes and Materials from the point-of-view of a Material, but all Shapes know about their surface Material). Materials subclass PropertyMap, and it is through this interface that Material properties may be set (ex: diffuse color, texture/bump/color map(s), index of refraction of interior volume, etc.).

Author:
Travis Fischer (fisch0920@gmail.com)

Matthew Jacobs (jacobs.mh@gmail.com)

Date:
Fall 2008
Reflectivity, emittance, and sensor response (BSDFs, Emitters, and Sensors respectively) are three properties of a material that are defined at a single point on a surface. A Material encapsulates BSDF, Emitter, and Sensor properties defined over its surface, where specific instances of BSDF, Emitter, and Sensor are allowed to have their inputs vary with respect to position along the surface. In this respect, Materials represent a mapping from surface position to associated BSDF, Emitter, and Sensor functions, where the underlying functions themselves remain constant along the surface, and only the inputs vary among the different instances / surface points. For example, a Material may have a DiffuseBSDF over its entire surface, but a specific DiffuseBSDF instance obtained by getBSDF or implicitly in initSurfacePoint (which fills in the SurfacePoint's BSDF), is allowed to have its 'kd' parameter (diffuse albedo) vary with respect to the given surface point via lookup in an associated 'kd' texture map defined over the UV coordinates of the surface.

Definition at line 47 of file Material.h.


Constructor & Destructor Documentation

Material::Material (  )  [inline]

Definition at line 60 of file Material.h.

Material::~Material (  )  [virtual]

Definition at line 47 of file Material.cpp.


Member Function Documentation

void Material::init (  )  [virtual]

Performs any initialization that may be necessary before beginning to sample this material.

Note:
default implementation initializes this material's filter, used for filtering texture values

Definition at line 51 of file Material.cpp.

bool Material::isEmitter (  )  [virtual]

Returns:
whether or not this Material is an emitter

Definition at line 92 of file Material.cpp.

BSDF * Material::getBSDF ( SurfacePoint pt  )  [virtual]

Accessor for instantiating BSDFs used in sampling at various SurfacePoints along an underlying surface comprised of this Material.

Returns:
a new BSDF defined at the given surface point. The type of BSDF returned depends on the 'bsdf' property in the PropertyMap, which defaults to DiffuseBSDF

Definition at line 65 of file Material.cpp.

Emitter * Material::getEmitter ( SurfacePoint pt  )  [virtual]

Accessor for instantiating Emitters used for evaluating emittance along an underlying surface comprised of this Material.

Returns:
a new Emitter defined at the given surface point. The type of Emitter returned depends on the 'emitter' property in the PropertyMap, which defaults to NullEmitter (no light emitted)

Definition at line 96 of file Material.cpp.

Emitter * Material::getEmitter (  )  [virtual]

Accessor for instantiating a representative Emitter at any point on the surface of this Material.

Note:
useful if you just want to know the emittance properties of this Material (power, radiant exitance, etc.) and don't actually intend to use it for sampling purposes
Returns:
a new Emitter defined at a dummy surface point. The type of Emitter returned depends on the 'emitter' property in the PropertyMap, which defaults to NullEmitter (no light emitted)

Definition at line 116 of file Material.cpp.

Sensor * Material::getSensor ( SurfacePoint pt  )  [virtual]

Accessor for instantiating Sensors used for evaluating importance along an underlying surface comprised of this Material.

Returns:
a new Sensor defined at the given surface point

Definition at line 120 of file Material.cpp.

void Material::preview ( Shape shape  )  [virtual]

Sets up OpenGL material state (color properties, lights, etc.) to enable a crude/fast preview of geometry to which this Material is applied.

Definition at line 137 of file Material.cpp.

SpectralSampleSet Material::getSpectralSampleSet ( const std::string &  key,
const SpectralSampleSet defaultValue,
const SurfacePoint pt 
)

Definition at line 225 of file Material.cpp.

SpectralSampleSet Material::getSpectralSampleSet ( const std::string &  key,
const real_t defaultValue,
const SurfacePoint pt 
)

Definition at line 235 of file Material.cpp.

SpectralSampleSet Material::getSpectralSampleSet ( const std::string &  key,
const std::string &  defaultValue,
const SurfacePoint pt 
)

Definition at line 247 of file Material.cpp.

SpectralSampleSet Material::getSpectralSampleSet ( const std::string &  key,
const SurfacePoint pt 
)

Definition at line 257 of file Material.cpp.

RgbaHDR Material::getSample ( const ImagePtr image,
const UV uv 
)

Definition at line 279 of file Material.cpp.

KernelFilter* Material::getFilter (  )  [inline]

Definition at line 168 of file Material.h.

void Material::initSurfacePoint ( SurfacePoint pt  )  [virtual]

Definition at line 155 of file Material.cpp.

void Material::_initShadingNormal ( SurfacePoint pt  )  [protected, virtual]

Definition at line 177 of file Material.cpp.


Member Data Documentation

Definition at line 51 of file Material.h.

Definition at line 53 of file Material.h.

Definition at line 186 of file Material.h.

std::string Material::m_bsdf [protected]

Definition at line 188 of file Material.h.

std::string Material::m_emitter [protected]

Definition at line 189 of file Material.h.

std::string Material::m_bumpMap [protected]

Definition at line 190 of file Material.h.

Definition at line 192 of file Material.h.

Definition at line 193 of file Material.h.

Definition at line 194 of file Material.h.


The documentation for this class was generated from the following files:

Generated on 28 Feb 2009 for Milton by doxygen 1.5.6