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

The PbrMaterial class defines all the data (bxdfs, fresnels, absorptions, microfacets distributions...) necessary to make a material. More...

Public Member Functions

void init (const GMathVec3f &opacity=GMathVec3f(1.0f))
 clear Clear all the attributes of this class
 
void finalize (const CtxPbrSamplingConstants &sampling_constants, const bool &receive_shadows, const bool &receive_self_shadows, const UniqueString *lpe_label, const CoreVector< BxDFTypeFlags > &filters, const GMathVec3d &wi, const GMathVec3f &opacity_contribution=GMathVec3f(1.0f))
 finalize finalize all the data in order to do the integration
 
const unsigned int & get_bxdf_count () const
 Get the number of declared BxDFs.
 
const unsigned int & get_eval_bxdf_count () const
 Get the number of BxDFs to evaluate.
 
const unsigned int & get_rough_bxdf_count () const
 Get the number of rough BxDFs to evaluate.
 
const unsigned int & get_specular_bxdf_count () const
 Get the number of specular BxDFs to evaluate.
 
const CoreBasicArray< unsigned
int > & 
get_eval_bxdf_indices () const
 Get indices of BxDFs to evaluate.
 
const CoreBasicArray< unsigned
int > & 
get_rough_bxdf_indices () const
 Get indices of rough BxDFs to evaluate.
 
const CoreBasicArray< unsigned
int > & 
get_specular_bxdf_indices () const
 Get indices of specular BxDFs to evaluate.
 
const PbrBxdfget_bxdf (const unsigned int &bxdf_index) const
 Get a const version of a declared BxDF.
 
PbrBxdfget_bxdf (const unsigned int &bxdf_index)
 Get a declared BxDF.
 
const PbrBxdfget_eval_bxdf (const unsigned int &bxdf_index) const
 Get a const version of a BxDF to evaluate.
 
PbrBxdfget_eval_bxdf (const unsigned int &bxdf_index)
 Get a BxDF to evaluate.
 
const PbrBxdfget_rough_bxdf (const unsigned int &bxdf_index) const
 Get a const version of a rough BxDF to evaluate.
 
PbrBxdfget_rough_bxdf (const unsigned int &bxdf_index)
 Get a rough BxDF to evaluate.
 
const PbrBxdfget_specular_bxdf (const unsigned int &bxdf_index) const
 Get a const version of a specular BxDF to evaluate.
 
PbrBxdfget_specular_bxdf (const unsigned int &bxdf_index)
 Get a specular BxDF to evaluate.
 
const CoreBasicArray< float > & get_bxdf_weights () const
 Get all bxdfs weights.
 
const float & get_bxdf_weight (const unsigned int &bxdf_index) const
 Get the weight of a bxdf.
 
const CoreBasicArray
< PbrAbsorptionLayer > & 
get_absorption_layer () const
 get_absorption_layer
 
GMathVec3f compute_layers_absorption (const GMathVec3d &normal, const GMathVec3d &wi, const GMathVec3d &wo, unsigned int bxdf_index) const
 compute_layers_absorption
 
const GMathVec3f & get_emission () const
 get_emission
 
const GMathVec3f & get_attenuation () const
 get_attenuation
 
const GMathVec3f & get_scattering () const
 get_scattering
 
const float & get_scattering_anisotropy () const
 get_scattering_anisotropy
 
const GMathVec3f & get_opacity () const
 get_opacity
 
const CoreVector< float > & get_bxdf_sampling_pdf () const
 get_bxdf_sampling_pdf
 
CoreVector< float > & get_bxdf_sampling_pdf ()
 get_bxdf_sampling_pdf
 
const float & get_light_sampling_factor () const
 get_light_sampling_factor
 
const PbrIntegrationDomain & get_integration_domain () const
 get_integration_domain
 
bool has_any_flag (const BxDFTypeFlags &to_match) const
 get_material_flags
 
const unsigned int & get_requested_sample_count () const
 get_requested_sample_count
 
const float & get_average_roughness () const
 Get the average roughness of the material.
 
const GMathVec3d & get_average_normal () const
 Get the average normal of the material.
 
const float & get_alpha_contribution () const
 
const UniqueStringget_lpe_label () const
 
bool get_bypass_light_estimation () const
 get_bypass_light_estimation
 
bool get_receive_shadows () const
 
bool get_receive_self_shadows () const
 
bool get_compute_unoccluded () const
 
bool get_disable_self_shadows () const
 
bool get_is_black_hole () const
 
bool lpe_disabled () const
 
const unsigned int & get_bxdf_sampling_dimension () const
 
const unsigned int & get_scatter_sampling_dimension () const
 
const CoreVector< unsigned int > & get_channel_bxdfs (const PbrChannelIndex &channel_index) const
 
bool require_evaluation () const
 require_evaluation
 
void set_channel_sampling_probabilities ()
 set_channel_sampling_probabilities compute the probability of sampling each channel
 
const float & get_channel_sampling_probability (const PbrChannelIndex &channel_index) const
 get_channel_sampling_probability
 
float get_channels_sampling_probability (const PbrChannelIndex &channel_index_start, const PbrChannelIndex &channel_index_stop) const
 get_channels_sampling_probability
 
void add_lpe_constant (const UniqueString &label, const GMathVec3f &value)
 add a PbrLpeConstant to the m_custom_lpes
 
void add_lpe_constant (const unsigned int &bxdf_id, const UniqueString &label, const GMathVec3f &value)
 
const CoreBasicArray
< PbrLpeConstant > & 
get_lpe_constants () const
 Return LPE constants declared at the level of the material.
 
const CoreBasicArray
< PbrLpeBxdfConstant > & 
get_lpe_bxdf_constants () const
 Return LPE constants declared by BxDFs.
 
