Quote:Original post by JohnBoltonSurely you can just move vertices along their normals, instead of simply 'enlarging' the model? Though that does require fully welded meshes, I guess.
One problem is that it only works for convex models. A doughnut will not render correctly (because the hole gets bigger, not smaller), for example.
cel shading lines
So far I've seen three basic methods for outlines:
- Draw backfaces in wireframe, with outline colour. Dead easy but does weird popping of edges as the model rotates. Not really a good idea.
- Enlarge the model along the normals, then draw backfaces with outline colour. Simple (and fast) in a vertex shader. Works with pretty much any geometry, and doesn't have any weird artifacts as it moves. Dead easy to control the outline size as a constant to the vertex shader as well.
- Image space methods that involve doing edge detection. Great quality, but needs lots of fillrate and fancy shaders.
Second one is probably your best bet (as already suggested). If you want custom outline colours I'd create a second texture for it (yet use the same uvs as the original skin, then you don't need any extra vertex data). If you want to get really fancy you could have a per-vertex attribute that would specify the outline size and let the vertex shader use that while scaling the vertices.
I'm inclined to say that any methods that involve CPU work (like running silluette detection) aren't a good idea since you can just use the same vertex data and a vertex shader. Of course you might already be calculating silluette data (Jet Set Radio uses shadow volumes for example, which gives great clean cut toon style lighting).
- Draw backfaces in wireframe, with outline colour. Dead easy but does weird popping of edges as the model rotates. Not really a good idea.
- Enlarge the model along the normals, then draw backfaces with outline colour. Simple (and fast) in a vertex shader. Works with pretty much any geometry, and doesn't have any weird artifacts as it moves. Dead easy to control the outline size as a constant to the vertex shader as well.
- Image space methods that involve doing edge detection. Great quality, but needs lots of fillrate and fancy shaders.
Second one is probably your best bet (as already suggested). If you want custom outline colours I'd create a second texture for it (yet use the same uvs as the original skin, then you don't need any extra vertex data). If you want to get really fancy you could have a per-vertex attribute that would specify the outline size and let the vertex shader use that while scaling the vertices.
I'm inclined to say that any methods that involve CPU work (like running silluette detection) aren't a good idea since you can just use the same vertex data and a vertex shader. Of course you might already be calculating silluette data (Jet Set Radio uses shadow volumes for example, which gives great clean cut toon style lighting).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement