Skip to content

Brush Instancing

Brush Instancing is a perhaps unintuitive part of Soft Edge that should make a lot of sense to someone with experience in 3D art. The problem is quite simple: in a traditional app like Photoshop, once you paint the paint is fixed there. Suppose you’re painting with a Hard Round brush at size 50px and Hardness 80%. You paint a stroke. Then you change the brush to 25px and 100% hardness. You paint another stroke. Each stroke has its own parameters, this is the normal behavior.

The problem is: what happens when a stroke is live, and not fixed in place?

Because vector strokes are just data, they need a live reference to a brush in order to display themselves. If we point the reference to some shared Hard Round brush, then editing the size and hardness to paint the second stroke would also change the looks of the first stroke.

There are two ways to address this.

One, the naive way, is to simply give each vector stroke a copy of the brush it was used to be painted with. This works. With this, each stroke has its own isolated brush and changes to the global brush don’t change already drawn strokes.

Another one, the way Soft Edge works, is to give strokes instances of brushes. Why? Because then we can control many strokes from a central point. Imagine for example you’re drawing a figure. You like the way it looks, but you don’t quite like the brush. What you can do is simply change the brush from one place. Changing the brush can mean editing the shared instance of the brush, so that for example all strokes become softer or harder, or making them point to a different brush instance.

This does not mean that all strokes share one instance. Instances are minted on demand from parent brushes. You can use one global instance for all strokes, or you can have say one for the body and one for the hair of a character, or whateve you want.

I understand this part of the app can be hard to grasp to people not used to it, but it’s quite an important part of Soft Edge.