Light distribution from scene elements
Iray provides the mi::neuraylib::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.
|Field in mi::neuraylib::Light_type||Meaning|
|mi::neuraylib::LIGHT_POINT||Emits in all directions from origin|
|mi::neuraylib::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::neuraylib::Light_type, but by providing a light of type mi::neuraylib::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.
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::neuraylib::ILight representing the directional light to an instance node of type mi::neuraylib::IInstance and setting its transformation matrix.
The mi::neuraylib::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 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::neuraylib::IInstance to which they are attached.
The mi::neuraylib::ILight::set_area_shape() and mi::neuraylib::ILight::get_area_shape() methods of mi::neuraylib::ILight use the mi::neuraylib::Light_area_shape enum to define and acquire the shape of an area light.
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.