Clarisse 5.0 SP8 SDK  5.0.5.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | List of all members
PbrBxdfBaker Class Reference

The PbrBxdfBaker class This class allow to bake a bxdf and store the result in lut dependings on n (n <= 4) parameters. For instance those parameters can be (wi.dot(wo)), the roughness, the ior. Each parameters can be control by a parameter function. For instance if we can have function x^2 for the roughness. Hence the array m_parameter_functions. In order to bake the bxdf we need to configure the bxdf with different parameters, hence m_configuration_function. More...

Public Types

typedef CoreFunction< void(const
double &, const double
&, const double &, const
double &) > 
ConfigureFunction
 
typedef CoreFunction< double(const
double &) > 
ParameterFunction
 

Public Member Functions

 PbrBxdfBaker (PbrBxdf *bxdf)
 
PbrBxdfBakeroperator= (PbrBxdfBaker other)
 
void set_configuration_function (ConfigureFunction configuration_function)
 set_configuration_function Set the configuration function used to bake the bxdf
 
void set_parameter_function (const unsigned int &index, ParameterFunction parameter_function)
 set_parameter_function Set the parameter function as index used to applya modification on the parameters
 
template<const unsigned int PARAMETER_COUNT>
void generate_lut (const CoreString &filename, const PbrBuiltinLut lut_type, const unsigned int &size_x, const unsigned int &size_y, const unsigned int &size_z, const unsigned int &size_w, const unsigned int &sample_count, float *result)
 generate_lut This function will bake a bxdf and store the result in a lut at filename.
 
void generate_lut_average (const CoreString &filename, const PbrBuiltinLut lut_type, const unsigned int &size, const unsigned int &sample_count, float *result)
 generate_lut_average This function will bake the average albedo pf a bxdf and store the result in a lut at filename.
 
template<const unsigned int PARAMETER_COUNT>
float compute_specific_bxdf_value_with_indices (const unsigned int &sample_count, const unsigned int &x, const unsigned int &y, const unsigned int &z, const unsigned int &w, const unsigned int &size_x, const unsigned int &size_y, const unsigned int &size_z, const unsigned int &size_w)
 compute_specific_bxdf_value_with_indices Compute the specific value of the baked bxdf at (x, y, z, w) with sample_count samples.
 
float compute_specific_bxdf_value_with_wi (const unsigned int &sample_count, const GMathVec3d &w, const double &roughness)
 compute_specific_bxdf_value_with_wi Compute the specific value of the baked bxdf at (w, roughness) with sample_count samples.
 

Detailed Description

The PbrBxdfBaker class This class allow to bake a bxdf and store the result in lut dependings on n (n <= 4) parameters. For instance those parameters can be (wi.dot(wo)), the roughness, the ior. Each parameters can be control by a parameter function. For instance if we can have function x^2 for the roughness. Hence the array m_parameter_functions. In order to bake the bxdf we need to configure the bxdf with different parameters, hence m_configuration_function.

Member Function Documentation

template<const unsigned int PARAMETER_COUNT>
float PbrBxdfBaker::compute_specific_bxdf_value_with_indices ( const unsigned int &  sample_count,
const unsigned int &  x,
const unsigned int &  y,
const unsigned int &  z,
const unsigned int &  w,
const unsigned int &  size_x,
const unsigned int &  size_y,
const unsigned int &  size_z,
const unsigned int &  size_w 
)
inline

compute_specific_bxdf_value_with_indices Compute the specific value of the baked bxdf at (x, y, z, w) with sample_count samples.

Parameters
sample_countRepresent the samples count used to bake the bxdf for each combinaison of (x, y, z, w)
xcurrent x coordiante of the array [x][y][z][w]
ycurrent y coordiante of the array [x][y][z][w]
zcurrent z coordiante of the array [x][y][z][w]
wcurrent w coordiante of the array [x][y][z][w]
size_xThe size on x of the lut. Usually the x represents the cos theta (wi.dot(wo)) parameter.
size_yThe size on y of the lut. Usually the y represents the roughness.
size_zThe size on z of the lut. Usually the z represents the ior.
size_wThe size on w of the lut. For now this is not used. But it could be used if we wanted to add the anisotropy for better result... PARAMETER_COUNT Number of parameter of the lut
Returns
The specific baked bxdf value at [x][y][z][w]
float PbrBxdfBaker::compute_specific_bxdf_value_with_wi ( const unsigned int &  sample_count,
const GMathVec3d &  w,
const double &  roughness 
)
inline

compute_specific_bxdf_value_with_wi Compute the specific value of the baked bxdf at (w, roughness) with sample_count samples.

Parameters
sample_countRepresent the samples count used to bake the bxdf for each combinaison of (x, y, z, w)
wcurrent direction used to sample the bxdf
roughnessused to sample the bxdf
Returns
The specific baked bxdf value at (w, roughness)
template<const unsigned int PARAMETER_COUNT>
void PbrBxdfBaker::generate_lut ( const CoreString filename,
const PbrBuiltinLut  lut_type,
const unsigned int &  size_x,
const unsigned int &  size_y,
const unsigned int &  size_z,
const unsigned int &  size_w,
const unsigned int &  sample_count,
float *  result 
)
inline

generate_lut This function will bake a bxdf and store the result in a lut at filename.

Parameters
filenameThe output on the disk where the lut will be written
lut_typeThe type of the lut (PBR_LUT_REFLECT_BECKMANN, PBR_LUT_REFLECT_GGX...)
size_xThe size on x of the lut. Usually the x represents the cos theta (wi.dot(wo)) parameter.
size_yThe size on y of the lut. Usually the y represents the roughness.
size_zThe size on z of the lut. Usually the z represents the ior.
size_wThe size on w of the lut. For now this is not used. But it could be used if we wanted to add the anisotropy for better result...
sample_countRepresent the samples count used to bake the bxdf for each combinaison of (x, y, z, w)
resultThe data containing the baked bxdf. PARAMETER_COUNT Number of parameter of the lut
void PbrBxdfBaker::generate_lut_average ( const CoreString filename,
const PbrBuiltinLut  lut_type,
const unsigned int &  size,
const unsigned int &  sample_count,
float *  result 
)
inline

generate_lut_average This function will bake the average albedo pf a bxdf and store the result in a lut at filename.

Parameters
filenameThe output on the disk where the lut will be written
lut_typeThe type of the lut (PBR_LUT_REFLECT_BECKMANN_AVG, PBR_LUT_REFLECT_GGX_AVG...)
sizeThe size of the lut.
sample_countRepresent the samples count used to bake the bxdf
resultThe data containing the baked bxdf.