An instantiated material. More...
#include <mdl_generated_dag.h>
Public Member Functions | |
virtual IType_factory * | get_type_factory ()=0 |
Get the type factory of this instance. More... | |
virtual IValue_factory * | get_value_factory ()=0 |
Get the value factory of this instance. More... | |
virtual DAG_constant const * | create_constant (IValue const *value)=0 |
Create a constant node. More... | |
virtual DAG_node const * | create_call (char const *signature, IDefinition::Semantics sema, DAG_call::Call_argument const call_args[], int num_call_args, IType const *ret_type)=0 |
Create a call node. More... | |
virtual DAG_parameter const * | create_parameter (IType const *type, int index)=0 |
Create a parameter reference node. More... | |
virtual Error_code | initialize (ICall_name_resolver *resolver, IResource_modifier *resource_modifier, IGenerated_code_dag const *code_dag, size_t argc, DAG_node const *argv[], bool use_temporaries, unsigned flags, ICall_evaluator *evaluator, bool fold_meters_per_scene_unit, float mdl_meters_per_scene_unit, float wavelength_min, float wavelength_max, char const *const fold_params[], size_t num_fold_params, IType const *target_type)=0 |
Initialize this material instance. More... | |
virtual DAG_call const * | get_constructor () const =0 |
Return the material constructor of this instance. More... | |
virtual size_t | get_temporary_count () const =0 |
Return the number of temporaries of this instance. More... | |
virtual DAG_node const * | get_temporary_value (size_t index) const =0 |
Return the value of the temporary at index. More... | |
virtual size_t | get_parameter_count () const =0 |
Return the number of parameters of this instance. More... | |
virtual IValue const * | get_parameter_default (size_t index) const =0 |
Return the default value of a parameter of this instance. More... | |
virtual void | lookup_sub_expression (char const *path, DAG_node const *&node_result, IValue const *&value_result) const =0 |
Return the node determined by the path, starting from the root expression of the material instance. More... | |
virtual DAG_hash | get_sub_expression_hash (char const *path) const =0 |
Calculate the hash for the node determined by the path, starting from the root expression of the material instance. More... | |
virtual DAG_hash const * | get_hash () const =0 |
Return the hash value of this material instance. More... | |
virtual DAG_hash const * | get_slot_hash (Slot slot) const =0 |
Return the hash value of one material slot of this material instance. More... | |
virtual char const * | get_parameter_name (size_t index) const =0 |
Return the canonical parameter name of the given parameter. More... | |
virtual bool | depends_on_transform () const =0 |
Returns true if this instance depends on object transforms. More... | |
virtual bool | depends_on_object_id () const =0 |
Returns true if this instance depends on the object id. More... | |
virtual bool | depends_on_global_distribution () const =0 |
Returns true if this instance depends on the global distribution (edf). More... | |
virtual bool | depends_on_uniform_scene_data () const =0 |
Returns true if this instance depends on uniform scene data. More... | |
virtual size_t | get_referenced_scene_data_count () const =0 |
Returns the number of scene data attributes referenced by this instance. More... | |
virtual char const * | get_referenced_scene_data_name (size_t index) const =0 |
Return the name of a scene data attribute referenced by this instance. More... | |
virtual Opacity | get_opacity () const =0 |
Returns the opacity of this instance. More... | |
virtual Opacity | get_surface_opacity () const =0 |
Returns the surface opacity of this instance. More... | |
virtual IValue_float const * | get_cutout_opacity () const =0 |
Returns the cutout opacity of this instance if it is constant. More... | |
virtual Messages const & | access_messages () const =0 |
Access messages. More... | |
virtual size_t | get_memory_size () const =0 |
Returns the amount of used memory by this code material instance. More... | |
virtual Properties | get_properties () const =0 |
Get the instance properties. More... | |
virtual char const * | get_internal_space () const =0 |
Get the internal space. More... | |
virtual void | set_resource_tag (IValue_resource const *res, int tag)=0 |
Set a tag, version pair for a resource constant that might be reachable from this instance. More... | |
virtual size_t | get_resource_tag_map_entries_count () const =0 |
Get the number of resource tag map entries. More... | |
virtual Resource_tag_tuple const * | get_resource_tag_map_entry (size_t index) const =0 |
Get the i'th resource tag map entry or NULL if the index is out of bounds;. More... | |
virtual IResource_tagger * | get_resource_tagger () const =0 |
Get the resource tagger for this material instance. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from mi::base::Interface_declare< 0x29c36255, ... > | |
static bool | compare_iid (const Uuid &iid) |
Compares the interface ID iid against the interface ID of this interface and of its ancestors. More... | |
An instantiated material.
With an IGenerated_code_dag at hand, creating an instantiated material usually consists of these steps:
Instantiation flags.
Property flags of an instance.
Material slots on which hashes are calculated.
|
pure virtual |
Access messages.
|
pure virtual |
Create a call node.
signature | The signature of the called function. |
sema | The semantic of the called function. |
call_args | The call arguments of the called function. |
num_call_args | The number of call arguments. |
ret_type | The return type of the called function. |
|
pure virtual |
Create a constant node.
value | The value of the constant. |
|
pure virtual |
Create a parameter reference node.
type | The type of the parameter |
index | The index of the parameter. |
|
pure virtual |
Returns true if this instance depends on the global distribution (edf).
If this returns true
, the material body expression of this material instance might depend on the MDL edf with global distribution.
|
pure virtual |
Returns true if this instance depends on the object id.
If this returns true
, the material body expression of this material instance might depend on the MDL uniform state::object_id()
state function.
|
pure virtual |
Returns true if this instance depends on object transforms.
If this returns true
, the material body expression of this material instance might depend on the MDL uniform state::transform_*
() state functions.
|
pure virtual |
Returns true if this instance depends on uniform scene data.
|
pure virtual |
Return the material constructor of this instance.
This method returns the body expression of a material instance. This is always a call to the MDL material constructor.
|
pure virtual |
Returns the cutout opacity of this instance if it is constant.
|
pure virtual |
Return the hash value of this material instance.
This is equivalent to the call get_sub_expression_hash() with the empty path ""
.
This returns the hash-value of the body expression of this material instance.
|
pure virtual |
Get the internal space.
|
pure virtual |
Returns the amount of used memory by this code material instance.
|
pure virtual |
Returns the opacity of this instance.
|
pure virtual |
Return the number of parameters of this instance.
|
pure virtual |
Return the default value of a parameter of this instance.
index | the index of the parameter |
|
pure virtual |
Return the canonical parameter name of the given parameter.
index | the index of the parameter |
|
pure virtual |
Get the instance properties.
|
pure virtual |
Returns the number of scene data attributes referenced by this instance.
|
pure virtual |
Return the name of a scene data attribute referenced by this instance.
index | the index of the scene data attribute |
|
pure virtual |
Get the number of resource tag map entries.
|
pure virtual |
Get the i'th resource tag map entry or NULL if the index is out of bounds;.
index | the index of the resource map entry. |
|
pure virtual |
Get the resource tagger for this material instance.
Return the hash value of one material slot of this material instance.
This is equivalent to a call to get_sub_expression_path() with the path that corresponds to slot
.
slot | the material slot |
This returns the hash value of a sub expression of the material instance.
|
pure virtual |
Calculate the hash for the node determined by the path, starting from the root expression of the material instance.
When the path is empty, the result is equivalent to get_hash(). When the path corresponds to one of the predefined slots (see Slot), the result is equivalent to get_slot_hash().
path | Path of the sub expression to calculate the hash for. |
|
pure virtual |
Returns the surface opacity of this instance.
|
pure virtual |
Return the number of temporaries of this instance.
|
pure virtual |
Return the value of the temporary at index.
index | the index of the temporary |
|
pure virtual |
Get the type factory of this instance.
Use this factory to create or import types owned by this instance.
|
pure virtual |
Get the value factory of this instance.
Use this factory to create or import values owned by this instance.
|
pure virtual |
Initialize this material instance.
resolver | The call name resolver. |
resource_modifier | The resource modifier or NULL. |
code_dag | The generated code DAG. |
argc | The number of arguments. |
argv | An array of pointers to argument DAG nodes. The nodes will be imported into the material instance. |
use_temporaries | If true, hide multiple used subexpressions behind temporaries, if false, generate a true DAG. |
flags | Instantiation flags. |
evaluator | If non-NULL, use this evaluator additionally to fold intrinsic functions first. |
fold_meters_per_scene_unit | If true, occurrences of the functions state::meters_per_scene_unit() and state::scene_units_per_meter() will be folded using the mdl_meters_per_scene_unit parameter. |
mdl_meters_per_scene_unit | The value for the meter/scene unit conversion only used when folding is enabled. |
wavelength_min | The value for the state::wavelength_min() function. |
wavelength_max | The value for the state::wavelength_max() function. |
fold_params | Names of parameters to be folded in class-compilation mode (in addition to flags). |
num_fold_params | The number of parameter names to be folded. |
target_type | Requested type of the material return type, or NULL for the return type of the material call itself. |
Arguments are always given by position. If a NULL argument is given an EC_INSTANTIATION_ERROR is returned in error_code.
|
pure virtual |
Return the node determined by the path, starting from the root expression of the material instance.
If the path is invalid, both result parameters will contain NULL on return. Note that constants can be return as constant nodes, or as values, depending on how they are nested within other nodes or values.
path | Path of the sub expression to return. |
node_result | If the path names a node that is not nested within a constant, its value is stored here on return. Otherwise, NULL is stored. |
value_result | If the node named at the path is a nested constant, its value is stored here on return. Otherwise, NULL is stored. |
|
pure virtual |
Set a tag, version pair for a resource constant that might be reachable from this instance.
res | a resource |
tag | the tag value |