Since the last blog post, the dev team was digging into Blender’s render pipeline with the aim of addressing an instability issue regarding animation rendering. The issue was that animation rendering was very instable when Freestyle was enabled.
After lots of code reading and a number of attempts for resolving the problem, the cause of instability was finally identified as follows. In the Blender code base, RE_BlenderFrame() and RE_BlenderAnim() are internal top-level rendering API functions for a single frame and a series of frames, respectively. These functions employ some global variables to keep render pipeline states. Freestyle’s stroke rendering was relying on RE_BlenderFrame() to render a temporary scene of stroke meshes. This means that two calls of the top-level rendering API functions were nested, which caused broken render pipeline states and eventually led to a crash.
An attempt to fix the instability issue has been made in revision 27213 of the Freestyle branch, by introducing new rendering API function RE_RenderFreestyleStrokes() specifically geared to stroke rendering in Freestyle. The new function does not do anything with regard to the global variables in the rendering API implementation, so that the render pipeline states are kept clean. As far as we have tested, animation rendering with Freestyle appears much more stable than it was in the past. User-side testing and problem reports are highly appreciated.
The renders of the week are offered by mato. In the BlenderArtists Freestyle thread, he presented impressive line drawings of chrysanthemum shown below, together with a custom SVGWriter style module for drawing strokes with depth-dependent variable line thickness. Thank you mato for sharing the cool results!