Procedural brick shader

Here are some bricks, hovering in mid-air with no mortar to hold them together! They are clean, whole and ready to be abused and covered in grunge as necessary.

Outside of the shader itself, I have added a random colour using a colour ramp, and also each brick has a bevel modifier. In this example file I haven’t applied the modifier, so you can see the settings. I didn’t apply a subsurf modifier because the bricks are rectangular on each face, and rough in texture, so I decided only the smooth shading was necessary.

Each face of the brick isn’t completely flat, and the texture is rough. There are two noise textures controlling that.

Also, there are extra levels of uneven texture from holes in the brick material, but the holes are not the same size. There are four noise textures controlling those and distortion is used on two of them to vary shapes.

The noise textures are passed through bump vector nodes and mixed together using mixRGB colour nodes into the normal sockets of diffuse and glossy shaders. By default both of these have roughness set to 1 (i.e. fully diffuse) but I left the two in there in case I want to add some gloss at some point (I am still testing this). You can get the same result by plugging the glossy node into the output instead of mixing it with the diffuse so the diffuse node is possibly superfluous, unless you change the roughness settings. I might have mucked things up of course.

Here are a couple of images.

Here is a link to the blend file.

bricks1.blend (1.15 MB)

Attachments



1 Like

Verry nice , i realy like it :wink:

Cheers. Thanks for the feedback. I will look at using the basis of this for a procedural floor texture.

Very nice creation …looks cool!

Very very nice.
I’m definitely going to use this.

A suggestion?
Many have made floors but as far as I’m aware none have made granite blocks.
Your system would be brilliant on the type of granite blocks used to build castles.

Good job. Very nice. Thanks

thanks for sharing, looks really nice. perhaps you can add displacement node as well to increase the randomness on individual bricks

That’s quite nice ! It will be a part of my tool set. I changed the color of the bricks to more subtile, and applied another fresnel node with a bit less saturated gloss. Great procedural texture, very usefull to me. And fun to play with bricks. Thanks! stc=1

I’m not sure what you mean by “displacement node”. My blend file puts the output from bump nodes into the normal input of the glossy and diffuse shaders.

You can add in a random number generator to create a number to vary the height of the bump or perhaps use a colour ramp to randomise the bump height in the same way that I used one to randomise the colour of the bricks, which would probably be easier.

There isn’t a random number generator built into Blender and the random output of the object info node will only give one number at a time so you have to do a bit or work on the number to make it look more nearly random. The link below shows the results I got when I was experimenting with colour and transparency. As that example uses a single material to produce varied results per object, it should work with the bricks as well.

Imgur

I put this in the “test” forum because I am still testing different effects that can be got by varying the node set-up so feedback like yours is very helpful to me.

Glad to be of help. One of the good things about the way Blender uses the node set-up is that you can always use one node set up as the basis of another.

Is this the sort of thing you had in mind?

Attachments


I added some extra randomness but I am still testing this texture.

These are from going over the top a bit. If I get something which more consistently does what I want, I will post the .blend file for that.

Attachments



I’ve been playing around with this and, even though it renders fine, I can’t get it to bake into a diffuse map. Any thoughts?

EDIT: Okay, maybe I haven’t given enough info…

I have your procedural brick material assigned to several sections of wall (just the bricks, really). I also have another object, a plane, with a mortar material/texture applied.

I have yet another object, another simple plane, as a bake-to object. With ‘Diffuse’ selected in Render > Bake, I select all the brick objects, then the mortar object and finally the bake-to object, then hit ‘Bake.’

The mortar bakes out fine, but the brick objects come out as pure white, no color, no bumps, just a plain white.

Thanks for sharing :slight_smile:

This is just a guess. Perhaps a Blender expert can confirm it or put me right.

When you bake a diffuse map it just bakes the topology and not the colours. You would have to apply colour separately. Also, as I understand diffuse maps (and I can’t do them right now because of a non-Blender bug on my system), they bake topology and not textures. I think you can do that with a different kind of bake but I am no Blender expert so I haven’t looked into that. Finally, the successful diffuse map bakes I have seen use BI render rather than Cycles. I haven’t kept up to date with improvements to Blender so I don’t know whether that is now different.

Thanks for the reply, jancyclops.

I don’t think so because I did a test bake with a Voronoi texture and the color came through. Mind you, the color was supplied by a Diffuse BSDF shader, not generated by a complex shader tree like this brick thingie.

I also did a test with an image texture (.png) and that too resulted in a color map.

I was thinking it had something to do with the complexity of the shader, that something got overlooked? (or over-cooked? :)) or perhaps the color output was directed only to the render engine, but not the bake engine (if these are actually two separate things)? I don’t know.

Anyway, thanks for jumping in.