RealityServer Features

Assimp exporter

The Open Asset Import Library (assimp) exporter supports a wide range of 3D file formats for export. Including but not limited to FBX, glTF, COLLADA, STL and many more.

In general when exporting content to other file formats you can expect to lose a certain amount of information as many features that are supported by RealityServer and Iray are not possible to represent in most file formats. By default when exporting scenes you will only get simple grey materials. You can however optionally enable material distillation which takes advantage of the NVIDIA MDL Distiller technology to simplify the full MDL materials into something that is suitable for export.

glTF 2.0 in particular provides one of the better options for extracting useful materials with the distiller and supports enough features to get good results.

Exporter Options

When using the exporter through the export_scene or export_scene_elements commands in RealityServer it is possible to provide additional options through the use of the export_options parameter. This parameter accepts a Map where the property key corresponds to the option name and the value to the value you want to set for the option. The table below describes the options available for the Assimp exporter. This is in addition to the standard options provided by all exporters.

Assimp Exporter Options
Property Key Default Description
split_meshes false When true the exporter will split any meshes which have multiple material ids. This allows meshes with multiple materials assigned to them to be exported. Many formats do not support multiple materials on a single mesh show splitting is required in order to allow those formats to work. Note that attribute propagation is not supported for higher level materials which may override lower level ones will not be considered.
distill_materials false When true the exporter will distill any materials referenced by the elements to export down to a much simpler material model which is suitable for export to a variety of formats. This would be very similar to running the mdl_distill_material command on each material and putting the results into a simple material. Currently the specular_glossy distilling target is used to provide compatibility with the KHR_materials_pbrSpecularGlossiness extension of glTF 2.0. Some properties that are set are glTF 2.0 specific while others will work in any supported file format. When exporting to glTF 2.0 with distilling enabled you will get the most comprehensive material representation from the distiller. Other formats may only provide simple diffuse textures but you will likely still get more of the material converted than without the distiller.
baker_options null A map where the property key is the name of the available baker option and the values are values of the appropriate type. The baker options which can be provided within this map are described in the entries that follow in this table.
baker_options.baker_gpu_id 0 The device ID of the GPU to be used for baking. Ignored if baker_resource is set to cpu.
baker_options.baker_resolution { "x": 1024, "y": 1024 } The resolution for baked textures. Provided as a map with an x and y key with their values representing the resolution in width and height respectively.
baker_options.baker_resource gpu_with_cpu_fallback String representing what resource to use for performing the baking. Can be gpu_with_cpu_fallback, gpu or cpu.
baker_options.baker_samples 16 Number of total samples for baking uniform expressions or total number of samples per pixel when baking varying expressions.
baker_options.baker_format jpg String representing the lowercase extension of the file format to be used when baking textures for varying expressions. Currently only jpg and png are supported. Please note that this may not be honoured in situations where baking requires the use of an alpha channel. For any such textures png will be used.
baker_options.quality 100 String representing the quality used when saving to image formats that support compression.
baker_options.gamma 2.2 Number for the gamma to be used when encoding the baked textures. In general this should be 2.2 however this option is exposed for special cases where it may need to be changed. Note that internally the alpha channel if used to encode glossiness or opacity is forced to be linear.

Example: Exports a glTF 2.0 file and sets various options.

{
    "method": "export_scene",
    "params": {
        "scene_name": "my_scene",
        "filename": "my_file.gltf",
        "export_options": {
            "distill_materials": true,
            "baker_options": {
                "baker_gpu_id": 0
                "baker_resolution": { "x": 1024, "y": 1024 },
                "baker_resource": "gpu_with_cpu_fallback",
                "baker_samples": 8,
                "baker_format": "jpg",
                "baker_quality": "95",
                "baker_gamma": 2.2
            }
        }
    }
}

Limitations

The Assimp exporter cannot handle every potential scene configuration and in some cases may be unexpected results. Here are the currently known limitations.

  • Meshes with multiple materials are not supported. Only the first material is used.
  • Material attribute inheritance is not supported, only the material attribute on the instance directly referencing the geometry is used.
  • The baking process used in material distillation also bakes any texture transformations that are included in the material. This means that materials may not tile correctly after distillation.
  • Emission is baked to textures without a high dynamic range to may be clipped.