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 | Static Public Member Functions | Protected Member Functions | List of all members
ModuleMaterialPhysical Class Reference
Inheritance diagram for ModuleMaterialPhysical:
ModuleMaterial ModuleProjectItem ModuleObject OfModule ResourceUser EventObject CoreCustomData CoreBaseObject CoreBaseType

Public Types

enum  AovName {
  AOV_DIFFUSE = 0,
  AOV_DIFFUSE_TRANSMISSION,
  AOV_DIFFUSE_TRANSMISSION_K,
  AOV_DIFFUSE_TRANSMISSION_I,
  AOV_DIFFUSE_TRANSMISSION_I_DIRECT,
  AOV_DIFFUSE_TRANSMISSION_I_INDIRECT,
  AOV_DIFFUSE_REFLECTION,
  AOV_DIFFUSE_REFLECTION_K,
  AOV_DIFFUSE_REFLECTION_I,
  AOV_DIFFUSE_REFLECTION_I_DIRECT,
  AOV_DIFFUSE_REFLECTION_I_INDIRECT,
  AOV_GLOSSY,
  AOV_GLOSSY_TRANSMISSION,
  AOV_GLOSSY_TRANSMISSION_K,
  AOV_GLOSSY_TRANSMISSION_I,
  AOV_GLOSSY_TRANSMISSION_I_DIRECT,
  AOV_GLOSSY_TRANSMISSION_I_INDIRECT,
  AOV_GLOSSY_REFLECTION,
  AOV_GLOSSY_REFLECTION_K,
  AOV_GLOSSY_REFLECTION_I,
  AOV_GLOSSY_REFLECTION_I_DIRECT,
  AOV_GLOSSY_REFLECTION_I_INDIRECT,
  AOV_SPECULAR,
  AOV_SPECULAR_TRANSMISSION,
  AOV_SPECULAR_TRANSMISSION_K,
  AOV_SPECULAR_TRANSMISSION_I,
  AOV_SPECULAR_REFLECTION,
  AOV_SPECULAR_REFLECTION_K,
  AOV_SPECULAR_REFLECTION_I,
  AOV_SPEC_GLOSS,
  AOV_SPEC_GLOSS_TRANSMISSION,
  AOV_SPEC_GLOSS_REFLECTION,
  AOV_SUBSURFACE,
  AOV_SUBSURFACE_K,
  AOV_SUBSURFACE_I,
  AOV_SUBSURFACE_I_DIRECT,
  AOV_SUBSURFACE_I_INDIRECT,
  AOV_VOLUME,
  AOV_VOLUME_K,
  AOV_VOLUME_I,
  AOV_VOLUME_I_DIRECT,
  AOV_VOLUME_I_INDIRECT,
  AOV_EMISSION,
  AOV_LIGHT_DIRECTION,
  AOV_LIGHT_RADIANCE,
  AOV_COUNT
}
 
enum  ShadowCastingMode {
  SHADOW_CASTING_MODE_OPAQUE = 0,
  SHADOW_CASTING_MODE_ARTISTIC = 1,
  SHADOW_CASTING_MODE_PSEUDO_CAUSTICS = 2,
  SHADOW_CASTING_MODE_PHYSICAL = 3
}
 
enum  CausticsMode {
  CAUSTICS_MODE_OFF = 0,
  CAUSTICS_MODE_GLOSSY_ONLY,
  CAUSTICS_MODE_SPECULAR_ONLY,
  CAUSTICS_MODE_FULL,
  CAUSTICS_MODE_COUNT
}
 
- Public Types inherited from ModuleMaterial
typedef unsigned long long Flags
 

Public Member Functions

void configure (const CtxEval &local_eval_ctx, CtxShader &ctx, const PbrRecursionData &recursion_data, PbrMaterialConfig &config) const
 
void set_emission_color (const GMathVec3f &emission_color, bool is_varying)
 
void set_emission_weight (float emission_weight, bool is_varying)
 
float evaluate_emission_weight (const CtxEval &eval_ctx, CtxShader &shader_ctx) const
 
void evaluate_emission_color (const CtxEval &eval_ctx, CtxShader &shader_ctx, GMathVec3f &emission_color) const
 
const
MaterialPhysicalEmissiveValues
get_emissive_values () const
 
void get_raytrace_opacity (const CtxEval &eval_ctx, CtxShader &shader_ctx, GMathVec3f &opacity, GMathVec3f &attenuation) const
 Get the opacity according to the current fragment.
 
bool is_opacity_textured () const
 Get whether the opacity of the material defined by 'opacity' attribute is textured.
 
