black outline

Started by
2 comments, last by nubcheese 15 years, 4 months ago
I'm just wondering what is needed to create a black outline on 3D objects programatically. Thanks.
Advertisement
Are you looking for just a silhouette or a silhouette, ridges and creases? If you're looking for just a silhouette outline, it is pretty straight forward. There are a few ways to do it (using the stencil buffer for instance), but here is how I do it.

Basically you use two passes. The first pass you extend the mesh using a vertex shader and the second the draw the mesh as normal. In the first pass you can draw the backfaces first (e.g. draw the opposite way you're drawing your geometry), so you get a black silhouette.

This doesn't always look that great however. You're much better off using the stencil buffer, as this ends up looking a lot better. It's a little more tricky to do though, so I won't get into it (aka I can't remember off the top of my head).

If you're wanting the silhouette/ridges/creases, there are also several ways to obtain this effect. One is doing it in image space (which is slow) another is to create a fin mesh (essentially a wire frame). There is a great article here that explains how to do this Fast Silhouettes
http://blog.csdn.net/xoyojank/archive/2008/12/01/3422631.aspx
http://blog.csdn.net/xoyojank/archive/2007/11/19/1891820.aspx
MSN:xoyojank#live.com
awesome, thanks a tonne for the help :)

This topic is closed to new replies.

Advertisement