This interface represents a compiled material. More...
Public Member Functions | |
Common methods related to instance and class compilation | |
virtual const IData * | get_field (const char *name) const =0 |
Returns the value of a field. More... |
|
template<class T > | |
const T * | get_field (const char *name) const |
Returns the value of a field. More... |
|
virtual Uint32 | get_temporary_count () const =0 |
Returns the number of temporaries used by this material instance. More... |
|
virtual const IData * | get_temporary (Uint32 index) const =0 |
Returns the value of a temporary. More... |
|
template<class T > | |
const T * | get_temporary (Uint32 index) const |
Returns the value of a temporary. More... |
|
virtual Float32 | get_mdl_meters_per_scene_unit () const =0 |
Returns the conversion ration between meters and scene units for this material. More... |
|
virtual bool | depends_on_state_transform () const =0 |
Indicates whether this material depends on coordinate space transformations like state::transform () and related functions. More... |
|
virtual bool | depends_on_state_object_id () const =0 |
Indicates whether this material depends on state::object_id() . More... |
|
Additional methods related to class compilation | |
virtual Uint32 | get_parameter_count () const =0 |
Returns the number of parameters used by this material instance. More... |
|
virtual const char * | get_parameter_name (Uint32 index) const =0 |
Returns the name of a parameter. More... |
|
virtual const IData * | get_argument (Uint32 index) const =0 |
Returns the value of an argument. More... |
|
template<class T > | |
const T * | get_argument (Uint32 index) const |
Returns the value of an argument. More... |
|
virtual base::Uuid | get_hash () const =0 |
Returns a hash of all fields and temporaries. More... |
|
virtual base::Uuid | get_slot_hash (Material_slot slot) const =0 |
Returns the hash of a particular material slot. More... |
|
Additional Inherited Members | |
Public Types inherited from mi::base::Interface_declare< 0xb6d884c1, 0x1db5, 0x49f9, 0x88, 0x1c, 0xd2, 0x79, 0x96, 0x96, 0xd3, 0xf4, neuraylib::IScene_element > | |
typedef Interface_declare< id1, id2, id3, id4, id5, id6, id7, id8, id9, id10, id11, neuraylib::IScene_element > |
Self |
Own type. More... |
|
typedef Uuid_t< id1, id2, id3, id4, id5, id6, id7, id8, id9, id10, id11 > |
IID |
Declares the interface ID (IID) of this interface. More... |
|
Static Public Member Functions inherited from mi::base::Interface_declare< 0xb6d884c1, 0x1db5, 0x49f9, 0x88, 0x1c, 0xd2, 0x79, 0x96, 0x96, 0xd3, 0xf4, neuraylib::IScene_element > | |
static bool | compare_iid (const Uuid &iid) |
Compares the interface ID iid against the interface ID of this interface and of its ancestors. More... |
|
This interface represents a compiled material.
A compiled material is a canonical representation of a material instance including all its attachments (function calls). In this canonical representation, all attachments are resolved and common subexpressions are identified (denoted as temporaries here).
Note that there are two modes to create compiled materials: instance compilation and class compilation. In instance compilation mode all arguments of the material instance, i.e., the values and the attachments are folded and the result is a constant (basically a struct with a fixed set of fields). In class compilation mode only the attachments are folded and the result is a symbolic constant where the value arguments of the material instance are represented by symbolic placeholders. The class compilation mode allows to share the compiled representation for materials if they are structurally equivalent (the attachment structure is similar) and only the value arguments differ.
Each field of the material is either a constant value, the result of function call, or the index of a temporary or an argument. Constant values are represented by the corresponding instance of mi::IData. Function calls are represented as values of type mi::ICall. References to temporaries are represented by instances of mi::ITemporary, whose value is the index into the array of temporaries. References to arguments appear only in case of class compilation. In this case they are represented by instances of mi::IParameter, whose value is the index into the array of arguments.
|
pure virtual |
Indicates whether this material depends on state::object_id()
.
|
pure virtual |
Indicates whether this material depends on coordinate space transformations like state::transform
() and related functions.
|
pure virtual |
Returns the value of an argument.
The number of arguments equals the number of parameters.
index | The index of the argument. |
NULL
if index
is out of range.
|
inline |
Returns the value of an argument.
This templated member function is a wrapper of the non-template variant for the user's convenience. It eliminates the need to call mi::base::IInterface::get_interface(const Uuid &) on the returned pointer, since the return type already is a pointer to the type T
specified as template argument.
T | The interface type of the requested element |
index | The index of the argument. |
NULL
if index
is out of range.
|
pure virtual |
Returns the value of a field.
See [MDLLS] for details about the fields of a material.
name | The name of the field. |
NULL
if name
is invalid.
|
inline |
Returns the value of a field.
See [MDLLS] for details about the fields of a material.
This templated member function is a wrapper of the non-template variant for the user's convenience. It eliminates the need to call mi::base::IInterface::get_interface(const Uuid &) on the returned pointer, since the return type already is a pointer to the type T
specified as template parameter.
T | The interface type of the requested element |
name | The name of the field. |
NULL
if name
is invalid.
|
pure virtual |
Returns a hash of all fields and temporaries.
The hash allows to quickly identify compiled materials that have the same fields and temporaries. Note that the arguments are not included in the hash value.
|
pure virtual |
Returns the conversion ration between meters and scene units for this material.
|
pure virtual |
Returns the number of parameters used by this material instance.
|
pure virtual |
Returns the name of a parameter.
Note that the parameter name is only available if the corresponding parameter of the original material instance has a constant as argument. If that argument is an attachment, NULL
is returned.
|
pure virtual |
Returns the hash of a particular material slot.
The slots hashes allow to quickly compare slots of compiled materials. Note that the arguments are not included in the hash value.
|
pure virtual |
Returns the value of a temporary.
index | The index of the temporary. |
NULL
if index
is out of range.
|
inline |
Returns the value of a temporary.
This templated member function is a wrapper of the non-template variant for the user's convenience. It eliminates the need to call mi::base::IInterface::get_interface(const Uuid &) on the returned pointer, since the return type already is a pointer to the type T
specified as template parameter.
T | The interface type of the requested element |
index | The index of the temporary. |
NULL
if index
is out of range.
|
pure virtual |
Returns the number of temporaries used by this material instance.