NVIDIA Iray API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mi::IMaterial Class Referenceabstract

Materials reference shaders of certain types. More...

Inheritance diagram for mi::IMaterial:
Inheritance graph
[legend]

Public Member Functions

virtual Sint32  attach_shader (Shader_type type, const char *name)=0
  Attaches a shader to the material . More...
 
virtual Sint32  detach_shader (Shader_type type)=0
  Detaches a shader from the material . More...
 
virtual const IShader access_shader (Shader_type type) const =0
  Returns a shader attached to the material. More...
 
virtual IShader edit_shader (Shader_type type) const =0
  Returns the specified shader. More...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0xe7a03a04, 0x5f31, 0x48c1, 0xa0, 0x92, 0x58, 0x46, 0x88, 0x77, 0x4c, 0x67, IScene_element >
typedef Interface_declare< id1,
id2, id3, id4, id5, id6, id7,
id8, id9, id10, id11,
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< 0xe7a03a04, 0x5f31, 0x48c1, 0xa0, 0x92, 0x58, 0x46, 0x88, 0x77, 0x4c, 0x67, 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

Materials reference shaders of certain types.

Note
MetaSL is deprecated. Support for MetaSL might be removed in future releases. Use MDL instead.

Typically, material are attached to objects or instances of objects via the "material" attribute.

Member Function Documentation

virtual const IShader* mi::IMaterial::access_shader ( Shader_type  type) const
pure virtual

Returns a shader attached to the material.

Parameters
type The shader type to return. Valid shader types are mi::VOLUME_SHADER, mi::ENVIRONMENT_SHADER, mi::SURFACE_SHADER, and mi::DISPLACEMENT_SHADER.
Returns
The shader of the specified type, or NULL if there is no such shader attached.
virtual Sint32 mi::IMaterial::attach_shader ( Shader_type  type,
const char *  name 
)
pure virtual

Attaches a shader to the material .

Any previously attached shader of that type is automatically detached.

Parameters
type The shader type to attach. Valid shader types are mi::VOLUME_SHADER, mi::ENVIRONMENT_SHADER, mi::SURFACE_SHADER, and mi::DISPLACEMENT_SHADER.
name The shader to attach.
Returns
  • 0: Success.
  • -1: Invalid parameters (NULL pointer or invalid enum value).
  • -2: There is no element with that name.
  • -3: The element can not be attached to the material because it is in a more private scope than the material.
virtual Sint32 mi::IMaterial::detach_shader ( Shader_type  type)
pure virtual

Detaches a shader from the material .

Parameters
type The shader type to detach. Valid shader types are mi::VOLUME_SHADER, mi::ENVIRONMENT_SHADER, mi::SURFACE_SHADER, and mi::DISPLACEMENT_SHADER.
Returns
  • 0: Success.
  • -1: Invalid parameters (NULL pointer or invalid enum value).
  • -2: There was no shader of that type attached.
virtual IShader* mi::IMaterial::edit_shader ( Shader_type  type) const
pure virtual

Returns the specified shader.

Parameters
type The shader type to return. Valid shader types are mi::VOLUME_SHADER, mi::ENVIRONMENT_SHADER, mi::SURFACE_SHADER, and mi::DISPLACEMENT_SHADER.
Returns
The shader of the specified type, or NULL if there is no such shader attached.