• The Blend
  • Posts
  • Cracking the code on the cracks

Cracking the code on the cracks

How to make a decent crackle texture

The Blend

The "learn nodes" sample file has been quite a success—we're at 199 downloads.

See it here if you're curious.

Now I need your help: what should the next sample file be?

Hit reply and tell me your ideas. (I read all replies.)

About a year ago I was obsessed with procedural textures.

But I couldn't figure out how to make a cracked texture. I could make the basic Voronoi crack pattern, but it's too uniform—I wanted something more realistic and random.

I was quite stuck on it.

Eventually (months later!) I came across part of the solution (probably in a CGCookie or Erindale tutorial—don't remember.)

I was able to put together some awesome crackles. They were amazing, and they were easy.

Today you'll learn how to make it too. A cracked texture that you can randomize to your hearts content.

Just want a look at the nodes? Here you go:

Node Setup And Cool Viewport Screenshot

Just 7 nodes for epic cracks.

Here's the steps we'll cover:

  • The Basic Cracks

  • Thickness Noise

  • Shape Noise

The Basic Cracks

The steps for basic, plain cracks are simple:

  • Set a Voronoi Texture to "Distance To Edge" mode (this makes the best crack pattern)

  • Add a Math Node

  • Set the Math Node to "Less Than" mode.

  • Play with the Threshold value to adjust the thickness of the cracks (use tiny values like 0.04).

The Less Than node takes a value and compares it to the threshold value. If it's less than the threshold, it outputs "white" or 1, and if it's greater, it outputs "black" or 0.

This had the effect of clipping away all but the nice "cracks" in the Voronoi noise. (A ColorRamp could do this too—but you'll see why we used Less Than in a moment.)

Thickness Noise

The cracks are too uniform. Too even.

You can control that with a noise texture. It sounds too good to be true but it really works.

Just add a new Noise Texture and plug it into the Threshold. You'll need to add a Map Range node too, to change the noise values from 0-1 to a range like -0.02—0.04 (oddly specific but it's what worked.)

Play with the scale, detail, and roughness to get a nice randomness. Lots of room for adjustment. (You can also ColorRamp the noise for extra control before the Map Range node.)

Shape Noise

The cracks are still perfectly straight. Which is not very cool or realistic.

The solution, once again, is a noise texture. But we won't mix the noise into the voronoi texture—we'll mix it into the texture coordinates that drive the texture.

First, add a Texture Coordinate node and plug the Generated into the Voronoi. Now we have some coordinates to modify. (By default, when you're not using a Texture Coordinate node, the Generated coordinates are used. So adding it shouldn't change anything.)

Next add a Mix node. Set it to Color mode and Linear Light blending. Place it between the Texture Coordinates and Voronoi.

Now the fun part: plug a second noise texture into it. Give the new noise texture a high Detail, and turn the Factor way way down on the Mix node.

That's it. The solution to the crackle problem.

You now have a complete crackle texture that you can use in any material. Use it to mix different shaders together, control colors, etc.

It's lunchtime now, so I've gotta wrap up.

Have a great week!

And 1 weekly render prompt:

> Something beat-up and wooden. Anything from an ancient table to a baseball bat.

P.S. (unrelated) Love reading fiction? Check out Voyage. You get a new, original piece of short fiction every other Friday. (And it's totally free.)

Enjoy this newsletter? Please forward to a friend. It'll only take 15 seconds. Writing this took way longer. I think.

New to the newsletter? Join here (no pressure. But I really, really think you should click the button. Click the button. Click...the...button...) ↓

Join the conversation

or to participate.