3
$\begingroup$

I've gotten as far as to make the squares, tile them and have control over the size, but I expected them to scale uniformly, but they distort as shown in the image provided. This problem doesn't happen if I use a value node. Is there a way to "pixelize" the texture that is inputted in the scale socket? To make it clear, the first image is what I don't want, and the second is somewhere near what I want

My problem

The shader with only a value node which changes it uniformly

$\endgroup$
6
  • 1
    $\begingroup$ You mean you want to pixellate, or half-tone, an image-texture, at some stage? $\endgroup$ – Robin Betts Dec 9 '20 at 15:26
  • 1
    $\begingroup$ Yes, I wanted to have like a halftone shader, but with uniformly scaled squares $\endgroup$ – Throndronis Dec 9 '20 at 15:33
  • $\begingroup$ It would be a little bit clearer if you would label the images such as .. this image is successful .. and this image is not successful. Why did you use a noise node .. what did you expect it to do? Noise has variation and a value node does not. $\endgroup$ – atomicbezierslinger Dec 9 '20 at 15:37
  • $\begingroup$ I can't see any texture plugged into a scale socket. There's only a Noise texture plugged into Epsilon sockets. The Epsilon is the range how much the compared values can be different from each other and still result as "True". Since the Noise Texture varies this range, the squares get "distorted". The value node keeps the range equal in X and Y direction so there's no distortion. The bottom value in the Divide Node changes the size of the white squares or width of the black respectively. The Vector Scale Node changes the grid size i.e. how many white squares there are. $\endgroup$ – Gordon Brinkmann Dec 9 '20 at 15:43
  • 1
    $\begingroup$ The scale value would change the overall size of the shader, but I'm thinking about individually changing the size of the squares with a specific value taken from; for example, the square's center $\endgroup$ – Throndronis Dec 9 '20 at 15:48
6
$\begingroup$

To get your squares to remain square, they must use the same evaluated brightness from the image across their extent, otherwise some parts of the squares will scale, or pass a threshold, differently from others. In other words, the image must be pixellated at the square-centers first.

(The illustrations below are not all shot at the same grid-scale)

Make a Grid .. This is just a different way from yours, no better..

enter image description here

It has 2 outputs: 'Cell UV' and 'Cell ID'

enter image description here

'Cell UV' maps each cell in XY, -1 to 1, with 0 at the cell center. 'Cell ID' colours the whole cell with the original, piece-wide UV at the cell centers.

Sample the Image, or your procedural texture, at the cell-centers, using 'Cell ID'...

enter image description here

..for a pixellated image. This image, on the left, has been gamma corrected and made negative for this particular, "printer's", way of making a half-tone...

enter image description here

The Half-Tone Screen, on the right, above, is made by making a 'Distance from Cell Edge'from the cell UV:

enter image description here

Combine: When the screen is multiplied with the image, put through a threshold, (and inverted again,) using a Color-Ramp, you get a traditional black-dots-on white half-tone.

enter image description here

If you do without the negative steps, you get white dots on black.

enter image description here

This example samples only one point for each cell, at the cell center. You could, say, take samples from a number of well-arranged points in each cell, and take their average, for more accurate toning.

$\endgroup$
1
  • 2
    $\begingroup$ Oh. My. God you are a blessing, thank you so much for going through this, hopefully this can help others in the future $\endgroup$ – Throndronis Dec 9 '20 at 23:13
2
$\begingroup$

I noticed that you moved your mapping node to avoid a mirroring problem with object coordinates at the axes. Working with generated coordinates you can create this node tree:

enter image description here

We run a modulo operation for the number of squares we want, we do some math to adjust the center of the coordinate space based on the number of tiles, and then run two compares into a multiply just like you were doing. I've just attached some value nodes with a multiply node on the bottom to make the slider action more usable on a small scale.

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.