Pencil style lines

Avatar
  • updated

Is it possible to draw a line in pencil-style? Something like the following kind of lines:

Image 927

Even just this "broken" line style, without the varying thickness would be awesome.


Would this need modifying an existing shader, adding a separate, new shader, or could it be done with line settings? And how much work would it entail? I know a bit of shader coding, but not too much.

From what I've read, it is currently not possible without modifying shaders, that's why I added it as a feature request. I'm thinking about whether to buy this asset for a pencil-style stick figure game. So I'm looking for something that is able to procedurally create pencil lines for this game.

Reporting a bug? please specify Unity version:
Reporting a bug? please specify Shapes version:
Reporting a bug? please specify Render Pipeline:
URP
Avatar
Freya Holmér creator

Currently that's not possible for multiple reasons yeah!

  1. All shapes are flat colored, with no ability to apply textures
  2. There are no longitudinal coordinates for polylines, which is why they also don't support being dashed (though that might come down the line!)
  3. brush engines in general don't rely on vector style shapes, but instead rasterize and smooth in various ways using brush dynamics, so even if Shapes had support for it, it wouldn't be ideal unless you specifically needed the vector aspect of it

I think if you only wanted to implement it for lines (but not polylines) it would be relatively easy since they already have coordinates from supporting dashes, so modifying the shader, you can sample textures using the same coordinates dashes use! The harder part would be to figure out how to handle texture assignment and material management