23
$\begingroup$

I am familliar with Blenders Cycle's Voronoi Texture and have fiddled with it for a while. I am trying to get a result that is not like Intensity or Cells, but more like cracks. I tried the node setup from Image 1, but it came to Image 2 (not good!). I would prefer something like in image 3. So basically what I am asking is:

Is it possible to create the result from Image 3 purely with nodes in Blender.

Image 1:

enter image description here

Image 2:

enter image description here

Image 3:

enter image description here

$\endgroup$
2
  • $\begingroup$ I would also like to know an answer to this, as I've tried to recreate that effect myself before. As far as I know there is no way to do this with materials without resorting to image textures. Would a geometry based mesh solution work for you? I can show you how to achieve a similar effect using nodes but it is not very flexible and you won't be able to control the "thickness of the strokes" $\endgroup$ Commented May 10, 2016 at 3:33
  • $\begingroup$ Thank you for replying! I was, after a bit more searching, actually able to find an answer via Blender Artists. I am answering the question myself now. $\endgroup$
    – Shady Puck
    Commented May 10, 2016 at 11:04

6 Answers 6

31
$\begingroup$

Let's use a Laplacian kernel filter for this:

The Laplacian is a 2-D isotropic measure of the 2nd spatial derivative of an image. The Laplacian of an image highlights regions of rapid intensity change and is therefore often used for edge detection.

Here we go:

enter image description here

What is inside the group:

enter image description here

How this works:

  • Image convolution is a filter operation where you sample the source image with a Convolution Matrix (Kernel) to get the output. Different values inside the matrix yield different filter results:

    enter image description here

    You can see some other kernel examples here.

  • In green frame we get 9 mapping vectors. This determines the kernel size.

  • In blue frame we sample 9 different values from 9 different places.

  • In pink frame we apply the convolution matrix to the samples.

  • In white frame we get the value of output pixel.

Here is a .blend so you don't have to build that:

This could be further improved to work on all 3 axes (so you can have volumetric edges) or with enhancing this to canny edge detection.

Limitation is the kernel size - the bigger the less accurate result and also the bigger the lines. A Dilation should be used to drive the edge thickness, I can add that if you need. Also with procedural blurring and thresholding you could add those little round corners, I can add that in also.

