Iray Programmer's Manual

Measured materials

Iray supports the use of measured material data as building blocks in the material model of the Material Definition Language. The more common scenarios for measured materials are:

Note that the measured data does not necessarily have to come from real measurements. On the contrary, these representations can be very useful for working with synthesized data from models that cannot be represented otherwise in MDL, such as a new BSDF model.

Measured isotropic BSDF

Measured isotropic BSDF data can represent measured reflection data (BRDF) as well as measured transmission data (BTDF). Both are represented in a single file format, the MBSDF file format documented in the appendix of the NVIDIA Material Definition Language: Language Specification [MDLSpecification]. A single file can thus describe the full scattering characteristics of a surface point.

The Iray API can load MBSDF files and represent them in the API with the mi::neuraylib::IBsdf_measurement class. This class allows the data to be edited and allows new measurement data to be created in memory without a file format requirement. Values of this class can be passed to suitable parameters of MDL materials.

In an MDL material, the measured data is represented with the bsdf_measurement type. It is used as a parameter type on the df::measured_bsdf type, which is an elemental BSDF that can be used like any other BSDF type in MDL.

The df::measured_bsdf type has a mode parameter to select which part of the measurement -- reflection, transmission, or both -- is used. This parameter takes precedence over the actually available data, which allows the testing of reflection and transmission contributions independently. If this mode parameter asks for data that is not in the measurement, an error results.

Spatially varying BSDF

To create spatial variety, you can use a parametric surface model and drive the parameters from textures mapped to the surface. This representation has also been explored in the measured materials context, where a measurement process fits a measurement to a chosen material model and provides you with a set of matching textures to be used with that model. Work in this area usually refers to this representation as a spatially varying BRDF, or SVBRDF for short.

The flexibility of MDL allows you to create matching or closely matching parameterized material models, for example, from a simple DGS model to a multi-lobed glossy carpaint with flakes. The measured textures can then be used to drive the resulting parameters. It might be necessary to pre-transform those textures in the application to match the material model chosen, or it might be possible to transform them using the texture pipeline functions in the base.mdl module.

Measured reflection curve

If the conventional Fresnel effect or the custom curve provided with the MDL material model is not sufficient, you can also measure the reflection behavior of a surface and use that data. The data is represented in MDL as an array of color measurements at equidistant angles from zero to ninety degrees from the surface normal. There is no dedicated file format for this data.

Two building blocks in MDL work with a measured refection curve:

  • measured_curve_factor: Attenuates a single underlying BSDF based on the measured reflectance curve
  • measured_curve_layer: Layers a BSDF over a base BSDF based on the measured reflectance curve

Measured light profile

Light profiles represent far-field measurements of light source emissions. As a standard file format, IES light profiles are supported in Iray.

The Iray API can load light profile files and represent them in the API by using the mi::neuraylib::ILightprofile class. This class only allows access to the data. There is no support to edit the data or create new measurement data in memory. Values of this class can be passed to suitable parameters of MDL materials.

In an MDL material, the light profile is represented by the light_profile type. It is used as a parameter type of the df::measured_edf type, which is an elemental EDF that can be used like any other EDF type in MDL.

See also Sources of light.