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
ModuleMaterial Class Reference

This class implements a Material object in Clarisse. More...

Inheritance diagram for ModuleMaterial:
ModuleProjectItem ModuleObject OfModule ResourceUser EventObject CoreCustomData CoreBaseObject CoreBaseType ModuleMaterialDefault ModuleMaterialPhysical ModuleMaterialSwitch ModuleMaterialRaySwitch

Public Types

typedef unsigned long long Flags
 

Public Member Functions

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.
 
virtual void on_flags_changed (const OfAttr *changing_attr, const Flags &flags=0) const
 Must be called from on_attribute_change() when changing the flag of 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 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

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
 This function will add aov_store AOV group to the list, extend it if the material needs to declare more AOVs.
 
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.
 

Detailed Description

This class implements a Material object in Clarisse.

Member Function Documentation

void ModuleMaterial::on_flags_changed ( const OfAttr changing_attr,
const Flags &  flags = 0 
) const
virtual

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 in ModuleMaterialPhysical.

void ModuleMaterial::shade_basic ( const CtxEval eval_ctx,
CtxShader ctx,
GMathVec3f *  color,
GMathVec3f *  opacity = 0,
CoreBasicArray< float >  aov_values = CoreBasicArray<float>(0, 0) 
) const
inline

Basic shading of the material that should work for any kind of integration model.

Parameters
eval_ctxA valid thread evaluation context
ctxThe current shading context attached to the thread evaluation context
colorPointer to the resulting color (premultiplied by the opacity): it can be null in the case we don't want to compute it
opacityPointer to the resulting opacity: it can be null in the case we don't want to compute it
aov_valuesArray in which to store AOV values