PBR Materials in a MultiblockDataset

Is it possible to have a different pbr material for each block in a multiblock dataset?
Im trying to have a multiblock with different textures in each block. I was able to change the colors using vtkCompositePolyDataMapper2 but the PBR is an actor property.

I dont think its possible hopefully im wrong, open for suggestions or workarounds

Thanks in advance

@Timothee_Chabat

Its directly related to this post, i believe he is having the same issue but he is trying to solve in a different way, it would work for me too, associating the pbr attributes to celldata.

There is a mode in VTK+OSPRay that hooks into the IndexedColors to choose from the available materials. That way we could have one multiblock with “rubber” for the blocks that represent tires on a car and “thin glass” for blocks that represent the windshield. That could form a basis for what you are trying to do.

We did not take the next step that you are talking about and associate cell/point data, other than texture coordinates, into the materials.

1 Like

I knew it! This feature exists but I just couldn’t find it anymore … this is only for ray tracing but here’s a piece of code where the feature is tested for anyone interested : https://gitlab.kitware.com/vtk/vtk/-/blob/master/Rendering/RayTracing/Testing/Cxx/TestCategoricalMaterials.cxx.

yes this is not supported afaik, the only workaround I can think of is to split your polydata into as many mesh as you want different materials.