Search Unity

Quality Toon Shading?

Discussion in 'Shaders' started by milkytreat, Feb 17, 2007.

  1. milkytreat

    milkytreat

    Joined:
    Jan 15, 2007
    Posts:
    267
  2. forestjohnson

    forestjohnson

    Joined:
    Oct 1, 2005
    Posts:
    1,370
    I don't know if you can really do that. Those cute toon dudes are all hand drawn. First you would have to model and texture the things really well in the right style. I think the toon shaders that come with Unity are probably the best you can get. But that doesn't mean they can't look almost that good, especially with good modeling and AA.
     
  3. milkytreat

    milkytreat

    Joined:
    Jan 15, 2007
    Posts:
    267
    i know they arent hand drawn
     
  4. Samantha

    Samantha

    Joined:
    Aug 31, 2005
    Posts:
    609
    I think the secret to achieving the effect in the videos is to use very high resolution models. That said, Unity should be able to do it with the Toon Shader and some well-made toonmaps.

    Check out my old project Neko Factory

    http://www.nekofactory.com

    Does that quality come close to what you're looking for? I made that almost completely by myself and I am certainly no artist.
     
  5. davidpolcino

    davidpolcino

    Joined:
    Feb 2, 2006
    Posts:
    65
    Hah, that's cool. Did the guy running the boot go on strike at the end though? All those Neckos piling up!
     
  6. milkytreat

    milkytreat

    Joined:
    Jan 15, 2007
    Posts:
    267
    Thats great! are you into plushies because then you certainly are an artist , plushyou thats awesome :)

    not exactly what im looking for, i guess Im looking for that clean crisp vector look in 3d, I just find it really strange its hard to get either 2d vectors (AS vectors) into a 3D engine or make 3d look like 2d vectors..

    I thought it would be easier due to the apparent simplicity of vector graphics opposed to the realtime renderings of real life (water shaders!)

     
  7. milkytreat

    milkytreat

    Joined:
    Jan 15, 2007
    Posts:
    267
    *bump*

    I'll pay someone if they can just get the outlining of the existing toonshader to work with thicker lines

    Even if that means duplicating the mesh, colouring it black, flipping it and scaling it bigger...
     
  8. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    That's exactly what the Toon shaders shipped with Unity do - they scale the mesh in a separate drawing pass and draw it black. You can control the thickness of the extrusion via a slider in the Material.

    However, I believe the images you linked to are rendered with offline (non realtime) renderer, and it has two key things which make them look good: 1) very high quality anti-aliasing, especially for the lines, 2) lines are probably not geometry based, but rendered in image space, based on difference in pixel normals, depth etc. Both of these things are hard to do in realtime...
     
  9. milkytreat

    milkytreat

    Joined:
    Jan 15, 2007
    Posts:
    267
    The ones I linked to were different, thank-you for explaining to me why it isnt possible.

    Im playing with the toon shaders provided, I dont know the cause of it or how shaders work exactly or what ive done wrong When the outline width is made quite large it seems to be missing polygons or gap's in between faces.

    Can I fix that somehow??

    I cant remember getting a problem like this when i duplicated,scaled the mesh and inverted it for models i did in activeworlds?

    I apologise for being such a pain :p Thank-you for everyone for dealing with me

     
  10. NicholasFrancis

    NicholasFrancis

    Joined:
    Apr 8, 2005
    Posts:
    1,587
    The gaps come if you have hard edges in your models. Instead you should use tiny taper polygons...

    ASCII-art version follows ;-)
    Code (csharp):
    1.  
    2. Wrong                                            Right
    3. _________ <-Hard edge here         __________
    4.          |                                   \ <- (Tiny) tape polygon here
    5.          |                                    \
    6.          |                                     |
    7.          |                                     |
    8.  
     
  11. milkytreat

    milkytreat

    Joined:
    Jan 15, 2007
    Posts:
    267
    you rock!

    thank-you very much
     
  12. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    Like Nicholas said, and then make sure your normals are "smoothed" - most 3D apps have that option somewhere (smooth vs. flat normals).
     
  13. milkytreat

    milkytreat

    Joined:
    Jan 15, 2007
    Posts:
    267
  14. Discord

    Discord

    Joined:
    Mar 19, 2009
    Posts:
    1,008
    So is there a way to have hard looking edges (on a building for example) and still have a good looking toon outline? Because wouldn't tappering the edges like that make it look almost rounded on the edge?
     
  15. antenna-tree

    antenna-tree

    Joined:
    Oct 30, 2005
    Posts:
    5,324
    Hard edges require duplicating the vertices so the toon shader won't work on hard edges. You're choices are to create the outline in a 3d app by extruding the faces of your geometry outward and then flipping the normals... or duplicate the geometry in Unity and on one of the objects smooth out all of the normals and use this shader:

    http://forum.unity3d.com/viewtopic.php?t=11765