Unusual flattening on thick outlines with tight bends

Hello,
I’ve been exploring different techniques for animating a continuous body that can overlap with itself multiple times. This includes things like rope, long tails, and this worm friend below. My most recent attempt involved using thick outline layers with linked duplicates for each overlap. The method seems promising, however, there is an unusual effect where the outline crimps and flattens as the spline bend becomes sharper. This can be seen on the worm gif as it rotates through the front-facing angles which interrupts an otherwise decent looking animation.
wormRotate
Does anyone have any suggestions for workarounds or perhaps a solution to this outline effect? I’ve found that it happens with both outline and advanced outline layers, but it does not happen when rendering similar strokes directly with the Cairo graphics library. I’m working on Linux Debian 10. Thanks in advance.

1 Like

What is your Synfig version? 1.2.2, 1.4.0, cloned from repository or another release?

It would be good to see the tangent vectors/values of splines in those specific frames.

Nice technique by the way!

Thanks!

I had been using a repository build that was a couple months old. Yesterday I rebuilt with the latest commit (bbb2dd7), but both have the same phenomenon.

Here’s the source file for the animation. The spline has only 4 nodes. I tried before with more nodes at the peaks, but they would do some crazy twisting as it interpolated from 180 to -180 degrees.


WormRotate.sifz (38.7 KB)

2 Likes

Hello again,

It’s been a bit, but I’m still interested in exploring the root causes behind this behavior. I’m trying to dig through the source code to learn more, but I’m unfamiliar with how these projects are organized. I’ve been reading the docs, however I could still use some help narrowing down my search. My current hypothesis is that the behavior is a result of the way Synfig renders outlines into the work area.

Could someone point me towards parts of the source code that are responsible for rendering outlines? Thanks for your help

The layers are defined here:


in outline.[h|cpp] and advanced_outline.[h|cpp]

They are based on Layer_Shape, define here:


in layer_shape.[h|cpp] files.

Cobra renderer calls Layer_Shape::build_composite_task_vfunc(ContextParams /*context_params*/)const, that uses a rendering::TaskContour that renders the rendering::Contour object that layer builds.

This contour is built via void Layer_Shape::sync(bool force) const, that calls the real ‘implementation’: the virtual methods that really builds the contour (in derived classes/layers): void sync_vfunc().

In summary: you should look sync_vfunc methods of outline or advanced outline classes and the TaskContour implementation: rendering::software::Contour::[render|build]_polyspan , as opengl is broken for now.

1 Like