Jump to content
  • Advertisement
Sign in to follow this  
shultays

cel shader question

This topic is 3108 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

I am trying to implement a cel shader into my project but I have problems while determining edges. I am using this technique http://en.wikipedia.org/wiki/Cel-shaded_animation I am rendering normal.xyz and depth into a texture and after that use a sobel filter in a post process to detect edges but my results are very messy (disregard the textures on terrain, I am working on only edge detection now) terrain is rather good but player model has very large areas that are detected as an edge. I think the problem is on player normals change pretty fast in a very small area and that causes edges. is there a better algorithm for cel shader? I searched a bit this result looks good (search for "linedraw") http://developer.download.nvidia.com/shaderlibrary/webpages/hlsl_shaders.html but it looks like same algorithm that wiki says. maybe problem is about rendering my normals? In my vertex shader I use OUT.Norm = mul( float4(IN.Normal,0.0) , World); OUT.Norm.w = saturate(distance(IN.Pos.xyz, EyePos.xyz)/6000); and in pixel shader return float4(0.5*(normalize(IN.Norm.xyz)+1), IN.Norm.w) so what my be a problem, or is there a better algorithm?

Share this post


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

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!