Search Unity

Toony Colors Pro+Mobile: Cartoon Shaders pack with lots of features!

Discussion in 'Assets and Asset Store' started by Jean-Moreno, Apr 15, 2013.

  1. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    EDIT:
    Toony Colors Pro+Mobile 2 has been released: check it out here!
    -----------------------------------------------------------------------------




    Following the success of the free Toony Colors Shaders, I decided to expand them with more features and mobile compatibility!

    So I present to you Toony Colors Pro+Mobile!
    (formerly Toony Gooch Pro+Mobile)

    Pro because there are a lot more features to them, notably:
    - normal/bump maps
    - specular (with alpha masking)
    - backfaces outlines (fixed or constant sized, with optional correction for complex geometry)
    - rim lighting


    Mobile because they have been optimized to work well on mobile devices compared to the previous free version!

    The package contains all combinations of the features and optimization techniques, so that you can find the shader you need for your design and performance needs! ;)

    Click here to take a look at the interactive WebPlayer Demo Scene!

    Link to the Unity Asset Store

    Feel free to comment if you have any question, suggestion or anything else to say!


     
    Last edited: Mar 11, 2015
  2. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Looks great - purchased, congrats for the release !
     
  3. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    Thanks!

    Just a heads up: I'm working on better rim lighting performances on non-bumped shaders! (moving a bunch of stuff from fragment to vertex program!)
    Stay tuned ;)
     
  4. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    Wow! Loved your cartoon packs!

    How's the performance? How many draw calls per mesh?
     
  5. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    Performances are generally good, a little slower for complex shaders (e.g. bump+specular+rim+outlines) but still much better than the previous free Toony Gooch pack!

    As for draw calls, 1 per mesh with regular shaders, and 2 per mesh with outline shaders; though that wouldn't say much: the outline pass is way faster than any of the lighting passes!

    Here's the relative speed list, taken from the pack's ReadMe:
    Though this list might change a little with the new rim lighting optimizations; I'll have to re-run the tests!
     
  6. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    Version 1.1 with faster rim lighting has been submitted!
     
    Last edited: Apr 19, 2013
  7. Zen-Davis

    Zen-Davis

    Joined:
    Aug 14, 2009
    Posts:
    285
    How much will this be after the sale?
     
  8. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    The sale has ended and the price is now 15$.
    It can change in the future as I update the package with more features, but it is not planned so far.
     
  9. nukeD

    nukeD

    Joined:
    Feb 12, 2009
    Posts:
    411
    I've bee using the free version for a while... once i saw this one i bought it with the speed of light, very good work!
    Respect!
     
  10. p6r

    p6r

    Joined:
    Nov 6, 2010
    Posts:
    1,158
    Great Toon shaders ! Thanks Jean.
    It's very good to be able to use a light for changing the shadow orientation !

    However I don't understand why you use this kind of textures for the Toon Ramp parameter !?!
    I'm using other textures and I have a better render for a 3 levels effect for example.

    6R
     
  11. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    Thanks for the kind comments guys!

    Not sure if you're asking how the ramp textures work or if you're just saying that the ones included aren't that great; but anyways I'd be glad to see what textures you came up with and see a screenshot of them applied on models to see that better rendering, if you're willing to share! :)

    I'm sure other users of the plugin would be thankful as well!
     
  12. p6r

    p6r

    Joined:
    Nov 6, 2010
    Posts:
    1,158
    I have forgotten to say it's great to be able to use the bump textures too !!!

    With my current work on Cartoon renders for my "2D Props Maker" I had to do my own textures to add to the Unity Toon shaders. I have tried to apply similar textures to your shaders and it was better for my needs.
    Here you can see the result on the coin from the "Items and Props pack" ! I use the same parameters (highlight color, shadow color...) but at the left side I have used MY texture for the toon ramp parameter and at the right side I have used YOUR 3 levels toon ramp texture :

    On the scene I have only 1 directional light (intensity = 1.3 !)
    $tooneffectrenders.jpg

    6R
     
  13. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    Indeed it looks better in this case!
    But 1.3 as intensity seems rather high to me, regular shaders tend to give some very bright results with intensities >= 1.0!

    Anyways that's what's nice about these shaders: you can easily define your own ramp textures to change the whole feel of the shading :)
     
  14. p6r

    p6r

    Joined:
    Nov 6, 2010
    Posts:
    1,158
    Yes, your shaders are great because they allow us to modify a lot of things !!!

    (Here it is 1.3 for light intensity because it's nice on gold coins. But it works with less intensity too !) ;-)

    6R
     
  15. OhiraKyou

    OhiraKyou

    Joined:
    Mar 27, 2012
    Posts:
    259
  16. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    Really great looking shaders, I'll check them out soon.
     
  17. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    Hmm, I'm sorry but this one is quite complex and beyond my skills, and it wouldn't be a matter of just copying/pasting some parts because Toony Gooch shaders are Surface ones, whereas this one is a vertex/fragment shader :neutral:
    However it seems that the lighting calculation is done with the following code in the shader you posted:
    Code (csharp):
    1. float3 N = IN.normal.xyz;
    2. N = mul(UNITY_MATRIX_IT_MV, float4(N, 1));
    3. float diffuse = saturate(dot(glstate.light[0].position, N));
    So changing that into a ramp-based lighting might be doable, though it would only work with one light and I'm not sure of the compatibility with the different rendering modes of Unity!
     
  18. OhiraKyou

    OhiraKyou

    Joined:
    Mar 27, 2012
    Posts:
    259
    Yeah, I figured it would be too complicated. Thanks for taking a look, though
     
  19. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    Hey there!

    Just wanted to show what I'm working on for a future update of Toony Gooch Pro+Mobile: the 'pro' version of the Rim Outlines feature from the free pack with controllable size/smoothness!

    Please note that the image is animated and hence in 256 colors!

    Is this something you'd be interested in? ;)
     
  20. OhiraKyou

    OhiraKyou

    Joined:
    Mar 27, 2012
    Posts:
    259
    Certainly would be useful.
     
  21. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    v1.3 with the customizable Rim Outlines has been released!
    Check the updated demo here ;)

     
  22. Peter Hou

    Peter Hou

    Joined:
    Oct 12, 2010
    Posts:
    66
    Hi,

    I'm having problems with the shaders that are zipped in this pack. When I unzip them, create a new material and select one of these shaders, multiple errors show up in the console and the material turns pink.
    Do I need to do anything else other than unzipping the shaders?
    I'm using Unity 4.1.3f3 and have tried both Mac and iOS platforms.

    $errors.jpg
     
  23. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    Hello,

    This means that the shader has failed to compile. Usually one error in the shader or compilation output a lot of other errors resulting from that first one, so it's not possible to determine the origin from your screenshot.

    One thing that comes in mind though is to make sure that you extract the shaders from the zip files into the same directory as the other shaders (they need to be in the same directory as "TGP_Include.cginc" and "TGP_Outline.shader" to compile properly).

    If this is not the problem, please send me a stripped-down scene with the problem so that I can take a look at it myself (create a new empty project and repeat the steps for the bugs to appear and send me an archive; make sure to not include the "Library" folder to save up on space): you can find my email in my signature!
     
  24. Peter Hou

    Peter Hou

    Joined:
    Oct 12, 2010
    Posts:
    66
    Oh! That was indeed what caused the issues. Thank you very much for the quick reply. And thanks for creating these fantastic shaders :)
     
  25. Peter Hou

    Peter Hou

    Joined:
    Oct 12, 2010
    Posts:
    66
    BTW, is it intentional that the z-corrected shaders don't appear to work with realtime shadows?
     
  26. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    Do you mean it doesn't receive or it doesn't cast them?
    Do they work with the other shaders?
    It is not intentional, though the shadow casting part may be corrected by adding the "addshadow" to the "#pragma surface..." line, for example
    #pragma surface surf ToonyGooch nolightmap nodirlightmap noforwardadd addshadow
    (I'm not sure though, the problem might come from somewhere else)
     
  27. Peter Hou

    Peter Hou

    Joined:
    Oct 12, 2010
    Posts:
    66
    Both, they neither cast nor receive shadows. All the other shaders work fine with the shadows, it's only an issue with z-corrected shaders as far as I can tell.

    Thanks, I'll take a look at that.
     
  28. Peter Hou

    Peter Hou

    Joined:
    Oct 12, 2010
    Posts:
    66
    It worked! Thanks again :)
     
  29. Uli_Okm

    Uli_Okm

    Joined:
    Jul 10, 2012
    Posts:
    95
    Hi Jean, I bought the shaders some time ago (they are wonderful by the way), and i saw in this post about the new Rim Outline shaders in the version 1.3. But i just downloaded the new version and i didn't find them, it's strange because the demo scene of the asset isn't the same of the online demo and the readme still tells it's V1.1.
    Do you know what happened?
     
  30. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    Indeed it shows v1.3 in the store yet the files are from v1.1. I'll re-send the package to the Asset Store team and let them know about the issue!
     
  31. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    The latest version (1.3) is now really available in the Asset Store! ;)
     
  32. Stephen Jobe

    Stephen Jobe

    Joined:
    Feb 11, 2013
    Posts:
    4
    Is there a way I can get a version of Outline Basic or Outline BasicRim with a main color control. I need direct control over that for our project.
     
  33. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    Sure; send me an email and I'll help you (you can find my email in my signature)
     
  34. mobidom

    mobidom

    Joined:
    Jun 19, 2013
    Posts:
    6
    Hello. I have problem with shaders.
    When i used Toony Gooch Pro/Normal/OneDirLight/Basic or standart diffuse shaders - i saw this pic:
    $Снимок.PNG
    For example - when i used standart decal shader - border of my model is good.
    What is my problem?
     
  35. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    I'm not sure of what you are trying to do here, is it a transparency problem?
    Could you also post a screenshot with the intended result to compare?
     
  36. mobidom

    mobidom

    Joined:
    Jun 19, 2013
    Posts:
    6
    Solved problem. Parametr of camera "clipping panels" was 0.01. I set 0.2
    Need picture like that (see on border):
    $Снимок2.PNG
     
  37. Deleted User

    Deleted User

    Guest

    Purchased !
    I have to study more your shaders because the light seems too strong.
    Anyway very good shaders.
     
  38. OhiraKyou

    OhiraKyou

    Joined:
    Mar 27, 2012
    Posts:
    259
    Any chance of a terrain version of your toony rim light shader? I understand that it may not be a simple task, but it would complete the package for me. I'd love to use these shaders in my recent project, but having a matching terrain would be necessary.
     
  39. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    Well I don't know much about Terrains, never used them.
    Do they need some special shader to work?
     
  40. OhiraKyou

    OhiraKyou

    Joined:
    Mar 27, 2012
    Posts:
    259
    They're relatively new, I believe. Check out the shaders under Nature > Terrain. There's even a toon shader. Standard shaders (such as your rim light) partially work, but terrain definitely seems to require something specific
     
  41. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    It seems to be a combination of various shaders so I'm not sure of which ones to change, actually.
    But for the surface-based ones, it might be doable by replacing the lighting model (see here: http://docs.unity3d.com/Documentation/Components/SL-SurfaceShaderLighting.html) and taking the one from Toony Colors!
    They have to be in the same folder as TGP_Include.cginc, and then you can replace
    Code (csharp):
    1. #pragma surface surf BlinnPhong vertex:vert decal:add
    with
    Code (csharp):
    1. #pragma surface surf ToonyColorsSpec vertex:vert decal:add
    for example (or just ToonyColors if you don't want specular).
    I'm not sure if the results will be conclusive, though.
     
  42. OhiraKyou

    OhiraKyou

    Joined:
    Mar 27, 2012
    Posts:
    259
    Thanks for the lead.

    I've attached a hacked-together basic rim terrain shader based on Unity's bumped specular shader and the TGP basic rim (requires TGP includes, of course). I needed to fondle up the main color and rim color quite a bit to get the desired effect without making flat areas blindingly bright or distant terrain (which reverts to the default shader) look too dark in comparison. Generally, it's a tradeoff between a strong rim light and dark distant terrain. You can replace the default terrain shader by using its path, but I haven't tried that with this shader yet (and, I don't know if that would actually fix the distant terrain problem). Also, smoother ramps tend to look better due to terrain LOD changes. For the most part, it works. However, I don't have enough hardware (e.g. a mobile device, older video cards, etc.) to test for compatibility.
     

    Attached Files:

  43. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    Well rim-based shaders generally look best with a round geometry and small triangles, as it depends on the triangles normal according to the camera direction; that's why it is tricky to set up on planar terrains.

    It's cool that you quickly got results though!
    Feel free to post screenshots when you manage to get good results :)
     
  44. ironbelly

    ironbelly

    Joined:
    Dec 26, 2011
    Posts:
    597
    We are using toony gooch extensively on one of our projects and we just did our first lightmap bake and was really disappointed to be told that these shaders don't work with lightmaps. Is this 100% true? is there any ways to get your shaders to work with lightmaps? Any updates in the works to allow for this?
     
  45. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    676
    @Jean Moreno: Is this true?
     
  46. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    Hello,

    Lightmapping is disabled by default in the shaders so that it can run faster (this is especially useful for mobile devices).
    You can enable it back by editing the shaders ("Edit..." button in the Material inspector next to the selected shader), and removing the "nolightmap" and "nodirlightmap" keywords.
    For example, the following line:
    #pragma surface surf ToonyColors nolightmap nodirlightmap noforwardadd
    becomes
    #pragma surface surf ToonyColors noforwardadd

    I'm sorry if this is added by default but it would have doubled the number of .shader files in the package (there are already a lot!)

    Let me know if it works that way!
     
  47. Lioncirth

    Lioncirth

    Joined:
    Apr 7, 2009
    Posts:
    111
    Hi

    We were discussing this issue via email but when I reply I kept getting a bounce back so not sure if you received my response.

    I reimported the package again via asset store - I cannot seem to find a file called "TGP_Include.cginc",?

    Thanks alot :)
     
  48. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    It should be in JMO Assets\Toony Colors Pro\Shaders\TGP_Include.cginc
    If you can't find it, try to re-import the package again (or maybe delete the local version, and re-download it to be sure?).
    Also to not have errors, best bet is to not move the shader files!
     
  49. Lioncirth

    Lioncirth

    Joined:
    Apr 7, 2009
    Posts:
    111
    Hey

    I re-imported twice, found the file in a folder called Shadertest - no idea why hehe

    All sorted and it looks amazing thanks!!!
     
  50. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    I guess the file was already misplaced in the project, and since it was the latest version it hasn't been reimported from the package.
    Glad that it's sorted out!