# PBR Materials in a MultiblockDataset

**URL:** https://discourse.vtk.org/t/pbr-materials-in-a-multiblockdataset/9816
**Category:** Development
**Created:** [November 14, 2022, 2:48pm UTC](https://discourse.vtk.org/t/pbr-materials-in-a-multiblockdataset/9816 "2022-11-14T14:48:24Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Thiago\_Neves](https://discourse.vtk.org/user_avatar/discourse.vtk.org/thiago_neves/32/4886_2.png) [@Thiago\_Neves](https://discourse.vtk.org/u/Thiago_Neves)
#### Post date: [November 14, 2022, 2:48pm UTC](https://discourse.vtk.org/t/pbr-materials-in-a-multiblockdataset/9816/1 "2022-11-14T14:48:24Z")

</div>

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

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [November 14, 2022, 2:50pm UTC](https://discourse.vtk.org/t/pbr-materials-in-a-multiblockdataset/9816/2 "2022-11-14T14:50:41Z")

</div>

@Timothee_Chabat

---

<div class="post-metadata">

### Author: ![Thiago\_Neves](https://discourse.vtk.org/user_avatar/discourse.vtk.org/thiago_neves/32/4886_2.png) [@Thiago\_Neves](https://discourse.vtk.org/u/Thiago_Neves)
#### Post date: [November 14, 2022, 3:01pm UTC](https://discourse.vtk.org/t/pbr-materials-in-a-multiblockdataset/9816/3 "2022-11-14T15:01:47Z")

</div>

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.

> [@PBR and cell data for metallic & roughness](https://discourse.vtk.org/t/pbr-and-cell-data-for-metallic-roughness/8867):
>
> With PBR, is it possible to use cell data to specify metallic and roughness properties, instead of in the vtkProperty of the actor? Our actors typically have a vtkCompositePolyDataMapper2 taking as input vtkMultiBlockDataSet with blocks of varying materials. If each material (or material class, e.g. concrete, masonry, soil, rock, … ) would require its own actor this would increase the number of actors considerably.

---

<div class="post-metadata">

### Author: ![Dave\_DeMarle](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dave_demarle/32/6_2.png) [@Dave\_DeMarle](https://discourse.vtk.org/u/Dave_DeMarle)
#### Post date: [November 15, 2022, 3:44pm UTC](https://discourse.vtk.org/t/pbr-materials-in-a-multiblockdataset/9816/4 "2022-11-15T15:44:19Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Timothee\_Chabat](https://discourse.vtk.org/user_avatar/discourse.vtk.org/timothee_chabat/32/3234_2.png) [@Timothee\_Chabat](https://discourse.vtk.org/u/Timothee_Chabat)
#### Post date: [November 28, 2022, 8:32am UTC](https://discourse.vtk.org/t/pbr-materials-in-a-multiblockdataset/9816/5 "2022-11-28T08:32:42Z")

</div>

> [@Dave\_DeMarle](#):
>
> There is a mode in VTK+OSPRay that hooks into the IndexedColors to choose from the available materials.

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](https://gitlab.kitware.com/vtk/vtk/-/blob/master/Rendering/RayTracing/Testing/Cxx/TestCategoricalMaterials.cxx).

> [@Thiago\_Neves](#):
>
> I dont think its possible hopefully im wrong, open for suggestions or workarounds

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.
