Clarisse 5.0 SP8 SDK  5.0.5.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Static Public Attributes | List of all members
PbrBxdf Class Referenceabstract
Inheritance diagram for PbrBxdf:
CoreScratchpadObject PbrSurface PbrVolumeTpl< PHASE_MODE > DisneyHair PbrEmitter PbrHairGlints PbrHairR PbrHairTT PbrLambert< BXDF_SIDE > PbrMicrofacetReflectTpl< EXPOSE_MICROFACET_NORMAL, ENABLE_CLIPPING, SHADOWING_MASKING_CORRELATION, COMPUTE_DIELECTRIC_FRESNEL > PbrMicrofacetRefractTpl< EXPOSE_MICROFACET_NORMAL, SHADOWING_MASKING_CORRELATION, TIR_ENABLED, COMPUTE_DIELECTRIC_FRESNEL > PbrOrenNayar< BRDF_MODEL, BXDF_SIDE > PbrReflectTpl< ENABLE_CLIPPING > PbrRefractTpl< ENABLE_CLIPPING, TIR_ENABLED > PbrSss PbrWard

Public Member Functions

void configure (const GMathVec3f &albedo, const GMathVec3d &normal, const float &roughness, BxDFTypeFlags type_flags, const PbrIntegrationDomain &integration_domain, const GMathVec3f &exit_color=GMathVec3f(0.0))
 configure Configure the bxdf
 
const GMathVec3f & get_albedo () const
 get_albedo
 
const GMathVec3d & get_normal () const
 get_normal
 
const float & get_roughness () const
 get_roughness
 
const BxDFTypeFlags & get_type_flags () const
 get_type_flags
 
const PbrIntegrationDomain & get_integration_domain () const
 get_integration_domain
 
virtual bool check_integration_domain () const =0
 check_integration_domain
 
virtual unsigned int get_scatter_sample_dimension () const
 Return the dimension of the variable needed to compute scattering samples.
 
virtual float get_sampling_weight (const GMathVec3d &wi) const
 get_sampling_weight
 
virtual float get_sampling_multiplier () const
 get_sampling_multiplier
 
virtual unsigned int get_sampling_dimension () const
 get_sampling_dimension
 
void sample (const GMathVec3d &wi, const PbrRandVar &var, const PbrScatter *scatter, PbrSample &sample) const
 Generate a sample (take in account fresnels and absorptions)
 
void evaluate (const GMathVec3d &wi, const PbrSample &sample, const PbrScatter *scatter, PbrEval &eval) const
 Compute the response of the object being hit by a sample (take in account fresnels and absorptions)
 
virtual bool scatter (const CtxEval &eval_ctx, CtxShader &shader_ctx, const PbrRandVar &var, PbrScatter &scatter) const
 Generate a scattering position.
 
virtual float scatter_pdf (const PbrScatter &scatter) const
 Compute the value of the PDF for a scattering position using the bxdf properties.
 
