Iray Programmer's Manual

The .axf material file format

The AxF file format from X-Rite stores digital material representations, most notably measured materials from their BTF scanning technology. The format supports different representations categorized in profiles. We support currently the base profile with its Spatially Varying BRDF representations. These representations use a simple material model and a set of textures to control the input parameters of those material models.

The AxF file format is supported in neuray with an import plugin for the .axf file extension and a corresponding MDL module. Once both parts have been set up properly, an import of AxF files works in the same way as an import of MDL modules. The result of an AxF file import is then a MDL material in the neuray database with the respective textures from the AxF file set for its parameters. If available, additional preview images are also imported into the database.

Prerequisites before importing AxF files

  1. The AxF importer is a neuray plugin, which is contained in the neuray release. To enable AxF file support in your application you need to load the plugin explicitly in neuray using the mi::neuraylib::IPlugin_configuration::load_plugin_library() or mi::neuraylib::IPlugin_configuration::load_plugins_from_directory() methods. The latter allows you to offer automatic plugin loading from a specified directory.

  2. For the importer to function properly, you need to place the MDL file nvidia/axf_importer/axf_importer.mdl, which is in the mdl directory of the neuray release, with its directory structure in a place where neuray will find it in your application. In particular, your MDL search path needs to be configured to find the nvidia directory. See mi::neuraylib::IRendering_configuration for more details on how to configure the search path.

  3. AxF files are imported in the same way as MDL files, thus the MDL search path must be configured by you to point to the AxF files. See mi::neuraylib::IRendering_configuration for more details on how to configure the search path.

Importing AxF files

Axf files with the .axf extension are imported in the same way as MDL files. You can import them using the corresponding API calls and you can include them in .mi files.

  • You can import AxF files with the neuray API function mi::neuraylib::IImport_api::import_elements(). Similar to MDL file imports, URIs to AxF files cannot be given as absolute paths and the directory of the AxF file has to be in the configured set of MDL paths, as explained in the previous section. An URI could look for example:

  • You can use the regular include statement in a .mi file to import an AxF file, for example:

    $include "axf_file.axf"

Import results in the database

The AxF importer loads the AxF file and converts its base profile representation to an equivalent MDL material. It creates the following elements in the neuray database:

  1. The textures for the base profile representation.

  2. A new MDL material is created as a variant of the nvidia/axf_importer/axf_importer/svbrdf material, where the imported textures are used as new default values for the respective texture2d parameters. Those parameters are annotated as hidden() parameters, while the other parameters remain visible for later parameter editing when the material is instantiated and assigned to objects.

    For example, if the AxF file is called example_file.axf, then the corresponding MDL material will be located in a new MDL module named mdl::axf::example_file, and the MDL material will be named like the AxF material in the AxF file, for example Leather, followed by the representation (currently always _svbrdf). The fully qualified MDL material name is then in this example mdl::axf::example_material::Leather_svbrdf.

    The new MDL module is not automatically saved to disk.

  3. AxF files can contain preview images of a material at different resolutions. They are also imported and placed in the database.

If you use the API function mi::neuraylib::IImport_api::import_elements(), you can get the database names of all imported elements from the returned import result.