Outlining a Mesh?

So, I have been googling this problem for a couple days but I can’t come to a definite answer. What I want to achieve is render an outline of a mesh to create a look like Antichamber. I have found three possible solutions so far.

1. Use Sobel Operator to determine the outline of the mesh (This may not work with single color meshes)
2. Use Cel Shading to generate outline using back rendered faces of the mesh drawn a second time. (I don’t know how costly this will be.)
3. Create the texture/outline meshes by hand. (This is the least preferred due to the amount of manual work involved)

So I was wondering what you guys think about this? Am I on the right track with one of these three, and if so, what one is the best option?

Thanks,
Longarmx

Antichamber uses Sobel-Cel-Shading (Sobel-Operator as you call it).
Don’t ask me, I don’t know how it works.

  • Longor1996
  1. I wouldn’t use Sobel on the colors, when I have a depth buffer :wink: You can ‘simply’ run the Sobel Operator on the Depth buffer and it works no matter what colour the meshes are. That version has trouble finding an outline, if two sheets of paper lie on top of each other in your scene, for example (when the depth value difference is small)

  2. It’s exactly as costly as rendering your object without doing fancy fragment operations (for example lightning). Depending on how costly your fragment operations are, it’s from about 1.5 times to twice as costly :slight_smile:

I’m by no means an OpenGL expert, but these are my thoughts, I hope, they’re still helpful :wink: