Search Unity

Toony Colors Pro+Mobile 2

Discussion in 'Assets and Asset Store' started by Jean-Moreno, Mar 7, 2015.

  1. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    After months of work, I am very happy to announce the release of:
    forum_tcp2.png
    stylized shaders suite
    A big improvement from Toony Colors Pro 1 where everything has been rewritten from scratch!
    Toony Colors Pro+Mobile 2 is a suite of shaders and tools that will bring you everything you need to get stylized rendering! (also known as non-photorealistic rendering)
    Very easy to use, yet very extensive, you'll get results in a few clicks!

    Compatible with Unity 4.5+ and Unity 5!
    Includes high-quality desktop and mobile optimized shaders!
    100% working in Unity Free!

    Get Toony Colors Pro 2 here on the Unity Asset Store
    Check out the webplayer demos to see a glimpse of what you can do with Toony Colors Pro 2!​

    Features
    ● Unified Material Inspector selecting the correct shader based on your settings!
    ● Smoothed Normal Tool that encodes smoothed normals in an innovative way to fix broken hard-edge outlines!
    ● Shader Generator Tool allowing you to create your own custom tailored shader choosing among dozens of features

    Shader Main Features
    - Ramp Shading (manual or texture based)
    - Bump/Normap maps
    - Specular (classic or cartoon)
    - Reflection
    - Reflection Probes (Unity 5 only)
    - Rim Lighting/Rim Outlines
    - Colorable Outlines
    - Blended Outlines

    Extended Features in the Shader Generator:
    - Textured threshold (hand-painted like shading)
    - Detail Texture
    - Anisotropic Specular
    - Rim Reflection (Fresnel-like)
    - MatCap
    - Directional Ambient
    - Sketch Overlay
    - Alpha Blending/Testing
    ...and MUCH more!

    Screens
    forum_beach.png
    Beach Diorama WebPlayer demo

    forum_animals.png
    Animals Diorama WebPlayer demo

    forum_inspector.png
    Unified Inspector and Shader Generator

    Questions, bugs, comments ?

    Feel free to answer to this thread or reach me by email ! :)

    Note: version 2 is a free update to all Toony Colors Pro+Mobile owners!
     
    Last edited: Jan 9, 2017
    blueivy likes this.
  2. toto2003

    toto2003

    Joined:
    Sep 22, 2010
    Posts:
    528
    wow reflection!!!!! awesome looking forward to this!!!
     
  3. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
  4. 99thmonkey

    99thmonkey

    Joined:
    Aug 10, 2012
    Posts:
    525
  5. Gekigengar

    Gekigengar

    Joined:
    Jan 20, 2013
    Posts:
    738
    I got errors in the demo when i uncheck the "Outline"
     
  6. ElectroMantis

    ElectroMantis

    Joined:
    Sep 15, 2013
    Posts:
    78
    Yes, I can finally use outline with hard edges!
    Updating now. Thanks, really made my day!


    Yes, on the web demo, if you uncheck all the features, then uncheck "Outline", then a whole bunch of errors pop up. o_O
     
  7. TimBorquez

    TimBorquez

    Joined:
    Mar 18, 2013
    Posts:
    81
    just tried out the update, very nice!
     
  8. BlankMauser

    BlankMauser

    Joined:
    Dec 10, 2013
    Posts:
    138
    Looks great! Maybe add emission shaders?
     
  9. jellybit

    jellybit

    Joined:
    Nov 21, 2009
    Posts:
    32
    I'm looking to buy this asset for the second effect in this image:



    I went to your example scenes on your website, and I couldn't find anyway to switch to that example. I also have no idea if it's a shader you have pre-made, or if not, what the process would be like to create it with your asset. Could I get some details on this? Is it an included shader or if not, what's involved in making it? Thanks!
     
  10. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    Hey, sorry for the late answer! For some reason even though I'm watching the thread I never got any alert or email about your posts on the thread! :confused:
    Anyway...
    You can generate your own TCP2 shaders with emission using the self-illumination feature of the Shader Generator!

    These examples were made using various features of the Shader Generator!
    The second example is using the textured threshold feature that uses a grayscale texture to add variance on the line separating shadows from highlight. You should find a couple example textures to use with this feature in the package.


    In any case do not hesitate to contact me directly by email if I haven't answered here fast enough! :)
     
    Last edited: May 4, 2015
  11. blamejane

    blamejane

    Joined:
    Jul 8, 2013
    Posts:
    233
    I'm interested in your toon shaders, however I need them for car models. Are these meant for characters only?
     
  12. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    They should work fine with non-characters meshes! :)
    Actually the Smoothed Normals Utility is mostly useful for non-character meshes to fix outlines combined with hard-edge shading.
    You have a lot of options available that could help with cars such as reflections or colored rim lighting (which can simulate the view-dependent color-shift seen on some car materials).
     
  13. BlankMauser

    BlankMauser

    Joined:
    Dec 10, 2013
    Posts:
    138
    Its been a while. Just wondering if there was a way to change the width of outlines in certain areas? Maybe based on vertex color?

    Also what about an unlit shader? Or shader that doesn't have shadows but can still use the half-tone gradients, normal maps etc.
     
    Last edited: Jan 20, 2016
  14. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    Changing width based on a vertex color is certainly possible, shoot me an email and I can get you in the right direction!

    As for an unlit version, I don't see how that would work. You could arguably make a fixed vector that would replace the light, but I don't see any benefit in doing so.
    The half-tone gradients need to know if there is light or not to calculate their rendering, and so do the normal maps.
    If you have a clear view of how it would work, please elaborate and I'll see what I can do :)
     
  15. Docm30

    Docm30

    Joined:
    Dec 15, 2013
    Posts:
    19
    Hey, I was just wondering if there is any way I can get point lights to cast shadows on materials with these shaders. Or is that not a possibility?
     
  16. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    You can use the Shader Generator for that: in the Flags section, you have the "Full Forward Shadows" option.
    Toggle it and it should enable point light shadows!
     
  17. Docm30

    Docm30

    Joined:
    Dec 15, 2013
    Posts:
    19
    I've tried that and unfortunately it doesn't seem to work.
     
  18. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    Try to also enable the "Add Shadow Passes" and see if it changes anything.

    If it still doesn't work, please send me an email with a sample scene that shows the problem so that I can take a deeper look at it (also let me know which version of Unity you are using!).
     
  19. Docm30

    Docm30

    Joined:
    Dec 15, 2013
    Posts:
    19
    OK, so I got it to work. It turns out I have to generate the shader with just those two shadow options selected and nothing else changed from default. If I change any other option when creating the shader I get no shadows. Once it's created I can go back and change whatever I want and the shadows will still work. Sounds like maybe a bug with your shader generator, but I don't know enough about shaders to make that call. This is Unity 5.3.4f1, by the way.

    Thanks. For both the shaders and the help.
     
  20. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    I did some tests and couldn't reproduce the issue, point light shadows were always working correctly when selecting the "Full Forward Shadows" option.
    Hopefully that's an isolated case!

    Anyway I'm glad that it's now working for you.
     
  21. geekchau

    geekchau

    Joined:
    Jun 13, 2013
    Posts:
    16
    Hello there! I've just had a play with TCP2 (and having fun messing about) but came across a problem with the hard-edge outline problem. I've followed the instructions regarding the Smoothed Normals Utility but it has not solved the problem. This was tested in a fresh scene/project with a single Unity-generated cube, using TCP2/Mobile shader, and on the Unity build 5.3.6f1 (latest public release).
     
  22. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    Have you properly configured the material so that it knows where to pick the smoothed normals from?
    In the Outline section, you have to choose an option between Vertex Colors, Tangents, UV2 depending on the settings used with the Smoothed Normals Utility.
    TCP2_OutlineNormals.png
    Also have you made sure that your MeshRenderer is using the generated "smoothed" mesh?
    The mesh will be a new one based on the source (the original mesh file won't be overwritten), and it will be placed in the JMO Assets/Toony Colors Pro/Smoothed Meshes folder by default.
     
  23. geekchau

    geekchau

    Joined:
    Jun 13, 2013
    Posts:
    16
    Thanks for the speedy reply. I've checked everything several times over and I am certain I've followed the procedure correctly. In the following example, I smoothed to Vertex Colors and under 'Outline Normals', matched it by selecting Vertex Colors, and confirmed that it is using the newly created smoothed mesh. Please see screenshot:

    Screen Shot 2016-07-26 at 16.31.35.png
     
  24. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    Well I just installed Unity 5.3.6 and made a test, and everything seems to work fine:
    TCP2_SmoothedNormalsCube.gif

    Can you send me the project in an archive via email?
    This way I'll be able to take a deeper look at your settings.
     
  25. geekchau

    geekchau

    Joined:
    Jun 13, 2013
    Posts:
    16
    Hello again! I revisited the test project and upon changing the shader from Mobile to Desktop, I noticed that the inspector went funny (see picture) and also threw a red error, thus I started another fresh project and managed to get it working.

    Screen Shot 2016-07-26 at 19.01.33 copy.png

    Again, I managed to get it working after starting a fresh project, but I also wanted to know what might have caused it, and it appears to be because I moved the whole 'JMO Assets' into another folder. This can easily be recreated by:
    1) Starting a fresh project
    2) Importing TCP2
    3) Create a new folder (I named my 'External') and move JMO Assets into this folder.
    4) Create a Material and set it to a TCP2 shader (I used Mobile), apply to object (Cube).
    5) Observe that the outline does not work even after using the smoothing utility, and changing the shader to Desktop makes the material inspector go funny.

    Anyway, I just wanted to mention it and don't actually think you should waste your time pursing the matter further. Thank you for the help!
     
  26. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    I did reproduce the issue, and found a way to fix it. It looks like when you moved the "JMO Assets" folder, the already-imported shaders were keeping the paths references from before the whole folder has been moved, and hence they can't find the included cginc files. If you manually reimport the shader files (by right-clicking it and clicking "Reimport"), then it should compile properly (as include paths are relative in the shader source).
    TCP2_Import.png
    I'm not entirely sure why it behaves like that, it does look like a Unity bug.
    To fasten the process you can right-click on the "Shaders 2.0" directory and reimport the whole folder (but it will take some time as all shaders will have to be reimported).

    The funky UI is actually what the material would look like without TCP2's custom inspector. When a shader doesn't compile properly, then the custom inspector directive is ignored and you see the default UI.
     
    geekchau likes this.
  27. pixpusher2

    pixpusher2

    Joined:
    Oct 30, 2013
    Posts:
    121
    Hi there,

    I'm using the Smoothed Normals Utility (storing in Tangents) on a skinned mesh that has the "Optimize Game Objects" enabled. The resulting mesh gives off the following error when assigned:

    "Bone do not match bindpost"

    Is there a way to fix this? It works fine with the optimization disabled however, but I'd like to have it on if possible. Thanks! :)

    optimized.png
     
  28. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    I've never used that option, but from what I can read in the manual, it looks like it will optimize the rig so that empty GameObjects in the rig hierarchy won't be processed by the CPU anymore.
    My guess is that it then knows to which bones these removed GameObjects corresponded against the original model file, but when you bring a new raw mesh asset (such as a smoothed one), Unity treats it as an entirely new mesh that expects a certain number of bones in the rig hierarchy. But it can't find the ones for the deleted GameObjects, hence the error!

    So the only solution I can see is to manually smooth the normals into the tangents through an external 3d modeling software, so that the smoothed model can be imported back in Unity as a whole model file (instead of just the mesh data).
    The process for each vertex is to take all the normals at that vertex (you should have multiple normals where there are hard edges), calculate the average vector from them, and assign that to the vertex's tangent.

    You can also try this alternative: export the smoothed mesh from Unity (with an OBJ exporter for example), and import it back directly in Unity. Then Unity should treat the asset as a new model where you can enable the optimization. But that would only work if there's no data loss (rigging, materials, etc.) between the source model and the new one, which I'm unsure of.
     
  29. pixpusher2

    pixpusher2

    Joined:
    Oct 30, 2013
    Posts:
    121
    Thanks for the info. I'll see if I can smooth the normals inside Blender instead. Cheers
     
  30. gonzorob

    gonzorob

    Joined:
    Dec 1, 2011
    Posts:
    96
    Just tried to use the shaders in Unity 5.5 - throwing up the following :
    Code (csharp):
    1. Shader error in 'Hidden/Toony Colors Pro 2/Standard PBS Outline Blended': 'MainLight': no matching 1 parameter function at Assets/JMO Assets/Toony Colors Pro/Shaders PBS/TCP2_PBS_Core.cginc(19) (on glcore)
    2.  
    3. Shader error in 'Hidden/Toony Colors Pro 2/Standard PBS Outline': 'MainLight': no matching 1 parameter function at Assets/JMO Assets/Toony Colors Pro/Shaders PBS/TCP2_PBS_Core.cginc(19) (on glcore)
    4.  
    5. Shader error in 'Toony Colors Pro 2/Standard PBS': 'MainLight': no matching 1 parameter function at Assets/JMO Assets/Toony Colors Pro/Shaders PBS/TCP2_PBS_Core.cginc(19) (on glcore)
    Any suggestions?
     
  31. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    I am aware of the issue and had a fix for the beta, so I just have to port that over to the 5.5 release.
    But I was on vacation these last days, so that's why it's delayed a little - sorry for that!

    The fix should hopefully be up on the Asset Store this weekend, if not next week at the latest.
     
  32. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    Toony Colors Pro 2 should now work with Unity 5.5 as of version 2.2.51!
     
  33. gonzorob

    gonzorob

    Joined:
    Dec 1, 2011
    Posts:
    96
    Thanks for the update ! Works perfectly
     
  34. snackzilla

    snackzilla

    Joined:
    Aug 17, 2014
    Posts:
    91
    I absolutely love this package! It makes my characters and scenery pop like never before. Is this the right place to request a feature? I'm in need of a Double-Sided Toon Shader. I did some reading, and I couldn't find out if this package actually supports it or not. Maybe I'm just dumb, but I would love an option for two sided stuff.
     
  35. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    You can use the Shader Generator for that: at the Culling option, choose Off (double-sided).
    Note that this will only disable backface culling, and as such lighting will be incorrect for the back faces (as it will use the front face's normal).
     
    snackzilla likes this.
  36. snackzilla

    snackzilla

    Joined:
    Aug 17, 2014
    Posts:
    91
    I had no idea that option was there. I guess that's what I get for not fully going through the documentation! Thank you so much for the quick reply!
     
  37. Stevepunk

    Stevepunk

    Joined:
    Oct 20, 2013
    Posts:
    205
    Hi, I've been using the shader generator to create shaders with a diffuse map and a normal map and they look great!

    I was wondering if it was possible to add a 3rd map that I can use as a mask?
    The generator seems to allow it but I can't seem to get a masking effect.

    Here is my tilemap with diffuse and normals:


    Here is the mask version of my tilemap:


    This is the desired result:


    At the moment I'm placing the mask prefabs manually by hand but it seems a bit silly when the normal maps can be placed automatically.
    The black masked area is unlit and shouldn't receive light from any sources and should always be pure black (or whichever colour it's set to).

    Is this currently possible with the shader generator or do I need to modify the code to achieve this?

    Thanks for your time!
     
  38. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    You can use the Color Mask feature but it won't replace everything else in the shader, only the Diffuse color, so if it's not set to pure black, then it will still be affected by lighting.
    If you want it to mask out the whole shading, then you'll have to modify the code for this.
    My suggestion is to make a custom template that implements this. Please send me an email if you need help to do that!
     
  39. Stevepunk

    Stevepunk

    Joined:
    Oct 20, 2013
    Posts:
    205
    Ok so if it's set to black then it won't be affected by lighting at all?
    This seems like the simplest solution so I will try this..
     
  40. Flyer_sea

    Flyer_sea

    Joined:
    Feb 20, 2017
    Posts:
    4
    Hi, Jean, your unpack shaders function still broken, I am still getting these errors in Unity 5.5.2f1 and Toony Color Pro 2 v.2.3.2, all the unpack files are half and half, must got cut in wrong length. Thanks
     
  41. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    That was my fault, the packed shaders file was corrupted and so unpacked shaders were indeed wrong.
    This is now fixed in the latest version!
     
  42. Flyer_sea

    Flyer_sea

    Joined:
    Feb 20, 2017
    Posts:
    4
    Thanks for the quick update. : )
     
  43. OhiraKyou

    OhiraKyou

    Joined:
    Mar 27, 2012
    Posts:
    259
    Is there a known way to make realtime point lights cast hard light with a ramp? I've tried using the standard version and generated versions, and they all lead to point lights having smooth falloffs with visible banding beyond a point.

    Here's an example:http://i.imgur.com/0jf6eyY.png
    And, here's the ramp it uses: http://i.imgur.com/FRIJUUq.png
     
  44. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    This is due to Unity's own point light falloff, which is provided in the shader as part of the attenuation (which also includes realtime shadows).

    I'll do some research into this, it can definitely be interesting to remove any smooth falloff for a stylized game.

    I see two ways to do that: either discard Unity's point light falloff and do my own calculation, but in this case I'm not sure if I can still get shadows, or replace the built-in falloff texture for point lights, but then all points lights would use the same falloff (and I'm not even sure that we can easily replace that internal texture).
    All this is speculation though, I haven't started to look into it yet :)

    EDIT:
    @OhiraKyou I took a very quick look at it, and the easiest way to achieve it would be to edit your shader so that attenuation is discarded for point lights. Basically just comment these lines in the lighting function:
    Code (csharp):
    1. #if (POINT || SPOT)
    2.     c.rgb *= atten;
    3. #endif
    Then it's up to you to set the correct ramp texture that will work with point lights.
    Downsides: you need your shadow color to be full black, else you'll see some brightening in the effected area of the light, and you'll see that the ramps needs to have a very big black area to not show any view-dependent clipping (from my tests, it seems you need a black stop at 60% in your gradient to make sure to not have any clipping)

    (here the brightening is actually red-ish because I was using some debug things)
     
    Last edited: Apr 5, 2017
  45. OhiraKyou

    OhiraKyou

    Joined:
    Mar 27, 2012
    Posts:
    259
    Woops, missed the edit due to reading the original comment first.

    Those are some pretty significant caveats. Won't be doing that, then. Thanks for looking into it anyway.
     
  46. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    I've looked into it more, and proper support to bypass Unity's built-in falloff textures for both point and spot lights will come in the next update. Also the ability to define a different ramp per light type (hence allowing a custom ramp just for point lights).
     
    chiapet1021 likes this.
  47. OhiraKyou

    OhiraKyou

    Joined:
    Mar 27, 2012
    Posts:
    259
    Awesome, thanks!
     
  48. Guideborn

    Guideborn

    Joined:
    Jun 15, 2013
    Posts:
    231
    Hey, Jean! I have a strange inquiry again. I was wondering if there was a way to have a mask feature for screen-space textures? There is a part of a texture that I'd like to have a screenspace effect without having to affect the entire texture. I've been using Toony for awhile now and I don't even know if it has any kind of screenspace texture capabilities when I think about it.
     
  49. MartinTremblayPLA

    MartinTremblayPLA

    Joined:
    Apr 18, 2017
    Posts:
    1
    I have a strange problem. When I import the file I get the 2.2 version instead of the 2.3. Not sure how to fix this.
     
  50. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    592
    Not currently but I'll look into adding this for the next update. Some of the features do use screen-space UVs so the code is there already for these (e.g. Sketch effect).

    The current latest version is 2.3.22, and it has been released for Unity 5.4+.
    If you are using Unity 5.3 or lower, you'll get the 2.2.6 (and an even older version if still in Unity 4).
    If you are indeed using Unity 5.4 or newer, then it could be an issue with the Asset Store itself... let me know if that's the case, which Unity version you are using and I'll try on my end.
     
    Guideborn likes this.