Cycles Brick Tricks 0.1

Lets cut to the chase, what can you do with it?



Why?
A while ago I submitted a patch to the brick texture in blender, which got less than enthusiastic feedback, new procedural texture options were not something the devs were looking for. so new task unlocked: enable new (gpu usable) procedurals without having to make changes to the blender codebase, solution: nodegroups!

Why nodegroups and not OSL? The hexagon image above? 60+ minutes using osl scripts, same math put in a nodegroup and rendered on the gpu? 10 minutes! that’s why! OSL is great for prototyping (and all these nodes have been prototyped in osl) but it’s not a fast renderer…

Design:
Initially I extended the brick texture, but there were just some things the brick texture was not meant to do, and making a single node do everything just turned awkward really quickly.

Solution: split it up into several stages:

  • Stage 1: Get a tile UV map!
  • Stage 2: Customizable Bricks / tiles

Stage 1:
Here we have the following options:

  1. uv_map_brick_wall : Classic Brick wall , similar to the one we already have in blender
    http://i.imgur.com/Rb2ZOXx.pnghttp://i.imgur.com/VWKAVgp.jpg

  2. uv_map_tile_pattern_1 : a classic 2x2 brick pattern
    http://i.imgur.com/ZFNgh9f.pnghttp://i.imgur.com/s4vtK6V.png

  3. uv_map_tile_pattern_2 : a classic zig zag brick pattern
    http://i.imgur.com/puObZeN.pnghttp://i.imgur.com/Kr14IYq.png

  4. uv_map_swirl : a nice swirly pattern (great for patio’s!)
    http://i.imgur.com/Qod0Sd3.pnghttp://i.imgur.com/LDE5UPx.png

Stage 2: tiles!

  1. brick_square_corner : Your standard square brick
    http://i.imgur.com/q279RJW.pnghttp://i.imgur.com/wsraHny.png

Has the basic options, to set border and feather so you can control both the size and smoothness of the brick

  1. brick_rounded_corner : a rounded brick
    http://i.imgur.com/Y1vqeYR.jpg http://i.imgur.com/r59NfTe.pnghttp://i.imgur.com/Vw3IWFx.png

just the corners, completely round? it’s all possible!

you can even overdo it, and get some kind of diamond shaped pattern, great for some scifi metal plate work

http://i.imgur.com/0LUHSaS.png

Basic Setup

Left to right:

Texture coordinates: Since nodegroups cannot have a default input like texture nodes have, you have to manually plug in the coordinates, annoying, but that’s just how things are.

uv_map_tile_pattern_1 : get the uv map

brick_square_corner : I went for a basic square brick

Diffuse: nothing special here, needed to see output of the previous blocks

Result:
http://i.imgur.com/Vm9Plii.png

At this point, you have a nice height map for your tiles, you can plug it into a bump map node, or perhaps use some micro displacement and use it for displacement.

Shaping your Brick

By default feather applies a linear slope to your brick, which looks kinda weird when you use it with a basic displacement setup like this:
http://i.imgur.com/hLhdvwg.jpg

http://i.imgur.com/ZF5WjRv.png

I bet there’s uses for it, lets be honest but it’s not the prettiest thing around.

The fix? RGB Curves! This allows you to tweak the edge of the tile to get nice natural looking results

http://i.imgur.com/xjEBf1B.jpg

http://i.imgur.com/xvfEGKS.png

Basic Variations
All of the uv_map nodes have a cellID output node, this gives you a unique value per brick, this allows you to apply some variations to each brick, in this case you assign a random color based on the cellID


http://i.imgur.com/JX2ZqWL.png

Basic Variations - 2 : uv_map_rotate
In the real world no brick layer is perfect and sometimes, some bricks are not quite on the same angle as other bricks, here’s where our next node shines. This builds on previous setup with a color per brick, and adds a small rotation per brick

Basic setup:


http://i.imgur.com/9n2PMXg.png

Bonus Content:

bonus_hexagon, I couldn’t get the uv mapping working the way i wanted with this one, even in it’s less than optimal state, this one was just too much fun to leave out.

Basic_setup:


http://i.imgur.com/rQziB6Z.png

More Advanced setup:


http://i.imgur.com/aCPZ1vW.png

Naturally the things i’ve shown only scratch the surface of the possibilities, but here’s some basic variations you can make with this kit.

http://i.imgur.com/og5oq4c.pnghttp://i.imgur.com/iE7Blxy.png
http://i.imgur.com/RH1Uu7O.pnghttp://i.imgur.com/zuNjUVY.png
http://i.imgur.com/8AdWMSW.pnghttp://i.imgur.com/iv7yUdv.png
http://i.imgur.com/79bgrvx.pnghttp://i.imgur.com/nJ4iuIR.png
http://i.imgur.com/G8GooFO.png

Download: (most if not all materials in the collage above are included)
brick_tricks v0.1.blend (1.87 MB)

If you make something neat with it, feel free to show the results of your handy work below!

Update: now an addon, available here:

Update 2019-05-18 The latest version on github has been updated to support 2.80, The 2.79 release is still available in the release tab.

16 Likes

wow, you must really like the brick texture. and i like your dedication

2 Likes

I actually love you for that hexagon texture!

2 Likes

Got it.

Will give it a go at a later date (when I’m working on a scene that needs it).

I didn’t know you could already do that stuff with the brick node (and especially good that you don’t need OSL).

Damn that’s neat! :eyebrowlift2: I’m curious with the UV mapping thing… Is it now possible to have different images plopped onto each brick? So we could use the grayscale of the usual brick color randomizing thing and have a few different images placed by thresholds within that value range. So randomly chosen images for each brick?

It’s something I thought of before while trying to make an image collage, but the default brick texture settings fell short of being able to do it. Might be something to look into now.

Looking great. I love the neon brick render. It really shows what potentials it has. Great work!

Edit:

Did a crappy try for bee wax:

2 Likes

It’s not difficult to implement that in the nodes, but you can do it outside of the nodegroups, with the CellID and UV outputs. Just a matter of scaling the UV down and add the CellID to it.

Cycles doesn’t really offer a node to chose a random image, so you always end up with a bunch of mix nodes and do it your self , but yeah sure, it’s not hard to do:


http://i.imgur.com/CAYaoNw.png

impressive work

Nice work what material have you used for the honeycomb bee wax ?

Regular Subsurface scatter shader with slight mix with glass. But I’m not fluent in nodes, still learning. I don’t think the glass shader did anything. Also rendered it with a special build with denoiser. Otherwise it would be crazy noisy-

Again to LazyDodo: Awesome stuff!

That’s not brick tricks, that’s black brick magic :slight_smile: Awesome and very generous of you to share it. Thanks a lot for this, LazyDodo!

That’s a awesome set of nodes. Great work.

Had a look at your node group, did you write an OSL -> Node converter perchance??

I did, however, it’s very limited though, there’s only a small subset of osl you can express in svm nodes but most of the mathy stuff works. basic if then else constructs, and loops with known bounds are unrolled automatically. The bad news is, it’s really not ready for general consumption (if ever) there’s just too many limitations.

1 Like

Thats super cool. I was thinking about writing one myself but never have had the time!

Tkz !
I like it !!!

You did a good job.

Thank you for sharing it.

Awesome job :slight_smile: Thank you for sharing

Amazing job! And very sad to know that OSL is much slower than a web of nodes.