Iray Programmer's Manual

Light distribution from scene elements

Iray provides the mi::ILight element for the implementation of point, spot, directional and area lighting. Iray extends the notion of the environmental contribution to lighting calculation with an environment dome.

Iray also provides the ability to specify an emission distribution function in the material attached to an object instance. In this way, any object can be a source of light emission, but may also have reflective and transmissive properties as well.

The mi::ILight::set_type() and mi::ILight::get_type() methods of mi::ILight use the mi::Light_type enum to define and acquire the type of light geometry.

Field in mi::Light_type Meaning
mi::LIGHT_POINT Emits in all directions from origin
mi::LIGHT_INFINITE No origin, all light rays parallel

Point and spot lights

In Iray, point lights are positioned at the coordinate origin of the local light space. Spot lights are not defined by an enum field value of mi::Light_type, but by providing a light of type mi::LIGHT_POINT and using the spot_edf distribution function. Spot lights point down the negative z-axis, like the camera. This differs from some traditional scene description formats, in which a light can have an origin, a direction, and area edge and axis vector. Instead, Iray folds this information into the light instance transformation.

Directional lights

A directional light is a light at infinity that emits light in the direction of the negative z-axis. A different emission direction can be set by attaching the mi::ILight representing the directional light to an instance node of type mi::IInstance and setting its transformation matrix.

The mi::LIGHT_INFINITE type defines a direction but does not have a position, as point and spot lights do. The traditional use of a directional light is as an approximation of the rays of the sun, which is at such a great distance to the earth that at human scale the light rays are effectively parallel.

Area lights

Area lights specify a geometric shape that defines the source of light energy. Like directional lights, area lights are oriented through the transformation matrix of the mi::IInstance to which they are attached.

The mi::ILight::set_area_shape() and mi::ILight::get_area_shape() methods of mi::ILight use the mi::Light_area_shape enum to define and acquire the shape of an area light.

Field in mi::Light_area_shape Meaning
mi::AREA_NONE The mi::ILight instance is not an area light
mi::AREA_RECTANGLE Rectangular shape
mi::AREA_DISC Disc shape
mi::AREA_SPHERE Sphere shape
mi::AREA_CYLINDER Cylinder shape

Light-emitting objects

A material defined in the Material Definition Language (MDL) specifies distribution functions for light scattering and emission. In this way, any object in the scene may be defined as a light source and the light it emits is evaluated in a physically based manner in rendering. However, because the MDL material can also define scattering properties, an object can both emit and reflect light. In this manner, illumination effects like a dimly glowing glass sphere with reflections can also be implemented.