$\endgroup$
7
  • 2
    $\begingroup$ A bit complicated, but very nice. $\endgroup$
    – Shady Puck
    Commented May 10, 2016 at 16:35
  • 5
    $\begingroup$ @ShadyPuck it only looks complicated but is pretty straight forward. If Cycles had more node options it could look very clean but this way there must be a lot of duplication :( $\endgroup$ Commented May 10, 2016 at 17:39
  • 2
    $\begingroup$ Love it! Could you please add some explanation as to the actual math going on there though? I don't know that I have the patience to mentally untangle that spiderweb of node wires. $\endgroup$
    – PGmath
    Commented May 10, 2016 at 17:50
  • 1
    $\begingroup$ @ShadyPuck no didn't invent it, this is used in image recognition and filtering. I just implemented it in Cycles. $\endgroup$ Commented May 11, 2016 at 12:28
  • 3
    $\begingroup$ @PGmath Yep added more info and organized the nodes picture with some framing. $\endgroup$ Commented May 11, 2016 at 12:29
11
$\begingroup$

Funny what Google can turn up. After a bit more searching, I was able to find an answer on Blender Artists.

enter image description here

This node setup will work, and you adjust the size of the cracks by increasing the rotation values in the bottom mapping node. The text that the guy posted on BA was this, if it helps anyone:

You can try something like this ... Use two identical Voronoi textures with cells Then rotate one with repect to the other, where the variation in angle determines the size of the cracks Mix these to find the difference Saturate the result to a simple black/white or factor value Use this as a mix factor or whatever It does not give a nice blurred edge, but you could add something for blurriness too Not perfect but reasonable Hope this helps Martin This is with a 0.1 deg rotation of XYZ`

$\endgroup$
3
  • 1
    $\begingroup$ Yeah nice one. It's not perfect, it's hard to control the crack thickness, and they they are not very even, especially for larger width, but it works relatively well. Thanks for sharing $\endgroup$ Commented May 10, 2016 at 13:38
  • $\begingroup$ @DuarteFarrajotaRamos Agreed, but you're welcome. $\endgroup$
    – Shady Puck
    Commented May 10, 2016 at 13:39
  • $\begingroup$ for sheer simplicity and speed this is a great solution $\endgroup$
    – J Sargent
    Commented Feb 10, 2022 at 17:43
8
$\begingroup$

Node Setup

These are basically the sum of the absolutes values of the partial derivatives of the voronoi function (more accurately the finite difference approximation of them).

2D texture version:

Voronoi Cracks 2D

Better suited for 3D:

Voronoi Cracks 3D

Matrial setup:

Matrial Setup

Rendered result:

Rendered Result

Additional Notes

There is some similarity to the rotational version, but that would produce non-uniform crack thickness (zero at the origin of the texture coordinates and infinitely increasing by the distance of the origin).

You could also achieve these by using only one additional voronoi, but that would result lower quality (actually, the more additional voronoi vectors you use, the better will be the quality, but that depend on how well the coordinates are shifted for each of them).

The laplacian kernel method also shares some similarity, but (du to more calculation of the voronoi funcion) has higher quality (at the cost of performance).

This is simpler and faster, and quality is acceptable if not zoomed in too much. If you want to get uniform crack strength, add a grater than node before the output of the node group.

Using Greater Than

$\endgroup$
4
  • 1
    $\begingroup$ Well done! I really like how the cracks are different sizes. It doesn't quite work for me now, but it might well in the future. Thanks! $\endgroup$
    – Shady Puck
    Commented May 10, 2016 at 20:25
  • $\begingroup$ Could you tell me why it does not work? Maybe I could help. $\endgroup$ Commented May 10, 2016 at 20:48
  • $\begingroup$ It does work, it's just not quite what I wanted. Sambler did something similar to yours. I was looking for a more uniform set of cracks, like in my or Jerryno's answers. However, as I said above, I might yet find use for it in the future. $\endgroup$
    – Shady Puck
    Commented May 10, 2016 at 20:55
  • $\begingroup$ Actually, the variation is less crack size and more strength of the white (see my edited versions last sentence). Well, I guess I was just too late. :) $\endgroup$ Commented May 10, 2016 at 21:11
5
$\begingroup$

Based on the cracks with worn edges material by CGMasters, using the portion of the material that makes the cracks leads to the following node group.

cracks node group

The idea is to move multiple voronoi textures by a certain amount and mix them together. By using SeparateXYZ/CombineXYZ nodes we can add and subtract the same amount on each axis with only one input.

sample render

$\endgroup$
1
  • $\begingroup$ Great! Only reason I'm accepting Jerryno's is because this is a little bit too random. Still fantastic tho. $\endgroup$
    – Shady Puck
    Commented May 10, 2016 at 20:53
5
$\begingroup$

At Blender 2.8 the Voronoi includes additional features - including a 'Crackle' mode which effectively provides the 'distance' from the edges of cells rather than from the center. This can produce the following result :

voronoi crackle

$\endgroup$
0
$\begingroup$

Cell Fracture

enter image description here

Margins have control and achieve constant width goal.

  • Cell Fracture results in one plane then extruded
  • Boolean difference with a Cube, yellow
  • Triangulate, blue
  • Detail in large

enter image description here

enter image description here

Result of Cell Fracture after steps below. Click image to see larger version.

enter image description here

Simple Cube in Layer 01 with the Cell Fracture Add On showing settings. Above image.

enter image description here

Particle System Modifier used on Cube.

  • Cube scaled rather flat
  • Particle System attached to Cube. Settings above.
  • Cell Fracture add on used with settings above. Note Margin settings. Adjust to suit your needs. Add on installed in user preferences. See Cell Fracture tutorials if needed.
  • Switch to next Layer 02 to see Cell Fracture Results CFR. CFR multiple objects joined Control-J.
  • Edit Mode. Vertex Mode. Select Vertices on Bottom Side. Delete Vertices. Face Mode. Select Top Face. Select Similar by Normals. Vertex Mode. Selection Inverse. Delete Vertices.
  • Only top flat faces remain.
  • Render Image. Use image in Compositor or as Texture.
$\endgroup$
3
  • 4
    $\begingroup$ This isn't answering the question at all. The question was how to create the described texture using blender nodes only. $\endgroup$ Commented May 10, 2016 at 9:38
  • 4
    $\begingroup$ Thanks for replying, but this isn't the question I asked. $\endgroup$
    – Shady Puck
    Commented May 10, 2016 at 11:09
  • 1
    $\begingroup$ With a small edit marking this as an alternate backup solutions to the nodes (with steps on how to add it as an image texture, I think this answer would be alright, $\endgroup$ Commented May 10, 2016 at 18:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .