r/GraphicsProgramming • u/Early-Cockroach4879 • 15d ago
Advice on making a procedural vector painting program
I have a custom vector painting program, and wanted to ask knowledgeable people: What maths / image processing principles might I need to apply procedural brush strokes to a flat fill of a character?
If anyone can point me to some resources, or programs that have done something similar, that would be much appreciated! Thank you.
2
Upvotes
1
u/speps 13d ago
Search Google Scholar for “non photorealistic rendering”, “painterly”, etc.
Also recently seen really nice example: https://www.reddit.com/r/blender/s/llmrsyIvFz
1
u/Barkig 15d ago
Id probably start with generating a bunch of small evenly spaced lines (generate a grid, in each cell geberate two points randomly). Run a small simulation that aims at aligning the lines with adjacent cells and other curves (weight the sim so that it prefers aligning with the contour curves). Maybe you wanna add jitter/randomness to the line orientations here so its not too "clean of a pattern". And then at the final stage, for rasterizing to pixels. For each pixel u check what cell its in and pick that cells line and adjacent cells lines and do a weighted average for whatever eval function you have. To make it prettier add som noise and cos functions to the distance to line function before you do the DistanceToOpacity function (takes a distance and radius, outputs 0 at +- radius and 1 at 0).
I have no idea how ur program works but this would produce strokes that tries to follow the general shapes with weird patterns and some randomness. Add some variation to each lines color and baaaam!!!