# Control grain size of stipple shading

Mathematica 12.1 introduced a number of amazing shaders such as StippleShading.

Is there a way to control the grain size of StippleShading?

On a standard resolution screen it looks like this:

On a retina screen, the stippling is much finer:

You can experiment with this using the following:

gr = Graphics3D[{StippleShading[], Sphere[]}, Boxed -> False, Lighting -> "Accent"];
Manipulate[Rasterize[gr, ImageResolution -> 30*10^res], {res, 0, 1}]


The higher the resolution, the finer the stippling. With very high resolutions, the stippling is not visible anymore.

When exporting graphics for publication, one often needs to use high resolution (300 dpi minimum) so that lines, which are a common feature of stippled art, would also look good. But using an appropriately high resolution for print will make the stippling invisible in print, defeating the purpose of stipple shading.

This is why I am looking for a way to control the stipple size.

Example drawing which has both lines (for which high resolution is a must when printing) and stippling:

Graphics3D[{{StippleShading[], Sphere[]}, {Thick, Black,
Line[1.7 {{{-1, 0, 0}, {1, 0, 0}}, {{0, -1, 0}, {0, 1, 0}}, {{0,
0, -1}, {0, 0, 1}}}]}}, Boxed -> False, Lighting -> "Accent"]


• Looks like with shift-cmd-e we can change "Tiling" -> {2, 2} to "Tiling" -> {t, t} to get different sizes. – Chip Hurst Apr 8 '20 at 13:56
• @ChipHurst Did you find a way to toggle that without messing with boxes? Even if not, this should be an answer. – Szabolcs Apr 9 '20 at 10:31
• @ChipHurst Please post that as an answer if possible. – Szabolcs May 11 '20 at 15:04

If we examine the box structure of the output with shift-cmd-e, we can change the value "Tiling" points to.

For the input

Graphics3D[{StippleShading[], Sphere[]}, Boxed -> False, Lighting -> "Accent"]


it's output has boxes

Here's a few choices:

### Edit

It looks like we can use the box structure in the initial call:

stipple = SurfaceAppearance["RampShading",
"StepCount" -> 10, "Tiling" -> {1, 1},
"UseScreenSpace" -> 1, "FeatureColor" -> GrayLevel[0],
"IsTwoTone" -> 1, "LuminanceModifier" -> 0.5,
"Arguments" -> {"StippleShading", 0.5, Automatic},
EdgeForm[],