def METHOD_NAME(mat, vertex_color=False):
    import mitsuba as mi
    def create_bsdf_entry(mat, value, o3d_name, per_vertex):
        if per_vertex:
            return {'type': 'mesh_attribute', 'name': 'vertex_color'}
        elif o3d_name in mat.texture_maps:
            return {
                'type':
                    'bitmap',
                'bitmap':
                    mi.Bitmap(mat.texture_maps[o3d_name].as_tensor().numpy())
            }
        else:
            return {'type': 'rgb', 'value': value}
    base_color = mat.vector_properties['base_color'][0:3]
    roughness = mat.scalar_properties['roughness']
    metallic = mat.scalar_properties['metallic']
    reflectance = mat.scalar_properties['reflectance']
    anisotropy = mat.scalar_properties['anisotropy']
    bsdf_dict = {'type': 'principled'}
    bsdf_dict['base_color'] = create_bsdf_entry(mat, base_color, 'albedo',
                                                vertex_color)
    bsdf_dict['roughness'] = create_bsdf_entry(mat, roughness, 'roughness',
                                               False)
    bsdf_dict['metallic'] = create_bsdf_entry(mat, metallic, 'metallic', False)
    bsdf_dict['anisotropic'] = create_bsdf_entry(mat, anisotropy, 'anisotropy',
                                                 False)
    bsdf_dict['specular'] = reflectance
    # check for normal map
    if 'normal' in mat.texture_maps:
        nmap_dict = {'type': 'normalmap'}
        nmap_dict['normalmap'] = {
            'type': 'bitmap',
            'raw': True,
            'bitmap': mi.Bitmap(mat.texture_maps['normal'].as_tensor().numpy())
        }
        nmap_dict['bsdf'] = bsdf_dict
        bsdf = mi.load_dict(nmap_dict)
    else:
        bsdf = mi.load_dict(bsdf_dict)
    return bsdf