Freestyle for Blender

For the first time I’m doing some trials with Freestyle on BI, needless to say that I have great troubles to get what I want, and that I find the interface rather unfriendly, but since we are in Blender this does not surprise me that much :).
I assume for sure that I make many mistakes, and I still have not figured out certain features, partly because the documentation is fragmented and incomplete, but what puzzles me and makes me think that there is some bug in the way the edges to be traced are calculated, is the fact that in two subsequent viewport renderings, without any change of the settings, I get two totally different results, so to speak, sometimes a lot of lines, sometimes only a few.

And the Exclude checkmark for edges types seems to have no effect at all.

paolo

@sourvinos:

If you post a .blend, I’m sure we can help you to understand what is going on. Personally I find Freestyle frustrating at times because of the changes between renders, but I more or less understand what causes them. Let me try to pick up on your points.

  1. When things change between renderings, it is probably because one of the parameters you have set is somehow randomised. You shouldn’t find changes between successive renderings of, say, simple lines with no chaining, thickness or geometry modifiers. But if you add a Spatial Noise geometry modifier then yes, things will change each time. Even then I’m surprised that you get ‘totally different’ results. A .blend would help to understand that.

  2. The Edge Mark parameter is often overridden by the others when you have the Logical OR button set. So for example, if you leave ‘creases’ on then a marked edge may still be given a Freestyle line because it is marked but it is also a crease. So try turning on the Logical AND button. Now an edge will only be given a line if it is both a contour AND a marked edge. That may not be the behaviour you are expecting but it gives you a lot of control. You may need a number of Line Sets to achieve what you are after.

Hope that helps. There is certainly a learning curve here, but Freestyle is a very powerful tool once you understand how it thinks!

Is there a plan to make freestyle lines editable without re-rendering? It seems there’s going to be an svg export functionality soon. Will that somehow allow for editing freestyle line styles (without re-rendering) as well?

One other thing I’m curious about is the ability to bake freestyle lines into a model’s texture. Obviously, it wouldn’t include view-dependent lines such as object outlines. Also, if freestyle could somehow be integrated into the uv editor, it could potentially be used to paint around partially transparent polygonal hair for example. Even better if the process could be automated by calculating alpha variation within a texture just as z-depth variation is used for a 3d scene to generate freestyle strokes

Edit:
Ok, I just read about view map caching. Thank goodness!
Couldn’t find anything on partial transparency though

@edna,

Thank you for your responses, I must say that NPR is not in my usual workflow and goals, so in this moment I’m not willing to lose much time with it even if it could be useful for some jobs I have in mind.

About posting a .blend file, the one and only which i’m working on is very heavy and complicated, and until I don’t find a satisfactory result nobody can suggest what to do, the only way I can see is to arrange settings along the way, and I would like to be able to tweak parameters step by step, both for learning and for the result.

I didn’t use any modifier, just chaining, but it sometimes seems to have no effect, apart from those random changes that appear from time to time.

As for Logical AND and OR, I don’t use Edge Marks at all, and I think that I have to use OR to get various kind of edges drawn with the same type of lines, what seems not working is the Exclude option. I have read on references that if you want some type of edges to be excluded you have to select them and check the Exclude option, but id doesn’t work to me.

What you suggest to use AND, if I understand correctly, makes things a lot more complicated, above all because there is not way to ‘copy-paste’ settings, and it is against my logic, so to say, I want contours and creases to be drawn with the same type of lines, so I select both and I set on the Logical button OR, am I wrong?

Sorry for my bad English, in makes even harder to understand.

EDIT: basically, what I’m trying to get is a kind of design details on a sculpted figure, so that it resembles a drawing shaded line art, but I find hard to make the lines flow along a main direction (that of the sculpted strokes) and I get rather confused curved lines surrounding such strokes.
This along with the problem of repeated lines over not wanted edges that I tried to expose above.

paolo

Can Freestyle be made to work properly with the hair particle system?
From my quick tests, it looks like Freestyle will try drawing lines on the hair particle paths, not the actual rendered particles.

@s12a

I’m not sure what you would consider ‘working properly’, in my opinion Freestyle does exactly what it’s supposed to do in this case.

