I am new at this. I am extracting files a game. In the game they have thin black outlines, but they aren't part of a model. I am having trouble finding anything about this. What is the simplest way to do this?

Update: I think I am looking for something like freestyle. What is the simplest way to use this to create a thin black outline around a model?

  • What are you planning to use it for? – piegames Dec 27 '16 at 20:25
  • @Piegames : I am extracting models from a game, and in the game they have outlines. However the outlines aren't part of the model. – LadyAriel Dec 27 '16 at 20:53
  • 1
    A picture would probably help explain your question more. – cmomoney Dec 27 '16 at 23:53
  • As in something like freestyle? – sambler Dec 28 '16 at 1:53
  • @sambler : Yes freestyle is what I think I am looking for. Do you know the best way to create a thin line with that? – LadyAriel Dec 28 '16 at 2:02

In your render settings enable freestyle.

freestyle on

Under render layers add a freestyle line set.

freestyle line set

example from default settigns

The line thickness is a quick way to adjust the size of the line drawn. For more control over what edges are used to draw lines and how the lines are drawn, you will need to look through the freestyle documentaion.

  • Thanks this seems to work for what I need. However it creates an extra box on the inside of the model (probably because it is a different material or something). I have tried all sorts of options, but I can't remove it. Is there anyway to fix that? – LadyAriel Dec 28 '16 at 19:22
  • It is finding the edges of the model, unless you enable material boundary. Is it another object? or an extrusion within the object? – sambler Dec 29 '16 at 3:16
  • I figured out how to remove the box, but I have another issue. There should be an outline around the nose of the object, but I can't figure out how to outline the entire nose (only a part of the nose is highlighted). Here is the blend file, so you can see more the mesh or anything else. – LadyAriel Dec 29 '16 at 17:10
  • If you have trouble with it picking up edges you want drawn, you can specifically mark an edge as a freestyle edge so it will be drawn. – sambler Dec 30 '16 at 7:21

As I supposed, this model is used in a game. In games, rendering happens differently than in Engines like Cycles. You wouldn't put the information about the outline into the model, but code it as an effect. Here's an approach how to do this in games:

  • Lock depth buffer writing
  • Render the object as wireframe with a thick colored line
  • Enable depth buffer writing
  • Render the object again, this time normally.

There are other ways to do it, (for example with some normal calculations), but this one is fairly common.

How to recreate this effect in Blender?

Idea 1

As mentioned in the answer by @sambler, you could use freestyle.

Idea 2

Another way is to use modifiers and render passes to emulate the effects done in the game:

  • Duplicate your model and put the clone on another layer. Add a Wireframe modifier to the clone and change it's material to the outline material.
  • Exclude the wireframe clone's layer from your scene rendering. Add another render layer, rendering only the layer with the wireframe object.
  • Composite them together with a Z Combine. Make sure the Z values of the Wireframe are always greater (farther behind) than the object, but never too far that they get hidden by other objects.

idea 2

Idea 3

Another idea I found here is quite similar to 2:

  • Duplicate your model. The copy will be the outline
  • Select your outline model and go into edit mode
  • Select all faces and use Alt+S to "extrude" them. Quit edit mode
  • Assign each one a different material. You can join the meshes if you want.
  • Make the outline's material transparent when front facing and black (outline color) when back facing.

The original idea used a geometry shader to extrude backfacing faces but it didn't work with displacement in Blender. Also the inner material has to be emission (I don't know why, but it is just an idea you could elaborate). Final result:

enter image description here

Idea 4

Similar to 2. Probably my favourite.

  • Set a unique Object or material ID to the object that should have an outline (I went for object)
  • Enable object (or material) render pass in your render layer.
  • In compositing, use the ID mask to cut out your object. Blur the mask, color it and use alpha over nodes to put all together.

In the screenshot, I've labelled the nodes with their function so you know wich values to tweak. enter image description here

Here's the node setup for idea 4:

  • In regards to idea four, since freestyle has some extra lines that I don't want and I can't figure out how to get ride of. How do you add the Object ID node? I can't figure out where it is. – LadyAriel Dec 28 '16 at 19:19
  • Add -> Converter -> ID Mask. I renamed its label in the screenshot - sorry for confusing you – piegames Dec 28 '16 at 20:13
  • How did you add the Multiply and all the outline nodes? I can't find those. – LadyAriel Dec 28 '16 at 21:27
  • The multiply node is a Math node, the "Outline color" node is a "set Alpha node" I renamed as well as for the "Outline size", which is a Blur node. If I hadn't closed Blender without saving I'd redo the screenshot, maybe tomorrow – piegames Dec 28 '16 at 21:31
  • Okay I think I connected everything exactly as your picture, but it is a black square. The only thing I notice is that the first multiple node has a value instead of "image", as seen in your picture. How do you fix that? – LadyAriel Dec 28 '16 at 21:47

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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