2
$\begingroup$

First of all thank you for taking the time to read this question. I'm new to Blender, been using it the last week and I'm having great results so far, I've learned most of the basic stuff on both renders.

Since I'm working on a cartoonish project I had this idea, instead of hand painting textures, I'd simply use the Freestyle option and end up with a nice cartoonish texture from baking. After trying it on two projects, it baked successfully but without the freestyle strokes.

So I came to the conclusion it either doesn't work in baking, since it is the last to show up when rendering and only when pressing "F12" not in rendered mode (probably just a childish assumption) or I don't know what to do to get it working.

So how do I bake a texture with Freestyle strokes?

I'm also including some pictures of my scenario, freestyle working fine in final render (F12), but not showing up on baked textures or rendering mode.

Working in final render

Not working in normal rendering mode

Baked textures have no strokes

$\endgroup$
  • $\begingroup$ Since you are doing cartoon style, why don't you use BI? Also, this seems like a bug report which belongs on the bug tracker. $\endgroup$ – someonewithpc Oct 22 '14 at 18:12
  • $\begingroup$ @someonewithpc I don't think freestyle is supported for baking at all, in either BI or cycles. $\endgroup$ – gandalf3 Oct 22 '14 at 18:53
6
$\begingroup$

I'm fairly certain that Freestyle is a post-process type of render which means that when it happens it's more like what happens in the Compositor or Photoshop/Gimp.

Even though the depth buffer can be captured as a flat image to help with 3D reconstruction, when you add detail to a flat rendered image like this, there is no information available for the parts of the model which are not seen by the camera.(back-facing)

So as a post-process, Freestyle can add lines to the edges of model but only so far as those edges are viewable by the camera that was used for the render.

We cannot: (i) take a picture of a giraffe using a camera, (ii) print the photo, (iii) and then turn the photo around to see the reverse side of the subject in a 2D picture.

So far as Freestyle is concerned, the Cycles/BI Render is a 2D picture.

Even if Freestyle was run after a Cycles bake job; it would still only be run after the texture bake has completed; just as it only runs after a camera render has taken place.

It's post-process.

Instead, you can duplicate your model then add a Wireframe Modifier. Selectively delete geometry.

enter image description here

Add an Emission Shader to the wireframe.

enter image description here

Now bake,

enter image description here

You may also want to bake an Emission Mask so that a GLSL shader won't overwrite the glowing areas with Directional lighting.
Just make the model'White'(1.0,1.0,1.0) and make the Sky solid Black

enter image description here

The Blender Render(Internal) Settings for masks like this can be found in the Textures Tab next to Materials. Various game engines can make use of masks in a similar way.

Just make sure to add the Mask as the 4th channel(alpha) for Blender or else it may not be used by Emit, Specular, Exponent, etc...

enter image description here

If you would like the baked lines to be black instead of Emission, then just use a regular Diffuse Material and the Shadows/Occlusion should make the lines black.

$\endgroup$
  • 1
    $\begingroup$ Thank you for your honest and informative answer, I suspected it was post processing, seeing as it only appears after the render has finished, but im new to blender and wanted to ask away. Your comment is very informative, it will help me a lot! $\endgroup$ – Klint Mane Oct 22 '14 at 20:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.