virtual void raw_sample (const GMathVec3d &wi, const PbrRandVar &var, const PbrScatter *scatter, PbrSample &sample) const =0
 Generate a sample (doesn't take in account fresnels and absorptions)
 
virtual void raw_evaluate (const GMathVec3d &wi, const PbrSample &sample, const PbrScatter *scatter, PbrEval &eval) const =0
 Compute the response of the object being hit by a sample (doesn't take in account fresnels and absorptions)
 
virtual float get_scatter_profile_scale () const
 Compute the global scale of the SSS profile.
 
virtual void sample_diff (const GMathVec3d &wi, const PbrSample &sample, const GMathVec3d &dwi, const GMathVec2d &duv, GMathVec3d &dwo) const
 Compute differentials for a given sample.
 
bool is_empty () const
 is_empty
 
bool has_any_flag (const BxDFTypeFlags &to_match) const
 has_any_flag
 
void set_fresnel (const PbrFresnel *fresnel)
 set_fresnel Set a fresnel to the bxdf
 
void set_bxdf_normalisation (const PbrBxdfNormalisation *normalisation)
 set_bxdf_normalisation Set a normalisation to the bxdf
 
void set_directional_absorption (const PbrDirectionalAbsorption *absorption)
 set_directional_absorption Set an abosrption to the bxdf
 
void set_empty ()
 set_empty Set the type of the bxdf has empty
 
const GMathVec3f & get_exit_color () const
 get_exit_color
 
const PbrFresnelget_fresnel () const
 
const PbrBxdfNormalisationget_bxdf_normalisation () const
 
const UniqueStringget_lpe_label () const
 return lpe label id associated to this bxdf
 
void set_lpe_label (const UniqueString &label)
 Set the lpe label id associated to the this bxdf.
 
- Public Member Functions inherited from CoreScratchpadObject
virtual ~CoreScratchpadObject ()
 Implement this virtual destructor in your data class, the memory scratchpad will call it on the reset call.
 

Static Public Attributes

static const float s_min_roughness = 0.001f
 
static const float s_max_roughness = 0.999f
 

Member Function Documentation

virtual bool PbrBxdf::check_integration_domain ( ) const
inlinepure virtual
void PbrBxdf::configure ( const GMathVec3f &  albedo,
const GMathVec3d &  normal,
const float &  roughness,
BxDFTypeFlags  type_flags,
const PbrIntegrationDomain &  integration_domain,
const GMathVec3f &  exit_color = GMathVec3f(0.0) 
)
inline

configure Configure the bxdf

Parameters
albedoThe albedo of the bxdf
normalThe geometric normal of the object
roughnessThe roughness of the bxdf
type_flagsThe type (Diffuse, glossy, specular, reflection, transmission ...) of the bxdf
integration_domainThe integration domain of the bxdf (Sphere, hemisphere ...)
exit_colorThe exit color of the bxdf
transmittance_colorThe transmittance's color of the bxdf
transmittance_densityThe transmittance's density of the bxdf
void PbrBxdf::evaluate ( const GMathVec3d &  wi,
const PbrSample sample,
const PbrScatter scatter,
PbrEval eval 
) const

Compute the response of the object being hit by a sample (take in account fresnels and absorptions)

Parameters
widirection of the eye
samplethe sample to evaluate
scatterscattering position corresponding to the sample
evalresult of the evaluation
const GMathVec3f& PbrBxdf::get_albedo ( ) const
inline

get_albedo

Returns
the albedo of the bxdf
const GMathVec3f& PbrBxdf::get_exit_color ( ) const
inline

get_exit_color

Returns
The exit color of the bxdf
const PbrIntegrationDomain& PbrBxdf::get_integration_domain ( ) const
inline

get_integration_domain

Returns
the integration domain of the bxdf
const GMathVec3d& PbrBxdf::get_normal ( ) const
inline

get_normal

Returns
the geometric normal of the object
const float& PbrBxdf::get_roughness ( ) const
inline

get_roughness

Returns
the roughness of the bxdf
virtual unsigned int PbrBxdf::get_sampling_dimension ( ) const
inlinevirtual
virtual float PbrBxdf::get_sampling_multiplier ( ) const
inlinevirtual

get_sampling_multiplier

Note
it will be applied on the material sample count, according to the weight of the bxdf in the integration.
Returns
return the sampling multiplier of the bxdf

Reimplemented in PbrVolumeTpl< PHASE_MODE >.

float PbrBxdf::get_sampling_weight ( const GMathVec3d &  wi) const
virtual

get_sampling_weight

Returns
return the sampling weight of the bxdf
virtual float PbrBxdf::get_scatter_profile_scale ( ) const
inlinevirtual

Compute the global scale of the SSS profile.

Returns
the global scale of the SSS profile

Reimplemented in PbrSssScatter.

virtual unsigned int PbrBxdf::get_scatter_sample_dimension ( ) const
inlinevirtual

Return the dimension of the variable needed to compute scattering samples.

Note
This controls the dimension of the variable that is given to the scatter function.

Reimplemented in PbrVolumeTpl< PHASE_MODE >, PbrSssRandomWalk, and PbrSss.

const BxDFTypeFlags& PbrBxdf::get_type_flags ( ) const
inline

get_type_flags

Returns
the type of the bxdf
bool PbrBxdf::has_any_flag ( const BxDFTypeFlags &  to_match) const
inline

has_any_flag

Parameters
to_matchThe flags that we want to match
Returns
true if at least one of the bxdf's flags is matching to_match
bool PbrBxdf::is_empty ( ) const
inline

is_empty

Returns
true if the bxdf has not been configured
virtual void PbrBxdf::raw_evaluate ( const GMathVec3d &  wi,
const PbrSample sample,
const PbrScatter scatter,
PbrEval eval 
) const
pure virtual
virtual void PbrBxdf::raw_sample ( const GMathVec3d &  wi,
const PbrRandVar var,
const PbrScatter scatter,
PbrSample sample 
) const
pure virtual
void PbrBxdf::sample ( const GMathVec3d &  wi,
const PbrRandVar var,
const PbrScatter scatter,
PbrSample sample 
) const

Generate a sample (take in account fresnels and absorptions)

Parameters
widirection of the eye
varrandom variable to use to generate the sample
scatterscattering position to use
sampleresulting sample
virtual void PbrBxdf::sample_diff ( const GMathVec3d &  wi,
const PbrSample sample,
const GMathVec3d &  dwi,
const GMathVec2d &  duv,
GMathVec3d &  dwo 
) const
inlinevirtual

Compute differentials for a given sample.

Parameters
widirection of the eye
samplea generated sample
dwieye direction derivative
duvprimitive UV derivative
dwosample direction derivative
Note
This function must be implemented if the bxdf specifies that it is able to compute custom differentials (with BXDF_CUSTOM_DIFFERENTIALS flag)

Reimplemented in PbrMicrofacetRefractTpl< EXPOSE_MICROFACET_NORMAL, SHADOWING_MASKING_CORRELATION, TIR_ENABLED, COMPUTE_DIELECTRIC_FRESNEL >, PbrRefractTpl< ENABLE_CLIPPING, TIR_ENABLED >, PbrMicrofacetReflectTpl< EXPOSE_MICROFACET_NORMAL, ENABLE_CLIPPING, SHADOWING_MASKING_CORRELATION, COMPUTE_DIELECTRIC_FRESNEL >, and PbrReflectTpl< ENABLE_CLIPPING >.

virtual bool PbrBxdf::scatter ( const CtxEval eval_ctx,
CtxShader shader_ctx,
const PbrRandVar var,
PbrScatter scatter 
) const
inlinevirtual

Generate a scattering position.

Parameters
eval_ctxa valid evaluation context
shader_ctxa valid shader context
varrandom variable to use to generate the position (its dimension is controlled by get_scatter_sample_dimension)
scatterresulting scattering position
Returns
false in case of error

Reimplemented in PbrSssScatter, PbrVolumeTpl< PHASE_MODE >, PbrSssRandomWalk, and PbrSss.

virtual float PbrBxdf::scatter_pdf ( const PbrScatter scatter) const
inlinevirtual

Compute the value of the PDF for a scattering position using the bxdf properties.

Parameters
scatterscattering position to evaluate
Returns
the value of the PDF

Reimplemented in PbrSssScatter, PbrVolumeTpl< PHASE_MODE >, and PbrSssRandomWalk.

void PbrBxdf::set_bxdf_normalisation ( const PbrBxdfNormalisation normalisation)
inline

set_bxdf_normalisation Set a normalisation to the bxdf

Parameters
normalisationA scratchpad pointer on a normalisation
void PbrBxdf::set_directional_absorption ( const PbrDirectionalAbsorption absorption)
inline

set_directional_absorption Set an abosrption to the bxdf

Parameters
absorptionA scratchpad pointer on an absorption
void PbrBxdf::set_fresnel ( const PbrFresnel fresnel)
inline

set_fresnel Set a fresnel to the bxdf

Parameters
fresnelA scratchpad pointer on a fresnel