MDL SDK API nvidia_logo_transpbg.gif Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mi::neuraylib::IMaterial_instance Class Referenceabstract

This interface represents a material instance. More...

Inheritance diagram for mi::neuraylib::IMaterial_instance:
mi::base::Interface_declare< 0x037ec156, 0x281d, 0x466a, 0xa1, 0x56, 0x3e, 0xd6, 0x83, 0xe9, 0x5a, 0x00, neuraylib::IScene_element > mi::neuraylib::IScene_element mi::base::Interface_declare< 0x8a2a4da9, 0xe323, 0x452c, 0xb8, 0xda, 0x92, 0x45, 0x67, 0x85, 0xd7, 0x78, neuraylib::IAttribute_set > mi::neuraylib::IAttribute_set mi::base::Interface_declare< 0x1bcb8d48, 0x10c1, 0x4b3e, 0x9b, 0xfa, 0x06, 0x23, 0x61, 0x81, 0xd3, 0xe1 > mi::base::IInterface

Public Types

enum  Compilation_options {
  DEFAULT_OPTIONS = 0,
  CLASS_COMPILATION = 1
}
 Various options for the creation of compiled materials. More...
 
- Public Types inherited from mi::base::Interface_declare< 0x037ec156, 0x281d, 0x466a, 0xa1, 0x56, 0x3e, 0xd6, 0x83, 0xe9, 0x5a, 0x00, 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...
 

Public Member Functions

virtual ICompiled_materialcreate_compiled_material (Uint32 flags, IMdl_execution_context *context=0) const =0
 Creates a compiled material. More...
 
virtual const char * get_material_definition () const =0
 See Materials are functions and mi::neuraylib::IFunction_call::get_function_definition(). More...
 
virtual const char * get_mdl_material_definition () const =0
 See Materials are functions and mi::neuraylib::IFunction_call::get_mdl_function_definition(). More...
 
virtual const ITypeget_return_type () const =0
 See Materials are functions and mi::neuraylib::IFunction_call::get_return_type(). More...
 
virtual Size get_parameter_count () const =0
 See Materials are functions and mi::neuraylib::IFunction_call::get_parameter_count(). More...
 
virtual const char * get_parameter_name (Size index) const =0
 See Materials are functions and mi::neuraylib::IFunction_call::get_parameter_name(). More...
 
virtual Size get_parameter_index (const char *name) const =0
 See Materials are functions and mi::neuraylib::IFunction_call::get_parameter_index(). More...
 
virtual const IType_listget_parameter_types () const =0
 See Materials are functions and mi::neuraylib::IFunction_call::get_parameter_types(). More...
 
virtual const IExpression_listget_arguments () const =0
 See Materials are functions and mi::neuraylib::IFunction_call::get_arguments(). More...
 
virtual Sint32 set_arguments (const IExpression_list *arguments)=0
 See Materials are functions and mi::neuraylib::IFunction_call::set_arguments(). More...
 
virtual Sint32 set_argument (Size index, const IExpression *argument)=0
 See Materials are functions and mi::neuraylib::IFunction_call::set_argument(Size,const IExpression*). More...
 
virtual Sint32 set_argument (const char *name, const IExpression *argument)=0
 See Materials are functions and mi::neuraylib::IFunction_call::set_argument(const char*,const IExpression*). More...
 
virtual Sint32 reset_argument (Size index)=0
 See Materials are functions and mi::neuraylib::IFunction_call::reset_argument(Size). More...
 
virtual Sint32 reset_argument (const char *name)=0
 See Materials are functions and mi::neuraylib::IFunction_call::reset_argument(const char*). More...
 
virtual bool is_default () const =0
 See Materials are functions and mi::neuraylib::IFunction_call::is_default(). More...
 
virtual bool is_valid (IMdl_execution_context *context) const =0
 See Materials are functions and mi::neuraylib::IFunction_call::is_valid(). More...
 
virtual Sint32 repair (Uint32 flags, IMdl_execution_context *context)=0
 See Materials are functions and mi::neuraylib::IFunction_call::repair(). More...
 

Additional Inherited Members

- Static Public Member Functions inherited from mi::base::Interface_declare< 0x037ec156, 0x281d, 0x466a, 0xa1, 0x56, 0x3e, 0xd6, 0x83, 0xe9, 0x5a, 0x00, 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...
 

Detailed Description

This interface represents a material instance.

This interface is almost obsolete. See Materials are functions and mi::neuraylib::IFunction_call. The only remaining purpose is the method create_compiled_material() and the associated enum Compilation_options.

Member Enumeration Documentation

Various options for the creation of compiled materials.

