1
$\begingroup$

I am making a bubble wrap material for work and I follow Default Cube's tutorial on YouTube. I want my dots to be aligned diagonally, (like the second image), I attached the nodes as well. What do I have to do?

My Nodes

Dots Alignment

$\endgroup$
1
  • 1
    $\begingroup$ If you need your cells to overlap (have the bubbles nestle up together) then the hex-grid group at the bottom of this answer might help $\endgroup$
    – Robin Betts
    Dec 21, 2021 at 14:12

3 Answers 3

3
$\begingroup$

I'm afraid there is no way to achieve the exact result that you showed with this current method. There is a quick hack to get a similar result tho, and I don't know if it would suit you but you can just rotate the texture so that instead of appearing to be aligned horizontally, your dots would appear to be aligned diagonally, this is your current output :

Your current output

And this is the output if you rotate the texture :

enter image description here

You can achieve this by simply adding a Texture coordinate and a Mapping before your voronoi like so (if you have node wrangler add-on enabled, you just select the voronoi node and press CTRL + T) :

enter image description here

Then on the Mapping node, you change the Z Rotation from 0 to 45 deg like the screenshot above.

Let me hear if it helped.

$\endgroup$
2
$\begingroup$

@mqbaka's solution is really snappy, and the way to go. But if you need a hexagonal grid for bubblewrap, where rows intrude on one another, then the group explained here might be handy, especially if you want to get down into the weeds, varying the exact behaviour at the edges of cells, etc.

Here's a first-shot example of using just the 'Distance From Center' output to control displacement, for a bubblewrap shader:

enter image description here

If this was for a closeup, you would need to go further than the result below, to dent and deflate some bubbles, etc.. but things like the 'Cell ID' output would help you select out some cells.

enter image description here

$\endgroup$
1
$\begingroup$

I also found an alternate solution that is actually simple. The idea is to create a dot pattern, duplicating it then offset the second one and finally mixing the two together. This is the result I obtained with this method :

enter image description here enter image description here

enter image description here enter image description here

The dot pattern is created with the Texture Coordinates's UV output and a Vector Math set to length :

enter image description here enter image description here

Adding a Math node set to Greater Than gives the circle shape :

enter image description here enter image description here

To have the pattern, we just add a Mapping node and a Vector math set to Fraction right after the Texture Coordinates :

enter image description here enter image description here

The number of rows and columns are decided by the value of the X and Y components of the Scale of the Mapping node.

Now we have the pattern, we can group everything together for easy duplication :

enter image description here

Pressing Tab will allow us to edit the node group and expose a few of the values so that they can be controlled outside the node group :

enter image description here

enter image description here

Now you can just duplicate the group, give it an offset of 0.5 and now we have the second variation but we need to find a way to mix them together. We can do it by using this mask :

enter image description here

Which can be created with this node setup :

enter image description here

It takes the same vector input as the group node and the input value at the begining is plugged to the Grid Size of both node groups which aligns automatically the black and white lines to each row of the pattern.

Now, we just have to mix the two patterns with the mask as factor to have the final result :

enter image description here

$\endgroup$

You must log in to answer this question.

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