5
$\begingroup$

I created a floor for a butcher shop scene and added some dirt, but I realize that it still isn't very real. There are no grooves or edges between the tiles where I can bump them a bit. Is there a way to find the edges?

I tried using a couple of color ramps but can't figure out a math node to find only the edges between the two colors.

I am doing this all procedurally, with only a grunge map for the dirt under the unit. I don't want to add another image texture.

How can I find that edge so I can create some dirt and scratches in the edges?

Tile Floor

$\endgroup$
  • 3
    $\begingroup$ A brick texture with an offset of 1 and brick width and height = 1 maybe equivalent to a checker at the same scale. So if you set Color1 and 2 to white, the mortar will be along the checker edges $\endgroup$ – lemon Mar 16 '17 at 14:38
4
$\begingroup$

A material such as this should be useful.

tile edge material

This combines a couple of Wave textures (at the same scale as the checker texture) to identify the edges - in this way you have a graduation as you get closer to the edge rather than a sharp edge. You can vary the Power node to bring the 'edge' closer to the edge of the Checker tiles (eg, 2000 would get it really close, 1 gives you a graduation over the whole tile).

I've not quite got it clear in my head yet why those values in the Location and Scale of the Mapping nodes - the scaling on the Wave textures is 1/4.5 and that seems to work fine (I'll try and figure out a more scientific reason for that at some point!). Obviously the Scale of both the Wave textures and Checker texture must match. Also, if it's different to 5.0 then you'll need to adjust the Location offset of the Checker texture to suit. I'll try and figure out a better way of getting these to line up but, for now, hopefully this will be useful.

I've combined it with the Checker texture with a Mix Shader just to show that they combine correctly - vary the Mix Factor to blend between the two.

Here's an example using this as a Bump map.

tiles - rendered

And here's the Blend

EDIT : Here's a "simplified" material using Cosine maths nodes in place of the Wave textures. This simplifies the scaling so that a single Value node can be used to set the scale for both the Checker texture and the Edges (the output of the Power node). Note that the second column of Multiply nodes are set to multiply by 'pi' (which blender kindly expands to the value of pi).

improved material

Blend file attached

| improve this answer | |
$\endgroup$
  • $\begingroup$ I added a mapping node in front of the first two so that I could control the whole thing to match the checker pattern more closely. Then it worked! Thanks $\endgroup$ – Matt McKee Mar 16 '17 at 17:36
  • $\begingroup$ Thanks @MattMcKee - glad it helped. I've edited the answer with an alternative material that uses Cosine maths in place of the Wave textures. This is much more controllable and means that a single Value node can be used to scale both the edge calculation and the checker texture. $\endgroup$ – Rich Sedman Mar 16 '17 at 21:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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