Basically I have a tile which I duplicated using an array modifier to make the floor:
tile floor

Then in the node editor I created a procedural marble texture using nodes and got this:

cycles material

The problem with this image is that it looks like the texture is spread across every tile, making it look unnatural. Is there a way to make the marble texture random for each tile?

Here is the blend file: http://pasteall.org/blend/index.php?id=50738

One way of doing this would be:

Separate all your tiles as a single object so you can use the Object info node random output in order the create a tile black and white mask:

Enter image description here

You can then create another wave texture and combine it with the one you already have using the tile mask as factor:

Enter image description here

You obviously need to change the texture coordinate of the second wave to create variation. Put a color ramp node and play with its value to have stronger difference:

Enter image description here

http://pasteall.org/blend/index.php?id=50740

As @robin betts points out in the comments, if you need to keep the array modifier you can duplicate the object, do the same process, and bake the mask into a file image. Or if you want to keep a "semi" procedural creation use dupliface instead of the array.

Enter image description here

This method uses the array modifier, so you do not have to do any destructive editing to your object.

Here I modeled a single tile and use two array modifiers to make the floor.
Note the two extra vertices (highlighted in red) in the bottom left and top right corners of my tile. They are there to make the space around the tiles. It can be done in the array modifier, but doing it this way makes the nodes much easier (we do not have to worry about scaling the coordinates, or finding magic values). object set up for array modifier

With the object out of the way, here is the material.
(click for full size) cycles material nodes That all may look complex but it really is rather simple. First off you have to understand that the generated texture coordinates, go from 0 to 1 across the original object. The texture coordinates just get extrapolated out for the distance of the array modifier. (Which is why you were having the texture go across the whole floor.) In the top part of the node tree, the two Modulo nodes (math nodes with the operation set to Modulo) are what break up the texture coordinates for each tile.

This is what it looks like with just the two Modulo nodes. Very repetitive, but we have tiles, well one tile.
texture repeating on each tile
That is half of the problem solved (by just four nodes). All that is left now is to randomize the location of the texture, so there can be more then one tile.

To add randomness I'm distorting the texture coordinates with a Voronoi texture, but before that I'm distorting its coordinates. (This is the whole bottom part of the node tree.)
highlighted nodes
The four math nodes, in the blue, are to pixelate the Voronoi Texture so there is only one color per tile. That texture is what adds the variance. The way this works is the texture coordinates driving the voronoi texture get "Rounded" so instead of a nice gradient there is only one value. Thus only one point from the voronoi texture gets used. Here is what just the voronoi texture looks like after the texture coordinates get rounded.
output of the voronoi texture
Now on the other side of the voronoi texture I split the color, and use one channel for each the X and Y.The Math node set to multiply is to get bigger variance. Normally the color goes from zero (black) to one (white). Offsetting the texture by just one would not be enough. The value in this math node does not matter much, but I found it looks best when set to about the size of the array, in my case seven.

Last step is to add the two separate coordinates together (the tiles and the randomness). That is done using a Vector Math node set to add.
Vector Math node adding

The final outcome. An empty bathroom, but with nice marble tile floor and a rubber duck.

Here is the complete blend, minus the duck.

  • 1
    We need to talk about the ducks... – David-27 Nov 22 at 2:47
  • @X-27 "the ducks?" :) – David Nov 22 at 2:59

You can try the brick texture to separate each tile. Here, I tried editing your file to get something that you wanted.

enter image description here enter image description here

I was helping someone else with this issue a while ago so I'll be happy to elaborate. To change the colours and almost every setting, ONLY use the encircled Brick node. Node Setupt 1

This setup will give you: enter image description here

Simply change the colours in the circled brick node to suit your needs and the variation of colour and the patter colour will change. You can also try changing the distortion and scale values of the noise textures to suit your needs. If you want the file here's the drive link: Link

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.