Use the ShapeDiver Display component to assign materials defined with the Preset Material or ShapeDiver Material components to geometry. The component takes two inputs: the geometry to display, and the material definition that is returned by one of the two material components mentioned above.

Applying several materials with a single component

If you want to apply different materials to different pieces of geometry, you don't need to create a ShapeDiver Display component for each geometry, instead, you can input a data tree in the Geometry input and a list of materials in the Material input. Unlike the traditional way of matching tree branches, we match each branch with an item in the materials list.

The reason why we don't use data trees in both inputs is because you can apply one material to various geometries but you can not apply various materials to one geometry.

If you need more flexibility (i.e using a different material for each piece of geometry in a large array of elements), consider using the glTF 2.0 Display component instead and define materials using the attribute system.

Preview in Grasshopper
Grasshopper will not always render accurately all the parameters from the material components. In particular, only the color texture will be part of the preview, other textures will not be previewed in Rhino. If you are using the Preset Material component, many presets use textures and specific online shaders which will not be reflected either.