This past week or two I've been adding a kind of procedural texturing to my paint app. One thing I'd noticed is that just using the standard brushes gave a rather smooth, non organic blend between layers, and I thought I could do better.
The Finished Result - Alpha and Colours
My plan was to use something akin to perlin noise to modify the alpha to get a blend where instead of just blending out the alpha, there was a gradual decrease in 'full blend' noisy areas. So I could have a decrease in density, rather than a decrease in intensity, at joins.
As I wanted the noise to look good in 3d, rather than use perlin noise, I used an equivalent open simplex 3d noise. This wasn't super difficult to get working and made the blends look much better. For variation I also wanted another type of noise, so after doing some reading I wrote a quick 3d worley noise implementation.
Procedural Alpha Only
Next, as I'd already done 'the hard stuff', I wondered what the results would be like if I went the whole hog and used the noise functions to generate colour, instead of just alpha. My colour experiments were mixed success .. it worked, but the colours looked rather boring and lifeless, and clearly it would take a lot of tweaking to get a good effect. So instead of fully creating the colours, I multiplied noise colours by the original layer colour channels. This produced much nicer results.
Boring procedural colours (ok for some things like lichen maybe?)
Alongside this, I had to figure out a good way of writing this system into the GUI, to make it tweakable, but not so much so as to frighten users. The most powerful system would have been to implement a node based custom graph, similar to the cycles renderer in blender, where you could feed the outputs of one node into inputs of others. However, this seemed like overkill, so I went for a simpler linear stack of 4 noise layers.
I experimented with a few GUI layouts, but the current one seems user friendly enough. I have a little preview window, which is faster to calculate as you change parameters, because changing the whole of a 4096x4096 texture for previews, is a little too slow.
It has also taken a bit of playing with the blending modes and maths to get something that looks right. I will probably put in some options for users to change blend modes per noise layer.
Once you have a prodecural stack that looks good for your layer, one of the best ways to use it is to blat a source texture all over the layer, then use a layer mask to determine how much is showing through in each area of the model.
I will tweak this a bit more and hopefully have it soon in the latest release.
Addendum
I have just compiled latest release, with the procedural stuff. Please try it! :)
https://github.com/lawnjelly/3dpaint
I think you will get a lot of extra eyeballs on this because of the dinosaurs ;)
It is really looking great.