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

Lights are positioned at the coordinate origin of the local light space. More...

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

Public Member Functions

General methods
virtual Light_type  get_type () const =0
  Returns the light type. More...
 
virtual void  set_type (Light_type type)=0
  Sets the light type. More...
 
virtual Light_area_shape  get_area_shape () const =0
  Returns the area light shape. More...
 
virtual void  set_area_shape (Light_area_shape light_area_shape)=0
  Sets the area light shape. More...
 
virtual Float64  get_spread () const =0
  Returns the cosine of the cone opening angle. More...
 
virtual void  set_spread (Float64 spread)=0
  Sets the cosine of the cone opening angle. More...
 
virtual Float64  get_distance () const =0
  Returns the maximum distance from the origin that the light can reach. More...
 
virtual void  set_distance (Float64 distance)=0
  Sets the maximum distance from the origin that the light can reach. More...
 
virtual Float64  get_area_radius () const =0
  Returns the radius of the area for area lights. More...
 
virtual void  set_area_radius (Float64 radius)=0
  Sets the radius of the area for area lights. More...
 
virtual Float64  get_area_size_x () const =0
  Returns the size of the area in x direction for area lights. More...
 
virtual void  set_area_size_x (Float64 size_x)=0
  Sets the size of the area in x direction for area lights. More...
 
virtual Float64  get_area_size_y () const =0
  Returns the size of the area in y direction for area lights. More...
 
virtual void  set_area_size_y (Float64 size_y)=0
  Sets the size of the area in y direction for area light types. More...
 
Methods related to MetaSL (deprecated)
virtual Sint32  attach_light_definition (const char *name)=0
  Attaches a light definition to this light. More...
 
virtual void  detach_light_definition ()=0
  Detaches the light definition from this light. More...
 
virtual const IShader_graph access_light_definition () const =0
  Returns the light definition of this light. More...
 
virtual IShader_graph edit_light_definition () const =0
  Returns the light definition of this light. More...
 
virtual Sint32  attach_shader (Shader_type type, const char *name)=0
  Attaches a shader to the light. More...
 
virtual Sint32  detach_shader (Shader_type type)=0
  Detaches a shader from the light. More...
 
virtual const IShader access_shader (Shader_type type) const =0
  Returns a shader attached to the light. 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< 0xc9a437cf, 0x6d47, 0x4666, 0x9c, 0xf6, 0xa4, 0x3f, 0x50, 0xe8, 0x0b, 0x90, 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< 0xc9a437cf, 0x6d47, 0x4666, 0x9c, 0xf6, 0xa4, 0x3f, 0x50, 0xe8, 0x0b, 0x90, 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

Lights are positioned at the coordinate origin of the local light space.

Spots, directionals, and area light sources point down the negative z -axis, like the camera. (This differs from the .mi scene file syntax, where lights can have origins, directions, and area edge and axis vectors; Iray folds this information into the light instance transformation. As a consequence, it is not possible to define an area for a spot light whose area orientation is different from the spot orientation. The spot orientation takes precedence.)

Note that there are methods specific to MetaSL, but no methods specific to MDL. For MDL, simply attach a material instance via the material attribute, similar as for geometry objects.

For MetaSL, note that there can be either a light shader or a light definition attached to the light. Attaching a light definition detaches the light shader (if one is attached) and vice versa.

Member Function Documentation

virtual const IShader_graph* mi::ILight::access_light_definition ( ) const
pure virtual

Returns the light definition of this light.

Note
Always returns NULL if no light definition is attached.
virtual const IShader* mi::ILight::access_shader ( Shader_type  type) const
pure virtual

Returns a shader attached to the light.

Parameters
type The shader type to attach. Valid shader types are mi::LIGHT_SHADER.
Returns
The shader of the specified type, or NULL if there is no such shader attached.
virtual Sint32 mi::ILight::attach_light_definition ( const char *  name)
pure virtual

Attaches a light definition to this light.

Replaces the old light definition if there was one attached. This method also detaches the light shader of the light (if there was one attached).

Returns
  • 0: Success.
  • -1: Invalid parameters (NULL pointer).
  • -2: There is no element with that name.
  • -3: The element can not be attached to the light because it is in a more private scope than the light.
  • -4: The element is not a light definition.
