• MRF - Main Page
  • Malia Renderer
  • Blender Bridge
  • Spectral Viewer
  • MRF - Scene format
  • Gallery
  • RGB To Spectral
  • For Developpers
  • Tutorials
  • MRF Blender Integration

    This page presents the MRF Blender integration for version 2.8x. For version 2.7x and older, please refer to the Blender 2.7x page.

    With MRF Blender Bridge, you can directly export and render your scenes from Blender (cf. Figure ).

    BlenderMRFMalia

    This permits to build quickly of a scene and enables easy camera setup. Blender can be downloaded from: Blender.org

    A Blender scene is exported to a MRF scene which is a combination of:

    Then we can either use Malia to render the MRF scene or call Malia directly from Blender using its interactive mode of offline mode. If SpectralViewer is available it can also be used to open the rendered image.

       

    Download

    You can pick the relevant Blender plugin depending on your platform. (Kepler builds coming soon).

    NVIDIA Card Windows Linux
    >= Maxwell Blender bridge Blender bridge

       

    Installation

    The Blender bridge can only be installed as a Blender plugin. Follow the instructions below to install it:

       

    Usage

    The control panel is composed of three panels where options can be set:

       

    Import panel

    This panel let you specify a folder where .spd files for IOR and light SPD will be looked for when exporting spectral data.

       

    Export panel

    The export component allows you to convert your Blender project in a MRF compatible scene. It has four options:

    If you only want to export the scene, you can use the export button at the bottom of this component. The exported scene can be found in the same directory than your blender scene under the same name (only the extension differs).

       

    Render Panel

    The render component allows you to launch a render with Malia (if installed), directly from Blender. It has

    If you want to render the scene while you have not exported it yet, use the export and render button. Otherwise, use the render button to launch Malia with your scene and the chosen options.

    If you click on the render button before exporting the scene, Malia will be launched in interactive mode with no scene.

       

    Scene Export Mechanism

       

    Material Export

    The following materials are currently supported by the export from Blender to MRF.

    Note that the export of textured materials from blender is very limited. More support will be added in a future version.

    The following table shows the MRF equivalent of Blender materials, depending on specific parameters. The last three columns of the table shows you their support in the Malia OptiX-based renderer as well as their cuda implementation.

    Blender Specific Parameters MRF (c++) Malia (RGB) Malia (Spectral) OptiX backend cuda file
    Diffuse BSDF Lambert YES YES lambert.cu
    Diffuse BSDF Color: CheckerTexture Checkerboard YES YES lambert.cu
    Glossy BSDF Distribution: Sharp FresnelMirror YES YES microfacet_conductor.cu
    Glossy BSDF GGX YES YES microfacet_conductor.cu
    Glass BSDF Distribution: Sharp FresnelGlass YES YES microfacet_dielectric.cu
    Glass BSDF WalterBSDF YES YES microfacet_dielectric.cu
    Mix Shader Diffuse + Glossy BSDF PhongNormalized YES YES phong.cu
    Principled BSDF Principled YES YES principled.cu

    Malia's Principled BSDF implementation only handle parameters listed in [Burley12].

    Note that some MRF materials require to have a specific name in Blender to be exported as they do not have any direct equivalent in Blender. In that case, any Blender material case be used as long as it has this specific name.

    The following table lists the name to be used for MRF specific materials.

    Blender material name MRF (c++) Malia (RGB) Malia (Spectral) OptiX backend cuda file
    MRF_Normal Normal YES NO debug_shader.cu
    MRF_Tangent Tangent YES NO debug_shader.cu
    MRF_UV UV YES NO debug_shader.cu
    MRF_Flat Flat YES NO debug_shader.cu
    MRF_ShadowCatcher ShadowCatcher YES YES debug_shader.cu

       

    Light Sources Export

    The following types of light sources are currently exported from Blender to MRF:

    Blender Light source MRF (.msf) MRF (c++)
    Area area_light QuadLight
    Point sphere_light SphereLight
    Sun dir_light DirectionalLight

    The radius of a MRF Sphere light can be controlled using the Size parameter of a Point Light in blender, see the image below.

    Export from Blender spot lights is currently not supported in Malia.

       

    Materials/Light sources with Spectral data

    We currently support two mechanisms to export material spectral data from blender:

    The conversion is done by rgb2spec, which is provided with the blender bridge.

    Importing a .spd for a material/light source will disabled the conversion from blender RGB to spectral data for that material/light source.

    To import a .spd as spectral data, you have to set a specific value to the name of the material/light source. The name must start with MRF_ followed by a relative path to the .spd file. This relative path is relative to different sub folders in the MRF_DIR folder depanding on the material type or light source. The table below shows the different subfolders where the exporter will look to find the .spd you want to export.

    Blender Material/Light source type Folder
    Any light source MRF_DIR/assets/light_sources
    Diffuse Material MRF_DIR/data/lambert
    Glossy Material MRF_DIR/assets/refractive_index/data
    Glass material MRF_DIR/assets/refractive_index/data/
    Measured Isotropic MRF_DIR/assets/measured_materials/

    An exception for this rule is made for the Measured Isotropic material, has it do not have any Blender Cycles equivalent, to export it from blender, is name must start with MRF_measured_isotropic_

    The blender file MRF_DIR/assets/scenes/material_export.blend shows some examples of material export.

       

    MRF patch mechanism

    Alongside we all the authoring options in blender for a mrf scene presented in the previous sections, another mechanism is available. The patch mechanism, it consists of a .mpf file that you can put alongside your .msf. Using the python script patch_mrf_scene.py (that you can find in MRF_DIR/tools), you can replace some nodes of you .msf scene file.

    This is particularly usefull to replace some nodes that cannot be exported from blender, for instance a PhongNormalized material (see material section). Calling this script patch_mrf_scene.py will replace the nodes of your .msf scene file by the ones present in the .mpf patch if they have the same name and type.

    Not all nodes are supported by this mechanism. Here are the currently supported nodes in a .mpf:

    When you export a scene from blender using the mrf integration, if a .mpf patch with the same name than your scene is present in the destination folder, the patch will be automatically applied at the end of the export.

    See the material_export.msf in MRF_DIR/assets.scenes for an example of this mechanism.

       

    Matching Blender Cycles renderings with MRF

    To compare ouptut images from Blender Cycles and MRF, you need to adjust the color management in Blender. Go to Scene → Color Management → Display device, set the value to None (default is sRGB). Once you have done that, the MRF render engine output should match Blender Cycles output.

       

    Limitations of the Blender Bridge

    The integration with Blender remains minimal; desired improvements include:

    Some of these limitations can be alleviated by the use of python scripts that work on the .msf file. For instance, textured objects can be obtained by replacing one material in the scene by a MRF Phong model, which handles texturing. Geometric instances may also be declared in this way. However, these are only workarounds, and better solutions should be found in the future.

    formatted by Markdeep 1.03