void get_opacity (const CtxEval &eval_ctx, CtxShader &shader_ctx, GMathVec3f &opacity) const
 Get the opacity of the material defined by 'opacity' attribute.
 
void get_shadow_opacity (const CtxEval &eval_ctx, CtxShader &shader_ctx, GMathVec3f &opacity, GMathVec3f &attenuation) const
 Get the opacity for shadow rays (might be called by get_opacity)
 
virtual void pre_deferred_shading_group (const CtxEval &eval_ctx, CtxShader &ctx, GeometryDeferredShadingGroup &shading_group) const
 
virtual void get_deferred_shading_data (const CtxEval &eval_ctx, CtxShader &ctx, GeometryDeferredShadingData *shading_data, GMathVec3f &extinction, GMathVec3f &opacity) const
 
void evaluate_sampling_constants (const CtxEval &eval_ctx, CtxShader &shader_ctx, CtxPbrSamplingConstants &sampling_constants) const
 
void get_max_depth (CtxPbrDepthConstants &default_depth) const
 
const UniqueStringget_lpe_label (const CtxEval &eval_ctx, CtxShader &shader_ctx) const
 
unsigned int get_max_depth (const PbrChannelIndex &channel_index, const unsigned int &default_value) const
 
const double & get_russian_roulette (const double &default_value) const
 
const double & get_roughness_threshold (const double &default_value) const
 
const double & get_sampling_clipping_distance (const double &default_value) const
 
const bool & is_smoothed () const
 
void write_builtin_aovs (const bool &write)
 
const CausticsMode & get_refractive_caustics_mode () const
 
const CausticsMode & get_reflective_caustics_mode () const
 
virtual void on_flags_changed (const OfAttr *changing_attr, const Flags &flags=0) const override
 Must be called from on_attribute_change() when changing the flag of the current material.
 
void enable_deferred_shading ()
 
void disable_deferred_shading ()
 
bool is_shading_deferred () const
 
void enable_deferred_opacity ()
 
void disable_deferred_opacity ()
 
bool is_opacity_deferred () const
 
void enable_black_hole ()
 
void disable_black_hole ()
 
bool is_black_hole (const CtxEval &eval_ctx, CtxShader &shader_ctx) const
 
bool is_sss_group_valid () const
 
const unsigned int & get_sss_group_id () const
 
void set_sss_group_id (const unsigned int &sss_group_id)
 
double get_multiple_scattering_strength () const
 
unsigned int get_sidedness () const
 
void shade (const CtxEval &eval_ctx, CtxShader &shader_ctx, const bool &export_lpe, GMathVec3f &color, GMathVec3f &direct_opacity, GMathVec3f &indirect_opacity)
 
void shade_deferred (const CtxEval &eval_ctx, CtxShader &shader_ctx, GMathVec3f &color, GMathVec3f &opacity, ShadingOutput &shading_output)
 
void get_BXDF_types_caustics_filter (CoreVector< BxDFTypeFlags > &filters) const
 
void configure_pbr_context (CtxPbrShader &pbr_ctx, const CtxEval &eval_ctx, CtxShader &shader_ctx, const ModuleSceneObject *scene_object) const
 
- Public Member Functions inherited from ModuleMaterial
bool is_transparent (const unsigned int &ray_type) const
 Returns whether the material is transparent for the specified ray type or not.
 
const unsigned int & get_transparency_mask () const
 Returns the transparency mask defining for each type of ray whether the material is transparent or not.
 
const float & get_max_transparency () const
 Returns the maximum transparency value of the material.
 
const bool & is_exporting_aovs () const
 Returns whether the material exports aovs.
 
void build_aov_list () const
 update the aov list of nescessary
 
const CoreBasicArray< short > & get_aovs_groups () const
 Returns the list of AOVs that have been declared in the material. Includes AOV that are defined by AOV stores referenced by the material.
 
const CoreBasicArray< OfObject * > & get_aov_stores () const
 Returns the list of AOV store nodes that are referenced by the material.
 
void set_aov_list_dirty (const bool &dirtiness)
 Tells the material that is need to update its internal AOV list.
 
void set_is_transparent (const unsigned int &transparency_mask)
 Sets the transparency mask.
 
void set_is_transparent (const unsigned int &ray_type, const bool &is_transparent)
 Set the transparency for a given ray_type.
 
void set_max_transparency (const float &transparency)
 Set the maximum transparency value for the material.
 
void aov_store (const CtxEval &eval_ctx, CtxShader &ctx, CoreBasicArray< float > &aov_values, const GMathVec3f &opacity=GMathVec3f(1.0f)) const
 Store aov store values in the shader context.
 