Freestyle is mesh/edge based, so it needs real geometry in order to produce a result. Apparently hair primitives are considered real geometry (they are shaded and tessellated, it seems), and therefore Freestyle renders them.

Please read that as “made to work as a naive user would expect”, that is, rendering Freestyle edges on the final rendered hair rather than the primitives. Of course, it would be useful if this could be accomplished without destructively converting the particle system to a mesh beforehand in the viewport/editing phase.

With normal, very thin hair particles there wouldn’t normally be much benefit in using Freestyle with them, but by using much thicker strands than normal I believe that very interesting (and useful, for certain usage domains) effects could be achieved. For example with something like this:

http://i.imgur.com/btVy8til.jpg

The hair primitives are the final rendered hair. You’re expecting the opposite, that you will get Freestyle edges on the hair particle path used to define the location and shape of that primitive. The thing you manipulate in the viewport when combing and styling hair is not the thing that actually renders.

I believe that would require two things:

  1. hair being see as geometry that can be handled by freestyle.
  2. The amount of geometry then handled by freestyle not freezing computers.
  3. the tricky indication part of freestyle would need support, and though I don’t strictly keep up with freestyle news, I am pretty sure this required a lot of effort to implement and thus hasn’t.

For now, it’s best to try and learn to model poly-hair :slight_smile:

Poly hair without transparency!!!:slight_smile:

this severely limits freestyle’s usability.

Can someone please suggest how to get lines smooth and not flicker from frame to frame?
I have struggled with this for sooo long now and sometimes you kind of can make that as an effect, not defect, but I really can’t do that this time. I will appreciate your help very much, thank you! Of course if that is possible at all…

there’s always gonna be a degree of flickering, depending on the kind of lines being detected. For example, relatively stable lines such as object and material boundaries should not flicker as much as creases.

at least, that’s what the theory suggests.

if you want to further minimize the flickering, try using uniform-thickness lines wherever you can.

Can’t do that if I have design guidlines to follow.

And there should not be flickering, I remember when I was using maya, it had a really stable lines.
Sorry, could not resist to tell that.

@karlis.stigis

getting a completely stable animation is hard, but you should be able to get better results than this.

tip nr. 1 would be to use a sufficiently smooth mesh and the (properties -> render layer -> freestyle ->) face smoothness option. I’ve used this for testing the svg exporter and it generally produces a quite stable animation.

if that’s not enough maybe a higher fps will help a bit, to smooth the transformations. (alternatively you could let the camera move slower)

@karlis,
haha, i feel you.
i’m also used to working in unity3d, and writing my own shaders whenever i need something special.

have you considered getting an osl toon shader? those should be less flickery than freestyle, but probably not as clean as freestyle’s lines.

just out of curiosity, your maya line renderer… is it a plugin of some sort? what’s it called? i’d like to find out how it works

I haven’t got time to actually try out OSL yet. I know how it basically works, but don’t know where to find such shaders for lines.

Maya has an integrated toon lines option. It works in 2 ways, one is similar to freestyle wich is calculated from 2D and another which basically makes 3D mesh lines on the objects and renders those out as meshes, but the result is really nice, stable lines. And it has basically all the same functionality. Something like wireframe modifier, but with much more possibilities.

https://vimeo.com/51239125

too bad… i’ve never used osl myself.
there are lots of shader libraries out there, but i’m afraid most of them use hlsl or glsl or cg… but maybe there are external renderers out there that support such shading languages. if you run out of options, it might be worth a try.

i’m not sure about this, but maybe adding a tiny bit of motion blur could reduce the flickering…

i see… thanks for the info.

Some new test with freestyle

Hi Zbyszko, that’s a very nice turn-table animation render. Thanks for sharing!

I understand that svg output for Freestyle is being worked on. I have had a brief look at Synfig, which looks like a capable package. Would it be possible to export a Freestyle animation in vector format at say 4 frames per second, import into Synfig and tween the additional frames in Synfig? I ask, as I wonder if it would be worth the effort to become proficient in Synfig? Should perhaps add I am already proficient with Freehand, Illustrator and Inkscape.