bool check_light_integration_domain ()
 Return weither or not we will check the light integration domain.
 
void set_check_light_integration_domain (bool check)
 
template<bool CHECK_EMPTY_BXDFS>
GMathVec3f evaluate (float &weighted_pdf, const GMathVec3d &wo, const GMathVec3d &wi, const PbrScatter *scatter, unsigned int bxdf_index) const
 
template<bool CHECK_EMPTY_BXDFS>
GMathVec3f sample (float &weighted_pdf, GMathVec3d &wo, const GMathVec3d &wi, const PbrScatter *scatter, unsigned int bxdf_index, const PbrRandVar &rand_var) const
 
template<bool CHECK_EMPTY_BXDFS>
GMathVec3f evaluate (float &weighted_pdf, const GMathVec3d &wo, const GMathVec3d &wi, const PbrScatter *scatter, const unsigned int bxdf_indices[], unsigned int bxdf_start, unsigned int bxdf_stop) const
 
GMathVec3f evaluate (float &weighted_pdf, const GMathVec3d &wo, const GMathVec3d &wi, const PbrScatter *scatter, PbrChannelIndex channel_index) const
 
GMathVec3f sample (float &weighted_pdf, GMathVec3d &wo, const GMathVec3d &wi, const PbrScatter *scatter, PbrChannelIndex channel_index, const PbrRandVar &rand_var, float rand_selector) const
 
GMathVec3f evaluate (float &weighted_pdf, const GMathVec3d &wo, const GMathVec3d &wi, const PbrScatter *scatter, PbrChannelIndex channel_index_start, PbrChannelIndex channel_index_stop) const
 
GMathVec3f evaluate (const PbrSample &sample, const GMathVec3d &wi, const PbrScatter *scatter, PbrChannelIndex channel_index_start, PbrChannelIndex channel_index_stop) const
 
GMathVec3f sample (float &weighted_pdf, GMathVec3d &wo, const GMathVec3d &wi, const PbrScatter *scatter, PbrChannelIndex channel_index_start, PbrChannelIndex channel_index_stop, const PbrRandVar &rand_var, float rand_selector) const
 

Friends

class PbrMaterialConfig
 

Detailed Description

The PbrMaterial class defines all the data (bxdfs, fresnels, absorptions, microfacets distributions...) necessary to make a material.

Member Function Documentation

GMathVec3f PbrMaterial::compute_layers_absorption ( const GMathVec3d &  normal,
const GMathVec3d &  wi,
const GMathVec3d &  wo,
unsigned int  bxdf_index 
) const

compute_layers_absorption

Returns
the directional absorption of all layers affecting bxdf_index
void PbrMaterial::finalize ( const CtxPbrSamplingConstants sampling_constants,
const bool &  receive_shadows,
const bool &  receive_self_shadows,
const UniqueString lpe_label,
const CoreVector< BxDFTypeFlags > &  filters,
const GMathVec3d &  wi,
const GMathVec3f &  opacity_contribution = GMathVec3f(1.0f) 
)

finalize finalize all the data in order to do the integration

Parameters
sample_countthe sample count
sampling_constantssampling constants to apply during the finalization
receive_shadowstrue if the material receives shadow
filters
const CoreBasicArray<PbrAbsorptionLayer>& PbrMaterial::get_absorption_layer ( ) const
inline

get_absorption_layer

Returns
a vector of the absorption layer of this material
const GMathVec3f& PbrMaterial::get_attenuation ( ) const
inline

get_attenuation

Returns
the attenuation of this material
const CoreVector<float>& PbrMaterial::get_bxdf_sampling_pdf ( ) const
inline

get_bxdf_sampling_pdf

Returns
a vector of the bxdf sampling pdf of this material
CoreVector<float>& PbrMaterial::get_bxdf_sampling_pdf ( )
inline

get_bxdf_sampling_pdf

Returns
a vector of the bxdf sampling pdf of this material
bool PbrMaterial::get_bypass_light_estimation ( ) const
inline

get_bypass_light_estimation

Returns
the by
const float& PbrMaterial::get_channel_sampling_probability ( const PbrChannelIndex &  channel_index) const
inline

get_channel_sampling_probability

Returns
the probability of sampling the given channel
float PbrMaterial::get_channels_sampling_probability ( const PbrChannelIndex &  channel_index_start,
const PbrChannelIndex &  channel_index_stop 
) const
inline

get_channels_sampling_probability

Returns
the probability of sampling the given channels
const GMathVec3f& PbrMaterial::get_emission ( ) const
inline

get_emission

Returns
the emission of this material
const PbrIntegrationDomain& PbrMaterial::get_integration_domain ( ) const
inline

get_integration_domain

Returns
the integration domain of this material
const float& PbrMaterial::get_light_sampling_factor ( ) const
inline

get_light_sampling_factor

Returns
the light sampling factor of this material
const GMathVec3f& PbrMaterial::get_opacity ( ) const
inline

get_opacity

Returns
the opacity of this material
const unsigned int& PbrMaterial::get_requested_sample_count ( ) const
inline

get_requested_sample_count

Returns
the requested sample count of this material
const GMathVec3f& PbrMaterial::get_scattering ( ) const
inline

get_scattering

Returns
the scattering of this material
const float& PbrMaterial::get_scattering_anisotropy ( ) const
inline

get_scattering_anisotropy

Returns
the scattering anisotropy of this material
bool PbrMaterial::has_any_flag ( const BxDFTypeFlags &  to_match) const
inline

get_material_flags

Returns
the flags of this material has_any_flag
Parameters
to_matchThe flags that we want to match
Returns
true if at least one of the material's flags is matching to_match
bool PbrMaterial::require_evaluation ( ) const
inline

require_evaluation

Returns
true if this material has valid bxdfs