Freestyle integration into Blender

March 14, 2010

Weekly update March 2-14

Filed under: Update — The dev team @ 11:04 PM

During the last two weeks, the dev team was working on support for full sample anti-aliasing.  At the moment, full sample anti-aliasing does not work well with Freestyle.  Strokes are drawn only in one of multiple samples, which results in very faint strokes in the final anti-aliased render.  The full sample anti-aliasing issue has been demanding a considerable amount of code reading with regard to the render pipeline of Blender’s internal renderer, and so far no major coding has been done.  A proper implementation of full sample anti-aliasing for Freestyle seems a non-trivial task due to the complexity of the render pipeline.  The internal renderer is multithreaded through a tile-based data decomposition in which an image to be rendered is split into a two-dimensional grid of tiles.  Each tile is a small portion of the entire image, and multiple threads work on different tiles in parallel.  When full sample anti-aliasing is enabled, the render pipeline also involves external file I/O in the EXR image format.  These implementation details make it difficult to enhance the internal renderer so that full sample anti-aliasing works properly with Freestyle.  We will further look into this issue in the next weeks.



  1. :)

    Comment by dd — March 15, 2010 @ 4:08 AM

  2. dev :)

    Comment by dd — March 15, 2010 @ 4:11 AM

  3. There is no “simple” solution by forcing freestyle strokes to be drawn in all samples?

    Comment by yoff — March 15, 2010 @ 3:13 PM

  4. yoff,
    I don’t think there is such a simple way, because even without
    full sample anti-aliasing, strokes have to be rendered separately
    from the other render components such as combined and Z depth.
    This separation is essential, since we have two totally different
    scenes during rendering. One scene is the current scene prepared
    by the user, and the other is an auto-generated one for stroke
    rendering. The second scene contains those meshes that represent
    strokes generated based on the current scene. Since some style
    modules rely on diffuse and Z passes within the render result of
    the first scene, the generation of the second scene can be done
    only after the completion of the rendering of the first scene.
    All these major and minor implementation details make a naive
    approach inappropriate. I hope I will be able to find a proper

    Comment by The dev team — March 15, 2010 @ 10:04 PM

  5. I see, thank you for the thorough answer :-) . Although, if the freestyle lines are rendered separately of the rest, it is not clear why faint lines should ensue. Is it a matter of giving the lines layer full weight in the final composition rather than treating it as one of many samples?

    (feel free to not spend any time on my questions by the way)

    Comment by yoff — March 19, 2010 @ 1:06 AM

  6. yoff,
    Faint strokes are resulting from the problem that only one of many
    samples has strokes drawn on it. For instance, when the number of
    samples is 8, strokes are drawn on one sameple image and the other 7
    samples are left without strokes, so that averaging the eight samples
    leads to very faint strokes having a 12.5% transparency. Dazzle made
    a detailed analysis of the issue in the BA Freestyle thread.

    Comment by The dev team — March 19, 2010 @ 11:21 PM

  7. I have reread his analysis now. I still maintain, that on a high level “all you have to do” is either add freestyle lines to each sample image or composit the freestyle lines in after averaging the sample images (so it gets full weight).

    I concede, though, that it may not be trivial in practice, as you may have to deal with the io (because of the sample image files) and the multithreading (if you want to control in which order things are done).

    I hope you find a solution that is not discouragingly difficult to implement. You are doing great work, and I admire your tenacity and persistence…

    Comment by yoff — March 20, 2010 @ 12:42 AM

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Create a free website or blog at

%d bloggers like this: