Outlines That Follow the Fur: Learning What Freestyle Can't Do

My outlines looked great on one character and fell apart on the next. The fix meant giving up on the feature named "line rendering" entirely.

I’m a beginner at Blender. I’ve been learning it by building Oakborn, which means most of what I know arrived as a sequence of things that didn’t work. This is one of those, and it’s my favourite kind: the problem wasn’t that I used the tool wrong. The problem was that I’d picked a tool that fundamentally could not do the thing I wanted, and it took me a while to notice because it worked fine on my first test subject.

The Goal

Oakborn’s sprites are rendered in Blender and composited into a 3D isometric scene in Godot. At the sizes they end up on screen — a folk is about 128 pixels tall — a character can dissolve into the background. Grass is green, robes are green, everything is soft and desaturated because that’s the mood I want. Lovely, until you lose your villager in a meadow.

The standard fix is a dark outline. I wanted the folk in particular to carry a heavier line than everything else, because they’re what the player should be looking at.

Attempt One: Freestyle

Blender ships a feature called Freestyle. It’s a non-photorealistic line renderer, it has a checkbox labelled “silhouette”, and it is exactly what every tutorial points you at when you search for outlines. I turned it on and it looked great.

On the female folk.

Then I rendered the male folk, whose hair is a particle system rather than a modelled mesh, and got a line arcing across the top of his head, cutting the hair in half. Then I rendered the sheep, which is essentially a cloud of fleece particles, and got a smooth egg drawn straight through the middle of the wool.

Not missing lines. Confidently wrong lines, in places nothing visible existed.

Here’s the male folk’s head. Left is no line work at all, middle is Freestyle, right is where I eventually ended up:

Three renders of a folk's head: no lines, Freestyle tracing the scalp hidden under the hair, and a compositor rim following the hair itself

Look at the middle panel, and specifically at that clean arc running across the top of his head — straight through the hair. Freestyle hasn’t failed. It’s doing precise, correct work on the eyebrows, the parting, the line along the ear. It’s just drawing an outline around something other than what I can see.

The sheep makes it even more obvious:

Three renders of a sheep: no lines, Freestyle drawing an egg shape through the fleece, and a compositor rim following the wool

Freestyle found the horns, scribbled enthusiastically inside the horn spiral where the geometry folds in on itself — and drew a smooth egg shape straight through the middle of the fleece. That egg is the sheep’s body mesh, the one buried under all the wool.

Why It Could Never Work

This is the part I wish I’d understood a week earlier.

Freestyle is a geometry line renderer. It walks the edges of your mesh and decides which ones are silhouettes, creases, borders, and so on. It is, in a sense, drawing on the model.

Hair and fur in Blender are particle systems. They are generated at render time and they are not mesh edges. There is nothing in the model for Freestyle to walk.

Which explains both pictures. That arc across the folk’s head is the outline of his scalp — a perfectly good silhouette of a perfectly real mesh that happens to be buried under hair. The sheep’s egg is its body, the compact little shape the fleece grows out of. Freestyle was never looking at the hair at all. It was drawing the model I’d hidden, and from its point of view it had done the job correctly.

So the question changed. It stopped being “how do I configure Freestyle correctly” and became “what else knows where my sheep actually is?”

Attempt Two: Give It Something to Trace

My first instinct was to cheat: build a low-poly shell roughly the shape of the hair, let Freestyle outline that, and hide it from the camera. A hull proxy.

Two renders of a folk's head: a thin Freestyle contour detached from the hair, beside the compositor rim

It sort of worked, which was the worst outcome — look at the left panel above, where the line sits a clear few pixels off the hair on both sides. The contour floated off the hair — close to the silhouette in some frames, clearly detached in others, because a static hull can’t follow hair that moves with the head. And now I had extra geometry to maintain for every furry thing I would ever model. I deleted them.

Attempt Three: Use the Alpha Channel

Next idea: the sprites are rendered on a transparent background. The alpha channel already knows exactly where the sheep is. Threshold it, grow it a few pixels, and I have a silhouette.