void shade_basic (const CtxEval &eval_ctx, CtxShader &ctx, GMathVec3f *color, GMathVec3f *opacity=0, CoreBasicArray< float > aov_values=CoreBasicArray< float >(0, 0)) const
 Basic shading of the material that should work for any kind of integration model.
 
const Flags & get_flags () const
 Get flags that are enabled on the current material.
 
void enable_flags (const Flags &flags)
 Enable flags on the current material.
 
void disable_flags (const Flags &flags)
 Disable flags on the current material.
 
void enable_emissive ()
 
void disable_emissive ()
 
bool is_emissive () const
 
void enable_composite ()
 
void disable_composite ()
 
bool is_composite () const
 

Static Public Member Functions

static CORE_FORCE_INLINE const
CoreString
get_aov_name (const AovName &name)
 
static CORE_FORCE_INLINE const
CoreString
get_aov_desc (const AovName &name)
 
static bool is_shading_deferred (const ModuleMaterial::Flags &flags)
 
static bool is_shading_deferred (const ModuleMaterial &material)
 
static bool is_opacity_deferred (const ModuleMaterial::Flags &flags)
 
static bool is_opacity_deferred (const ModuleMaterial &material)
 
static bool is_physical (const ModuleMaterial::Flags &flags)
 
static bool is_physical (const ModuleMaterial &material)
 
static bool is_black_hole (const ModuleMaterial::Flags &flags)
 
static bool is_black_hole (const ModuleMaterial &material)
 
static const Flags & get_deferred_shading_flag ()
 
static const Flags & get_deferred_opacity_flag ()
 
static const Flags & get_physical_flag ()
 
static const Flags & get_black_hole_flag ()
 
static void get_global_sss_group_names (CoreVector< CoreString > &names)
 Get the registered property names.
 
static unsigned int register_sss_group (const CoreString &name)
 Globally registers the given name as available properties.
 
static void set_volume_depth_from_diffuse_depth (OfObject &object)
 
- Static Public Member Functions inherited from ModuleMaterial
static const unsigned int & get_object_count (OfApp &application)
 Returns the peak number of ModuleMaterial objects that have been created in the current Clarisse instance.
 
static Flags reserve_flag ()
 Get a flag that is not used yet and reserve it.
 
static bool is_emissive (const ModuleMaterial::Flags &flags)
 
static bool is_emissive (const ModuleMaterial &material)
 
static const Flags & get_emissive_flag ()
 
static bool is_composite (const ModuleMaterial::Flags &flags)
 
static bool is_composite (const ModuleMaterial &material)
 
static const Flags & get_composite_flag ()
 

Protected Member Functions

void pre_integrate (const CtxEval &local_eval_ctx, CtxShader &shader_ctx, CtxPbrShader &pbr_ctx, const ModuleSceneObject *scene_object)
 
virtual void module_constructor (OfObject &object) override
 
virtual void on_attribute_change (const OfAttr &attr, int &dirtiness, const int &dirtiness_flags) override
 
virtual void build_aov_list (CoreSet< short > &aov_list) const override
 This function will add aov_store AOV group to the list, extend it if the material needs to declare more AOVs.
 
- Protected Member Functions inherited from ModuleMaterial
const unsigned int & get_of_module_id () const
 

Additional Inherited Members

- Static Public Attributes inherited from ModuleObject
static constexpr unsigned int null_variation = 0
 Key of the null resource variation.
 

Member Function Documentation

void ModuleMaterialPhysical::evaluate_emission_color ( const CtxEval eval_ctx,
CtxShader shader_ctx,
GMathVec3f &  emission_color 
) const

evaluate the emission color of the material

float ModuleMaterialPhysical::evaluate_emission_weight ( const CtxEval eval_ctx,
CtxShader shader_ctx 
) const

evaluate the emission intensity of the material

void ModuleMaterialPhysical::on_flags_changed ( const OfAttr changing_attr,
const Flags &  flags = 0 
) const
overridevirtual

Must be called from on_attribute_change() when changing the flag of the current material.

Parameters
changing_attrattribute currently changing
flagsoptional flags having just been enabled or disabled

Reimplemented from ModuleMaterial.

void ModuleMaterialPhysical::set_emission_color ( const GMathVec3f &  emission_color,
bool  is_varying 
)

Set the constant emission color of this material and specify if it's varying over the geometry surface

void ModuleMaterialPhysical::set_emission_weight ( float  emission_weight,
bool  is_varying 
)

Set the constant emission weight of this material and specify if it's varying over the geometry surface