What I've tried to do here is:
- Making black dots of constant size but placed in a blank of various sizes
- These sizes are shadow intensity dependent
- Dots are shuffled to avoid too much regularities
- One can adjust the scale (shadow intensity to an amount of discrete value) and the resolution (the size of the dots)
The result is not perfect (especially I would like thinner dots more regular and more spaced) but if that can allow to go further for someone...
As said there is two main parameters to play with:
- Resolution (the size of the dot)
- Scale (the overall 'sampling' rate)
Rounds a value or a vector at a given resolution.
- ReportValue and ReportVector
Just make copy of the input but facilitate the node placements
Captures the shadow value. It uses a diffuse shader convert to rgb then to black and white. This result can be scaled to a given input.
Create a vector X = Y = Z = the input value.
Can be either 'generated' texture coordinate or a variant based on 2 UV maps mimicking 3D coordinates.
Some kind of shadow catcher which is inverted and set to a given resolution/samples (here 60).
The result is multiplied with the overall scale (upper part on the right) to feed the part that makes the dots.
And the result is also given to the shaders so that it can filter where the shadow (dots) is to be applied (bottom right part). This output is strictly constrained by the colorramp so that there is not grey output (as we want a 'pure' black or white result).
Take the input coordinate and samples it at the (shadow intensity * the scale).
Then take a random value which is reported as a vector.
The 'dots' part calculates a radius from a sampled area (area size is 'scale' relative size).
The result is compared to a threshold radius ('resolution') which size it itself relative to the 'scale'.
The result is used to output black inside the dot and white outside.
The shader is in two steps.
Make the dots using a mix shader factor from the 'dots' part above.
Make the 'shadow / non shadow' region using a second mix shader with a factor coming from the 'shadow' part above.
Only colors are used because we don't want additional shader effects here.
Done with Eevee (2.8).
Edit: a variant using Voronoi
This alternative setting uses the same principles but replaces the 'dots' part above with the following setting using a Voronoi texture.
Depending on the 'scale' and 'resolution' value, it could allow result that are closer to the skull image in the question.