# MultiTexture

**MultiTexture** is a shader Node which was developed exclusively for [Floor Generator](https://blendermarket.com/products/floor-generator). It allows to distribute randomly up to 16 textures on every board/tile.

<figure><img src="https://246840127-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fsg8wgbCa5gHoFBgWbb5h%2Fuploads%2F1H0ODtyL63n7cHTOX8bI%2Fmaterial_v1.3.jpg?alt=media&#x26;token=cb6c486d-5208-4aa8-a1eb-917e86177bb5" alt=""><figcaption></figcaption></figure>

The easiest way to create a MultiTexture Material is to use a **Template MultiTexture Material** in the Floor Generator add-on.

<figure><img src="https://246840127-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fsg8wgbCa5gHoFBgWbb5h%2Fuploads%2F4itkj8PLr4eHYHIk7gCI%2FTemplateMT.jpg?alt=media&#x26;token=ea91b218-8a27-4409-9223-dba6a6ec8707" alt="" width="273"><figcaption></figcaption></figure>

If the **Template MultiTexture Material** is selected - there will appear buttons to choose textures for your new MultiTexture material. Once selected - they will be automatically connected to the nodes in the Shader Editor.

As an option it is possible to make all that manually:

## Step 1

Create a new Material and add a MultiTexture Node to it. If you connect one of the output of the MultiTexture Node to Base Color you will already see how inputs of the MultiTexture Node are distributing between boards/tiles.

<figure><img src="https://content.gitbook.com/content/sg8wgbCa5gHoFBgWbb5h/blobs/skB5xzTqm0CLObtD9qKw/007_MultiTexture_Step_1.jpg" alt="" width="563"><figcaption></figcaption></figure>

{% hint style="success" %}
For next steps it is necessary to have [Node Wrangler](https://docs.blender.org/manual/en/latest/addons/node/node_wrangler.html) add-on enabled!
{% endhint %}

## Step 2

Add your board/tile textures to the Shader Editor (<mark style="color:red;">`Shift-A`</mark> *-> Texture -> Multiple Images*).

<figure><img src="https://content.gitbook.com/content/sg8wgbCa5gHoFBgWbb5h/blobs/RZEyLEdJPeJm8z9B8HZP/008_MultipleImages.gif" alt=""><figcaption></figcaption></figure>

## Step 3

Add **Mapping** Nodes to the textures.

Select one of the texture and press [Ctrl-T](https://docs.blender.org/manual/en/latest/addons/node/node_wrangler.html#add-texture-setup) or just add a [Mapping Node](https://docs.blender.org/manual/en/latest/render/shader_nodes/vector/mapping.html). Select all textures and Mapping Node so that it stays active (last selected) - press [K](https://docs.blender.org/manual/en/latest/addons/node/node_wrangler.html#link-active-to-selected) - that will connect all textures vector inputs to the Mapping Node output.

<figure><img src="https://content.gitbook.com/content/sg8wgbCa5gHoFBgWbb5h/blobs/wx4DM2572rFWYYnrkifa/009_ConnectMapping.gif" alt=""><figcaption></figcaption></figure>

## Step 4

Now it is necessary to link an [Attribute Node](https://docs.blender.org/manual/en/latest/render/shader_nodes/input/attribute.html) to the Mapping Node Vector input. **Attribute Name** should be "*uv\_map*".

<figure><img src="https://content.gitbook.com/content/sg8wgbCa5gHoFBgWbb5h/blobs/Bx3AwEQ6La5mqPNe9LiO/009_Attribute_uv_map.jpg" alt="" width="563"><figcaption></figcaption></figure>

## Step 5

Connect all textures to the inputs of the **MultiTexture** Node. Use [Lazy Connect](https://docs.blender.org/manual/en/latest/addons/node/node_wrangler.html#lazy-connect) (<mark style="color:red;">`Alt-RMB`</mark>-drag) to speed up the process. It is OK if some inputs of the MultiTexture are empty, just use then the correct output.

<figure><img src="https://content.gitbook.com/content/sg8wgbCa5gHoFBgWbb5h/blobs/TFy44wAshHQC6vpu8YnB/010_LazyConnect.gif" alt=""><figcaption></figcaption></figure>

## Step 6

It is also possible to randomize boards using "*Col*" Attribute. In this example boards are randomly darkened using Mix Corol Node. You can use "*Col*" Attribute as a Factor Input to Mask boards randomly.

<figure><img src="https://content.gitbook.com/content/sg8wgbCa5gHoFBgWbb5h/blobs/DrFN0qom1aukF0jFCLTB/010_RandomDarken.jpg" alt=""><figcaption></figcaption></figure>

## Step 7

If you also have boards *Normal Maps* you can link them to the duplicated **MultiTexture**. They will match *Base Color* Maps.

<figure><img src="https://content.gitbook.com/content/sg8wgbCa5gHoFBgWbb5h/blobs/FANrD4ZuHGPsHz741EGV/011_NormalMaps.jpg" alt=""><figcaption></figcaption></figure>

Don't forget that Normal Maps should have *Non-Color* Color Space to work correct.

## Step 8

Set [Grout Material](https://nodecrafted.gitbook.io/floor-generator-3.0-manual/sections/materials/grout-material).
