Jump to content
Site Stability Read more... ×
  • Advertisement
Sign in to follow this  
Panzooka

cel shading lines

This topic is 5481 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Quote:
Original post by JohnBolton
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.
Surely you can just move vertices along their normals, instead of simply 'enlarging' the model? Though that does require fully welded meshes, I guess.

Share this post


Link to post
Share on other sites
Advertisement
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).

Share this post


Link to post
Share on other sites
wirefram is ugly, because i dont want to draw line in front, and u cant control that in wirefram mode.

i guess the polygon backface method is the best.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!