pencil and wash for blender
A look for Blender: pencil lines and a watercolour wash over the flat, clean colour of a hand-painted background, with trees and clouds painted in clumps. It's a port of Patch's three.js block of the same name, made of EEVEE node groups, Freestyle and the compositor. Put it on any scene with one click or one line of Python. The demo is a corner of Brookfield, a country village built entirely in code.
| golden | overcast |
|---|---|
![]() | ![]() |
![]() | ![]() |
On the left, the same street with the look off: Blender's own EEVEE, with the same scene and colours. On the right, with the look on.
Use it
As an extension. Install pencil_and_wash-1.0.0.zip from Preferences → Get Extensions → Install from Disk. To build it yourself, run blender --command extension build --source-dir pencil_and_wash. A Pencil and wash panel appears in the Render properties:
- Apply pencil and wash puts the look on the scene and paints every material in it.
- Paint selected paints only the selected objects.
- No line on selected is for grass, leaves and far hills.
- Afternoon, Noon, Overcast, Golden set the time of day.
- Steady (in Apply's options) is for animation. The pencil presses evenly and goes over nothing twice, the paper's tooth is broader and gentler, the lines PW Wash finds are softened, and the sun's shadows are jittered and filtered, so nothing fizzes or steps as the camera moves.
- Line, Dark, Joints, Sketch, Wash, Brush, Paper tune the drawing.
From a script, the way adopt() works in three.js:
blender my_scene.blend --python apply.py -- --time golden
from pencil_and_wash import look, clumps
look.apply(scene, time='golden') # PW sun and world, AOVs, Freestyle lines, the PW Wash compositor, EEVEE
look.apply(scene, steady=True) # the same, made to hold still in animation
look.adopt(scene.objects) # each material becomes a painted one of the same colour (and picture)
look.set_time(scene, 'overcast') # afternoon, noon, overcast, golden
look.unline(ground) # no line, but it still hides the lines behind it
leaves, wood = clumps.create_trees([{'at': (0, 20, 0), 'height': 14, 'crown': 6, 'kind': 'oak', 'seed': 1}])
look.foliage(leaves) # leaves, cloud and grass: no line, and Freestyle skips them
By hand. pencil_and_wash.blend holds the look as assets, under the Pencil and wash catalog:
- Materials: plaster, stone, brick, slate, tile, thatch, boards, rock, grass, leaves and cloud.
- Node groups: PW Paint, PW Clumps, PW Wash and PW Light.
- Worlds: the four times of day.
- The PW Sun.
Drag a world onto your scene and everything follows it: the paint, the trees, the sky, the sun's angle and the pencil's colour. The file's own scene has the lines and the compositor set up on a thatched cottage, an oak and a meadow, so it renders as it opens.
PW Paint's inputs are paint()'s:
| Input | What it does |
|---|---|
| Color | the flat colour |
| Line | 1 to pencil it, 0 for paint with no line |
| Stone Course, Stone Length, Sparse | courses of stone in metres. Sparse below 1 draws only patches of them, the way a painter suggests brickwork |
| Rows Height, Rows Length, Rows Style | rows along the mesh's pw_course attribute (u, v in metres): 0 slates and tiles, 1 thatch, 2 boards |
| Cracks | rock broken into faces this many metres across |
| Wear | pencil scuffs on walls |
| Mottle | how uneven the wash is |
| Edge From, Edge To | where shade turns to light |
| Leaves | a deep third tone, from a pw_deep attribute |
| Vertex Colors | each colour is its own part, with a line where colours meet |
| Window | glass that glows at golden hour |
| Emission | a colour that glows |
Wire PW Paint's Ink, Lit and Joint outputs to AOV outputs named pw_ink, pw_lit and pw_joint. The materials in the .blend have them wired already.
How it's drawn
| three.js block | here |
|---|---|
| lit amount from the light | a white Diffuse BSDF lit by the PW sun alone, read with Shader to RGB. The world lights nothing, so the value is exactly cos θ × shadow |
| three tones, a wavering edge, cloud shadows | the same maths in shader nodes, in PW Paint |
| stones, bricks, slates, thatch, boards, rock | the same maths. The joints between stones, slates, thatch and boards are drawn in the shader, into the pw_joint AOV: a pixel and a half wide, smoothed by EEVEE's samples, and faded out before they come closer than a few pixels apart, so they hold still as the camera moves. Each face of rock writes its own fraction into pw_ink |
| ink pass: outlines and creases | Freestyle, on a view layer of its own (PW Lines, painted flat), with three line sets. Outline takes silhouettes and borders. Inner takes creases and material borders, drawn lighter. Again redraws the outlines a little to one side, here and there. Strokes taper at their ends, run on past corners (Backbone Stretcher), wander (Perlin noise), are heavier near and paler far |
| ink pass: joints and contacts | PW Wash takes the joints from pw_joint, finds those between faces of rock and colours where pw_ink changes within one material on one surface, and draws a contact where a pencilled thing meets the grass just behind it |
| brush pass | the compositor's Kuwahara, sized per pixel: broad where nothing is pencilled, fine where something is |
| page pass | PW Wash: the wash a hair off the line, darker where two washes meet, pooled and settled into the paper's tooth. The line is the colour under it gone dark, never black. Paper grain is procedural |
| clumped trees and clouds | PW Clumps: balls lit as one, five flat tones and a ragged cellular edge. clumps.create_trees() and create_clouds() grow them as createTrees() does |
TIMES | four PW worlds. Each carries its colours as custom properties, which every material reads with an Attribute node set to View Layer |
Line Art lost to Freestyle here. Its strokes have a radius in metres, so a near wall gets a marker pen and a far one gets nothing. Freestyle's are pixels wide, taper along the stroke and run on past corners. Leaves, cloud and grass go in PW Foliage, which the lines layer leaves out. PW Wash keeps only the strokes that land on something pencilled, so a tree still hides the house behind it, and Freestyle never has to read half a million leaf faces.
The demo
blender --background --python demo/brookfield.py -- --cam street --time afternoon --out street.png
Cameras: street (down the village street to the church tower) and lane (by the thatched cottage, with the church beyond). demo/brookfield.blend is the street at afternoon, ready to render. tools/shots.py builds any camera and time as a .blend, and --plain takes the look off. tools/make_blend.py builds pencil_and_wash.blend. The shots here were rendered on Patch's cloud Blender, on its L40s GPUs.
The walk
A 25-second walk through Brookfield: across the meadow, up the lane, past the stone cottage at golden hour, and by the thatched cottage, where the look wipes off.
tools/video.py builds four walking shots through Brookfield as .blend files: across the meadow, up the lane, past the stone cottage at golden hour, and by the thatched cottage. Each runs two bars of Patch's 77 BPM clock, 150 frames at 24 fps, and the cloud shadows drift as it plays. They use steady lines: Freestyle lays a stroke's wobble and pressure from wherever the stroke starts, and a moving camera keeps moving those starts, so with the full pencil the lines boil. The camera glides at an even height with no step in it: a bobbing step makes the near ground surge and stall twice a second, and under the still sheet of paper that reads as the picture trembling. --plain builds the same shot with the look off. tools/cut.py lays the shots end to end with hard cuts. In the last one the look comes off with a wipe on the cut easing, cubic-bezier(1, 0, 0, 1), over 390 ms. There's no fade and no sound.
A 20-second comparison reel, cut by tools/reel.py on the same clock, puts the look against plain EEVEE one or two beats at a time. It uses wipes from every side, a diagonal, stepped columns, a split, sliders, side by side and stacked frames on black, a flipping grid, a flicker and a box reveal.
Five steady seconds
Five seconds across the meadow that hold still, made the way any shot of the look can be:
blender --background --python tools/video.py -- 5 hero.blend --x2 # steady, at twice the size
# render hero.blend's frames as a .mov, then
python3 tools/settle.py hero.mov hero.mp4 --down 2
Why it flickers at all: the look is drawn on the pixel grid. The paper's tooth, the brush, the joints the wash finds and the turn from light to shade are each decided pixel by pixel, and the scene has detail finer than a pixel. When the camera moves, a pixel lands on a slightly different bit of the scene every frame and can tip from one side of a decision to the other and back. Three things stop it. Steady takes the tipping points out of the look where it can. Rendering at twice the size and scaling down gives each pixel four samples, so what's finer than a pixel is averaged instead of tipping. tools/settle.py follows the picture's motion to the three frames either side and averages them in, weighting down anything that doesn't match, so change that lasts comes through and change that comes and goes doesn't. Measured frame to frame against plain EEVEE along the same path (which has nothing in it to flicker), the walking shots came out at about twice plain's figure; these five seconds come out within a sixth of it.
Where it stands
- Speed: a 1080p Brookfield frame at 64 samples takes 11 to 17 seconds on an L40s once its shaders are compiled. That's about one credit on Patch's cloud Blender. A cold machine first spends 3 to 4 minutes compiling. The scene is 620k faces, half a million of them leaves.
- Needs: Blender 5.0 or later and EEVEE. Freestyle runs on the CPU. Put leaves and grass in PW Foliage, or it reads every face of them: with Brookfield's trees left in, Freestyle filled a 16 GB machine.
- Cloud shadows drift with the scene's
pw_timeproperty: drive it with the frame (frame / 24) to make them move. - Animation: apply with
steady=True, and move the camera smoothly: no handheld bob. The paper stays still on the screen, as a sheet would, so any shake in the camera shows against it, and a grain a pixel across over everything that moves fizzes; steady gives it a broader tooth. Measured frame to frame over the four walking shots, steady takes out about 40% of the flicker the look adds over plain EEVEE; most of what's left is the paint's own turn from light to shade on sunlit walls and in the trees. Jittered shadows make a frame take about a third longer. - Not here yet: the people, the railway and the farm from the three.js demo, and a quality setting for slower machines.
Credits
See CREDITS.md. Code MIT. Everything is made in code.



