Overlay Material Color

Goal

The colormass configurator can be used to render custom fabric designs, which are provided as color images. Internally, the configuator embeds those images into a scanned, high-quality base material. This material contributes to the overall appearance and makes your design look like wool, cotton or linen.

Examples

The following images were created using this sample code and these two images as input:

Colorful dots image, width and height 100cm
Checkered pattern, width and height 10cm
Checkered pattern, width and height 100cm

Setting the scene

For this example, we set up a test scene on the colormass platform. It consists of a chair and uses a wool-like base material. The Overlay Material Color node takes care of replacing the color information of this material and scales your pattern to the desired width and height.

Detail settings for the Overlay Material Color node

While the base material is fixed, the overlay image as well as the width and height are transferred to the configurator via the corresponding input node (image input and number input).

Detail settings for the overlay image input node.
Detail settings for the width number input node.
Detail settings for the width number input node.

Adding the markup

Once the scene has been prepared, the configurator component can be added to the page.

To change the color pattern used programmatically, we add three simple input elements.

Adding the scripts

We use the ‘setParameters’ API, which is provided by the configurator component, to transfer the input data to the renderer. You can find a detailed explanation in our guide on setting parameters.

Putting it all together

The complete example code can also be found in our sample repository.

Last updated