See Also
create_compiled_material()
Enumerator
DEFAULT_OPTIONS 

Default compilation options (e.g., instance compilation).

CLASS_COMPILATION 

Selects class compilation instead of instance compilation.

Member Function Documentation

virtual ICompiled_material* mi::neuraylib::IMaterial_instance::create_compiled_material ( Uint32  flags,
IMdl_execution_context context = 0 
) const
pure virtual

Creates a compiled material.

Parameters
flagsA bitmask of flags of type Compilation_options.
[in,out]contextAn optional pointer to an execution context which can be used to pass compilation options to the MDL compiler. The following options are supported for this operation:
  • mi::Float32 "meters_per_scene_unit": The conversion ratio between meters and scene units for this material. Default: 1.0f.
  • mi::Float32 "wavelength_min": The smallest supported wavelength. Default: 380.0f.
  • mi::Float32 "wavelength_max": The largest supported wavelength. Default: 780.0f.
The following options are supported in class compilation mode:
  • bool "fold_ternary_on_df": Fold all ternary operators of *df types. Default: false.
  • bool "fold_all_bool_parameters": Fold all bool parameters. Default: false.
  • bool "fold_all_enum_parameters": Fold all enum parameters. Default: false.
  • mi::base::IInterface *"fold_parameters": A static or dynamic array of strings of the parameters to fold. The names of the parameters are those that would otherwise be reported in mi::neuraylib::ICompiled_material::get_parameter_name(). Default: NULL
  • bool "fold_trivial_cutout_opacity": Fold the expression for geometry.cutout_opacity if it evaluates to a constant with value 0.0f or 1.0f. Default: false.
  • bool "fold_transparent_layers": Calls to the functions df::weighted_layer(), df::fresnel_layer(), df::custom_curve_layer(), df::measured_curve_layer(), and their equivalents with color weights, are replaced by their base argument, if the weight argument evaluates to a constant with value 0.0f, and the layer argument is one of df::diffuse_transmission_bsdf(), df::specular_bsdf(), df::simple_glossy_bsdf(), or df::microfacet_*_bsdf(), and the scatter_mode argument (if present) is either df::scatter_transmit or df::scatter_reflect_transmit. In addition, the layer argument might be a combination of such BSDFs using the ternary operator.
During material compilation, messages like errors and warnings will be passed to the context for later evaluation by the caller. Possible error conditions:
  • Type mismatch, call of an unsuitable DB element, or call cycle in the graph of this material instance.
  • The thin-walled material instance has different transmission for surface and backface.
  • An argument type of the graph of this material instance is varying but the corresponding parameter type is uniform.
  • An element in the array for the context option "fold_parameters" does not have the type mi::IString.
Returns
The corresponding compiled material, or NULL in case of failure.
virtual const IExpression_list* mi::neuraylib::IMaterial_instance::get_arguments ( ) const
pure virtual
virtual const char* mi::neuraylib::IMaterial_instance::get_material_definition ( ) const
pure virtual
virtual const char* mi::neuraylib::IMaterial_instance::get_mdl_material_definition ( ) const
pure virtual
virtual Size mi::neuraylib::IMaterial_instance::get_parameter_count ( ) const
pure virtual
virtual Size mi::neuraylib::IMaterial_instance::get_parameter_index ( const char *  name) const
pure virtual
virtual const char* mi::neuraylib::IMaterial_instance::get_parameter_name ( Size  index) const
pure virtual
virtual const IType_list* mi::neuraylib::IMaterial_instance::get_parameter_types ( ) const
pure virtual
virtual const IType* mi::neuraylib::IMaterial_instance::get_return_type ( ) const
pure virtual
virtual bool mi::neuraylib::IMaterial_instance::is_default ( ) const
pure virtual
virtual bool mi::neuraylib::IMaterial_instance::is_valid ( IMdl_execution_context context) const
pure virtual
virtual Sint32 mi::neuraylib::IMaterial_instance::repair ( Uint32  flags,
IMdl_execution_context context 
)
pure virtual
virtual Sint32 mi::neuraylib::IMaterial_instance::reset_argument ( Size  index)
pure virtual
virtual Sint32 mi::neuraylib::IMaterial_instance::reset_argument ( const char *  name)
pure virtual
virtual Sint32 mi::neuraylib::IMaterial_instance::set_argument ( Size  index,
const IExpression argument 
)
pure virtual
virtual Sint32 mi::neuraylib::IMaterial_instance::set_argument ( const char *  name,
const IExpression argument 
)
pure virtual
virtual Sint32 mi::neuraylib::IMaterial_instance::set_arguments ( const IExpression_list arguments)
pure virtual