Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Private Member Functions | List of all members
merl_data< CONF, NAME > Class Template Reference

MERL-MIT sampled reflectance. More...

#include <merl.h>

Public Member Functions

 BBM_IMPORT_CONFIG (CONF)
 
 merl_data (void)=delete
 Empty Constructor.
 
 merl_data (const merl_data &src)=default
 Copy constructor.
 
merl_dataoperator= (const merl_data &src)=default
 Assignment operator.
 
 BBM_CONSTRUCTOR (merl_data, args, arg< const std::string &, "filename">)
 Import Constructor.
 
Spectrum eval (const Vec3d &in, const Vec3d &out, BsdfFlag component=bsdf_flag::All, unit_t=unit_t::Radiance, Mask mask=true) const
 Evaluate the BSDF given an in and out direction.
 
BsdfSample sample (const Vec3d &out, const Vec2d &xi, BsdfFlag component=bsdf_flag::All, unit_t unit=unit_t::Radiance, Mask mask=true) const
 Sample the sanpled BSDF given a direction and two random variables.
 
Value pdf (const Vec3d &in, const Vec3d &out, BsdfFlag component=bsdf_flag::All, unit_t unit=unit_t::Radiance, Mask mask=true) const
 Compute the pdf given an in and out direction.
 
Spectrum reflectance (const Vec3d &, BsdfFlag component=bsdf_flag::All, unit_t=unit_t::Radiance, Mask mask=true) const
 Return the (approximate) hemispherical reflectance of the BSDF.
 
std::string toString (void) const
 Custom string conversion.
 

Static Public Attributes

static constexpr string_literal name = NAME
 

Private Member Functions

void import (void)
 Import MERL data from file.
 

Private Attributes

std::string _filename
 Class members.
 
merl_linearizer< Config > _linearizer
 
std::vector< color< double > > _data
 

Detailed Description

template<typename CONF, string_literal NAME = "MerlData">
requires concepts::config<CONF>
class bbm::merl_data< CONF, NAME >

MERL-MIT sampled reflectance.

Stored and provides access to the MERL-MIT measured BRDFs.

Sample, pdf, and reflectance are implemented by placeholders.

Constructor & Destructor Documentation

◆ merl_data() [1/2]

merl_data ( void  )
delete

Empty Constructor.

◆ merl_data() [2/2]

merl_data ( const merl_data< CONF, NAME > &  src)
default

Copy constructor.

Member Function Documentation

◆ BBM_CONSTRUCTOR()

BBM_CONSTRUCTOR ( merl_data< CONF, NAME >  ,
args  ,
arg< const std::string &, "filename">   
)
inline

Import Constructor.

Parameters
filename= name of MERL BRDF file

◆ BBM_IMPORT_CONFIG()

BBM_IMPORT_CONFIG ( CONF  )

◆ eval()

Spectrum eval ( const Vec3d &  in,
const Vec3d &  out,
BsdfFlag  component = bsdf_flag::All,
unit_t  = unit_t::Radiance,
Mask  mask = true 
) const
inline

Evaluate the BSDF given an in and out direction.

Parameters
in= incoming direction of transport
out= exitant direction of transport
component= which reflectance component to eval
unit= unit of computation
mask= mask to enable/disable lanes
Returns
the resulting Spectrum of the evaluation.

IMPORTANT: The foreshortning (i.e., cosine) is NOT included.

◆ import()

void import ( void  )
inlineprivate

Import MERL data from file.

Load the MERL-MIT BRDF data from path/filename. Will throw a run-time exception if not found, or if the format is not a MERL-MIT format.

◆ operator=()

merl_data & operator= ( const merl_data< CONF, NAME > &  src)
default

Assignment operator.

◆ pdf()

Value pdf ( const Vec3d &  in,
const Vec3d &  out,
BsdfFlag  component = bsdf_flag::All,
unit_t  unit = unit_t::Radiance,
Mask  mask = true 
) const
inline

Compute the pdf given an in and out direction.

Parameters
in= the incoming direction
out= the outgoing direction
component= which reflectance component was sampled
unit= unit of computation
mask= enable/disable lanes.
Returns
the PDF that the outgoing direction would be sampled given the incoming direction.

◆ reflectance()

Spectrum reflectance ( const Vec3d &  ,
BsdfFlag  component = bsdf_flag::All,
unit_t  = unit_t::Radiance,
Mask  mask = true 
) const
inline

Return the (approximate) hemispherical reflectance of the BSDF.

Parameters
out= the outgoing direction (ignored)
component= which reflectance component to eval
unit= unit of computation
mask= enable/disable lanes
Returns
the approximate hemispherical reflectance of the BSDF for a given incident direction

◆ sample()

BsdfSample sample ( const Vec3d &  out,
const Vec2d &  xi,
BsdfFlag  component = bsdf_flag::All,
unit_t  unit = unit_t::Radiance,
Mask  mask = true 
) const
inline

Sample the sanpled BSDF given a direction and two random variables.

Parameters
out= outgoing direction
xi= two random variables stored in a Vec2d
component= which reflectance component to sample
unit=unit of computation
mask= mask to enable/disable lanes
Returns
A bsdfSample containing the sampled direction and the corresponding pdf.

◆ toString()

std::string toString ( void  ) const
inline

Custom string conversion.

Member Data Documentation

◆ _data

std::vector<color<double> > _data
private

◆ _filename

std::string _filename
private

Class members.

◆ _linearizer

merl_linearizer<Config> _linearizer
private

◆ name

constexpr string_literal name = NAME
staticconstexpr

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