virtual Sint32 mi::ILight::attach_shader ( Shader_type  type,
const char *  name 
)
pure virtual

Attaches a shader to the light.

Any previously attached shader of that type is automatically detached. This method also detaches the light definition (if there was one attached).

Parameters
type The shader type to attach. Valid shader types are mi::LIGHT_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 light because it is in a more private scope than the light.
virtual void mi::ILight::detach_light_definition ( )
pure virtual

Detaches the light definition from this light.

Ignored if there was none attached.

virtual Sint32 mi::ILight::detach_shader ( Shader_type  type)
pure virtual

Detaches a shader from the light.

Parameters
type The shader type to attach. Valid shader types are mi::LIGHT_SHADER.
Returns
  • 0: Success.
  • -1: Invalid parameters (NULL pointer or invalid enum value).
  • -2: There was no shader of that type attached.
virtual IShader_graph* mi::ILight::edit_light_definition ( ) const
pure virtual

Returns the light definition of this light.

Note
Always returns NULL if no light definition is attached.
virtual IShader* mi::ILight::edit_shader ( Shader_type  type) const
pure virtual

Returns the specified shader.

Parameters
type The shader type to attach. Valid shader types are mi::LIGHT_SHADER.
Returns
The shader of the specified type, or NULL if there is no such shader attached.
virtual Float64 mi::ILight::get_area_radius ( ) const
pure virtual

Returns the radius of the area for area lights.

This value is only meaningful for lights of type mi::AREA_DISC, mi::AREA_SPHERE, and mi::AREA_CYLINDER.

virtual Light_area_shape mi::ILight::get_area_shape ( ) const
pure virtual

Returns the area light shape.

virtual Float64 mi::ILight::get_area_size_x ( ) const
pure virtual

Returns the size of the area in x direction for area lights.

This value is only meaningful for lights of type mi::AREA_RECTANGLE and mi::AREA_CYLINDER. For cylindrical area lights, this value is half of the height of the cylinder.

virtual Float64 mi::ILight::get_area_size_y ( ) const
pure virtual

Returns the size of the area in y direction for area lights.

This value is only meaningful for lights of type mi::AREA_RECTANGLE.

virtual Float64 mi::ILight::get_distance ( ) const
pure virtual

Returns the maximum distance from the origin that the light can reach.

This value has no meaning for lights of type mi::LIGHT_INFINITE.

virtual Float64 mi::ILight::get_spread ( ) const
pure virtual

Returns the cosine of the cone opening angle.

This value is only meaningful for lights of type mi::LIGHT_SPOT.

virtual Light_type mi::ILight::get_type ( ) const
pure virtual

Returns the light type.

virtual void mi::ILight::set_area_radius ( Float64  radius)
pure virtual

Sets the radius of the area for area lights.

This value is only meaningful for lights of type mi::AREA_DISC, mi::AREA_SPHERE, and mi::AREA_CYLINDER.

virtual void mi::ILight::set_area_shape ( Light_area_shape  light_area_shape)
pure virtual

Sets the area light shape.

virtual void mi::ILight::set_area_size_x ( Float64  size_x)
pure virtual

Sets the size of the area in x direction for area lights.

This value is only meaningful for lights of type mi::AREA_RECTANGLE and mi::AREA_CYLINDER. For cylindrical area lights, this value is half of the height of the cylinder.

virtual void mi::ILight::set_area_size_y ( Float64  size_y)
pure virtual

Sets the size of the area in y direction for area light types.

This value is only meaningful for lights of type mi::AREA_RECTANGLE.

virtual void mi::ILight::set_distance ( Float64  distance)
pure virtual

Sets the maximum distance from the origin that the light can reach.

This value has no meaning for lights of type mi::LIGHT_INFINITE.

virtual void mi::ILight::set_spread ( Float64  spread)
pure virtual

Sets the cosine of the cone opening angle.

This value is only meaningful for lights of type mi::LIGHT_SPOT.

virtual void mi::ILight::set_type ( Light_type  type)
pure virtual

Sets the light type.