This one failed for a reason I thought was worth writing down, because it’s the kind of thing you only find by looking at the data. My renders use a shadow catcher so the characters have a soft contact shadow on the ground. That shadow lands in the same alpha channel as the fleece. I plotted a histogram of a sheep frame expecting two clusters with a gap between them — opaque sheep, transparent background — and got a smooth ramp. Every threshold I could pick either traced the edge of the shadow or ate into the wool.

What Finally Worked

Blender can output an Object Index pass. You tag objects with an integer, and the renderer writes a pass that says, per pixel, which object is there. It has nothing to do with geometry edges and nothing to do with transparency. It’s just: is this pixel the sheep, yes or no. Hair included, because the pass is produced after the hair exists.

From there the outline is four nodes in the compositor:

  1. ID Mask — turn the object index into a clean black-and-white mask
  2. Dilate — grow that mask by N pixels
  3. Subtract — dilated minus original, which leaves only the ring around the edge
  4. Set Alpha + Alpha Over — colour the ring and composite it underneath the render

That last word matters more than I expected. Drawing the rim under the image means the line only shows where there’s nothing in front of it, so it reads as an outline rather than a border painted over the character. It also means wispy hair ends up with a soft, slightly broken line instead of a hard one, which looks better than the clean version I thought I wanted.

Because it works on rendered pixels rather than model edges, it doesn’t care what the thing is made of. Mesh, hair, fur, feathers — all the same to a mask.

A note on Blender 5

If you’re following along in Blender 5, the compositor API moved and most tutorials are out of date. The compositor now lives in a node group on scene.compositing_node_group. CompositorNodeComposite is gone — you end the graph with a NodeGroupOutput. And CompositorNodeMath is gone too, so the subtraction in step 3 comes from ShaderNodeMath, which took me an embarrassingly long time to find.

Tuning It Per Creature

Having the outline live in the render settings rather than the model means each entity can ask for its own. My render pipeline is driven by small Python config files — one per entity — and the outline is two lines in them.

The folk get a 3-pixel rim. The sheep gets 1.5. Villagers come forward; animals sit back. That’s a deliberate visual hierarchy, and it costs me nothing to change my mind about it later.

The sheep also has Freestyle switched off entirely now. Once the silhouette came from the compositor, those interior lines were only finding creases in the wool and that mess inside the horn spiral. The rim alone reads cleanly at 128 pixels. The folk kept Freestyle, because the interior lines genuinely help there — the knotwork on a robe, the belt, the fold of a hood.

So the two systems ended up splitting the job: the compositor owns the outside, Freestyle owns the inside, and each entity decides how much of each it wants.

What It Cost

I’d assumed line rendering was the reason my folk renders were slow, and put off the whole investigation because of it. So I finally measured, and I was wrong twice over.

Freestyle costs about 0.4 seconds per frame. The compositor outline is, as far as I can measure, free — the same 4.3 seconds per frame whether it’s on or off. All the render time is the fur itself: the male folk’s hair and the sheep’s fleece are roughly four times the cost of a character without a particle system.

That’s a useful thing to know and it was cheap to find out. I’d been avoiding a measurement for weeks in favour of a guess.

The Beginner Lesson

The thing I keep taking from this: the feature named after what you want is not necessarily the feature that does what you want.

Freestyle is called line rendering. I wanted lines. The match was so obvious that when it failed I assumed I was holding it wrong, and I spent real time building hull proxies to force the tool to work instead of asking what the tool was actually for.

What unstuck me was a shift in thinking that I suspect is obvious to anyone with more rendering experience: stop thinking about the model and start thinking about the passes. The renderer knows a great deal that isn’t in the geometry — where each object is, how deep it is, which pixels it covers. Once I started treating the render as a stack of data channels instead of a picture, the outline problem had an answer that didn’t involve modelling anything at all.

For someone coming from programming, that reframing feels very familiar. It’s the moment you stop patching the symptom and go look at what the system actually has available.


Oakborn: Sacred Settlement is a cozy Celtic village builder currently in development. Follow along on the Dev Blog to see more behind-the-scenes posts like this one.