Search Unity

Toony Colors Pro+Mobile 2

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

  1. amynox

    amynox

    Joined:
    Oct 23, 2016
    Posts:
    157
    Any help about this ?

    Here is what i'm using right now => https://assetstore.unity.com/packages/vfx/shaders/uber-standard-shader-ultra-39959

    Ideally i want to acheive something like this with your shader => https://assetstorev1-prd-cdn.unity3...hot/b26690c2-faf3-4db5-86fc-aa66115ad7a0.webp


    Thank you
     
  2. _legolas_

    _legolas_

    Joined:
    Nov 10, 2014
    Posts:
    12
    Hello, How to use toony with light weight render pipeline! Thanks
     
  3. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    504
    You can enable that option in the Shader Generator, then you'll have a float parameter in the material for the amount of displacement.
    It will displace vertices based on the world space vertex normal by default, but you can change that to vertex colors, tangents or UV2 if you want to manually control it.
    upload_2020-4-14_15-53-37.png


    You won't get such a realistic result with TCP2; it will just change the albedo color, and optionally the shadow color and add rim lighting just for the snowy parts.

    When I'll port the Snow Accumulation to the Shader Generator 2, it will be more flexible due to the inherent flexibility of the SG2, but I don't have any ETA on this.

    Currently you need to use the Shader Generator 2 to generate your own shaders, using the LWRP or URP template.
    You can also extract the "Cat Demo LWRP" or "Cat Demo URP" packages and use the demo shaders from there.
     
  4. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    429
    Is it possible to disable lighting entirely? If so, is it possible to handle lighting via matcap?
    I don't need the toon shading.

    I've been trying use the Shader Generator but I can't seem to nail down an unlit example.
     
  5. maarcinn

    maarcinn

    Joined:
    Aug 13, 2013
    Posts:
    11
    Hey!
    I have a problem with setting up quite simple shader with both Outline and Silhouette. I use URP 7.2.1 with Unity 2019.3.5. I set up Renderer Features as stated in documentation. But when I add both Outline and Silhouette to my shader, I models get pink (but Outline still works correctly around pink models). If I use just Outline or just Silhouette in my shader, everything works fine.
    I also get this error in the console:
    upload_2020-4-29_16-42-43.png

    I would appreciate any help here :)
    Thanks!
     
  6. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    504
    There aren't any unlit template available; what you can do though is to set the shadow color to the same color as highlight color; this will effectively disable the direct lighting (although the calculations will still be made though).
    To go a bit further, you can use the Shader Generator 2, and in the Shader Properties tab, set both "Highlight Color" and "Shadow Color" properties to be Constants with a white color. By doing so, the shader should be able to provide some optimizations when compiling.

    Can you send me an email or DM with the faulty shader attached please? I'll have to investigate that further!
     
  7. maarcinn

    maarcinn

    Joined:
    Aug 13, 2013
    Posts:
    11
    Thanks for your reply! I sent you a DM with my shader :)
     
  8. TPEUnity

    TPEUnity

    Joined:
    Jan 17, 2018
    Posts:
    31
    Im having issue when turning shadow cascades on im getting crazy shadow artifacts. Without them turned on its working just fine but unity does not seem to render shadow on terrain without shadow cascades on (another bug with urp ???).
    Im using shader generated with SG2 (latest version) on URP version 7.3.1. Unity v. 2019.3.7f1. There seems to be earlier some fix for this but perhaps another bug has been introduced?

    Models without crazy shadows are using URP standard lit shader for comparison.
     

    Attached Files:

    Last edited: May 7, 2020
  9. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    504
    Hi, just tested with URP 7.3.1 and Unity 2019.3.6 with a generated shader without any options, and cascades show fine on my end.
    Could you send me the faulty shader by email or DM please, so that I can test it directly?
    Does it happen on all objects with that shader or only certain meshes?
     
  10. TPEUnity

    TPEUnity

    Joined:
    Jan 17, 2018
    Posts:
    31
    I made DM with shader attached to it.
     
  11. TPEUnity

    TPEUnity

    Joined:
    Jan 17, 2018
    Posts:
    31
    Issue was solved by doing fresh project with URP 7.3.1 and reimporting TCP2 (latest version) and then reimporting the project.
     
  12. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,721
    Using with URP 8.20 - everything is magenta. Of course, URP is installed, and I extracted the URP sample and ran it.
    Attempting to recompile any of the shaders gives the following errors:

    Shader error in 'Toony Colors Pro 2/Examples LWRP/Cat Demo/Vertex Colors': failed to open source file: 'Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl' at line 38.
     
  13. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,155

    It happens also everytime I update the Unity version in my project.
     
  14. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    504
    It looks like you extracted the LWRP demo scene, not URP, hence why it'd fail. Unless I included a LWRP shader in the URP demo...
    Please note that currently URP in TCP2 is supported at v7.3.1 for Unity 2019.4; I will look into Unity 2020.1/URP 8.2 as soon as I can.

    Have you tried generating a URP shader using the Shader Generator 2 though? If URP hasn't changed much, they should still work with 8.2.
    You can also try the Hybrid Shader and its demo scene.
    I can't test right now as I'm not home though.

    Please try to recompile the shaders with a Right-click > Reimport on the relevant folder in the Project view.
    Let me know if you see any compilation errors, and which version you updated to.
     
  15. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,721
    I chose the "Cat LWRP" demo because the regular Cat demo didn't work. I don't see a URP demo in the package.
    However, the Hybrid project works all except for the first shader (which is the standard shader, so it's to be expected)

    I'll hold off until you get 2020 support officially in the release, thanks
     
  16. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,155

    Updated my project to 2019.4 LTS and same pink problem again. My project is quite complex and this asset
    is the only one which gives these problems. I think this issue should have been fixed by the developer after so much time...
     
  17. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    504
    I haven't been able to reproduce that issue so far but I'll try again tomorrow.
    What was the Unity version before you upgraded to 2019.4?
    Does re-importing the shaders solve the issue?
     
  18. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,155
    I upgraded from 2018.4 LTS.
    I had to reimport but I repeat they are the only shaders giving this problem every time I update Unity.
     
  19. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    504
    I've tried to upgrade a 2018.4 project to 2019.4, and all shaders were working normally on my end, including a custom generated one from the Shader Generator 2.
    I know I've had issues over the years with some shaders showing magenta and requiring being recompiled even though nothing changed in them (and without necessarily upgrading projects), which makes me think that this is firstly a Unity issue. Now why would Toony Colors Pro 2 shaders be more subject to this bug, I don't know, there's nothing special in them technically as far as I can tell.
     
  20. pstudio

    pstudio

    Joined:
    Apr 20, 2014
    Posts:
    10
    Hi Jean.

    I recently bought your asset and I was particularly interested in the experimental support for Aura 2.

    I have tried creating a simple test scene using a generated toon shader with Aura 2 support enabled. However I have encountered a few issues that I hope you can help me with. The scene only consists of a few models using the generated shader, and a directional and a single point light with corresponding Aura components on it.

    This image shows the issues I have:

    Toony Aura On.png

    The point light creates a light square on the models it intersects with. This is the biggest issue. If I disable the point light the square disappears.

    The other issue is some small artsfacts that happens at the edges of the models. It is particularly visible on the trees. Some testing indicates that it is only visible when the camera clears to a skybox. If I set the clear flag to solid color the artifacts vanish.

    If I turn off the Aura component on the camera the shader appears to work just fine:

    Toony Aura Off.png

    I would appreciate any help to resolve these issues. In particular the point light issue is a deal killer.
     
  21. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    504
    Have you tried without enabling "Aura 2" support through the Shader Generator?
    I believe Aura 2 moslty works as a post effect, so custom shader support isn't actually needed (all the examples from Aura 2 are using the default Unity material), unless in some specific cases like when semi-transparency is involved (although I couldn't verify that). I think this would solve the point light issue.

    As for the edges, it looks like anti-aliasing is involved in this artifact, possible MSAA?
    Try to disable AA and see what happens - if that's the culprit then I guess you need to use a post process AA like FXAA.
    In any case I don't think this is speficic to Toony Colors Pro 2, but please let me know if you think it is!
     
  22. pstudio

    pstudio

    Joined:
    Apr 20, 2014
    Posts:
    10
    It does indeed seem that Aura works just fine without enabling the support for it in the Shader Generator. Simply disabling the Aura support did remove the artifacts.

    Thank you.
     
  23. geyluigi223

    geyluigi223

    Joined:
    Dec 14, 2020
    Posts:
    9
    Hi Jean,

    I have some problems dissolving this material together with the outline:

    bbn.PNG

    Can you help me please, i needed the outline and the material to dissolve together, is there something wrong?

    I saw some games with that effect.
     
  24. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    504
    The dissolve effect doesn't work with the outline technique used in TCP2 ("inverted hull"), as it is based on volumetric geometry and breaks when using alpha testing like in the dissolve effect.
    If you have some reference of games achieving this please send them to me, but I'm betting that those use a post process shader-based outline instead, which works in 2D and thus with dissolve/alpha testing.
    I think you can find many implementations of such post effects on GitHub! (including the port I made of Unity's old edge detect effects to post processing stack v2, but I haven't updated it in a while...)
     
  25. geyluigi223

    geyluigi223

    Joined:
    Dec 14, 2020
    Posts:
    9
    well....i saw some games use that effect like this game over here.
    it just goes something like this:
    jujiouju.PNG
    the reference of this is from some game called ROCKMAN X DiVE.
     
    cambridgeintl5961 likes this.
  26. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    504
    I couldn't find a video of that particular effect, however looking at other videos of the game and seeing the artefacts that can appear on the outline, I'm pretty sure that it uses a post shader based effect for them - hence why it'd work with dissolve effects!
     
  27. geyluigi223

    geyluigi223

    Joined:
    Dec 14, 2020
    Posts:
    9
    here it is


    just skip to 27:59 and put the playback speed to 0.25
     
  28. Marat_Gilyazov

    Marat_Gilyazov

    Joined:
    Feb 23, 2016
    Posts:
    5
    Hi, I'm using Unity 2019.4.14, standard render pipeline (not URP), updated TCP to the latest version today and now I'm getting this error:
    Code (CSharp):
    1. Assets/JMO Assets/Toony Colors Pro/Scripts/TCP2_PlanarReflection.cs(263,5): error CS1501: No overload for method 'RenderPlanarReflection' takes 2 arguments
    It seems there is some mess around conditional compilations flags related to Unity version and URP usage in TCP2_PlanarReflection.cs:

     
  29. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    504
    Thanks for the report; that's my bad, that compilation error happens when URP isn't installed.
    I'm in the process of submitting an update to the Asset Store to fix it (v2.6.2) right now.
    Unless you've fixed it locally already, please send me an email if you want the fix quicker!
     
    hopeful and Marat_Gilyazov like this.
  30. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    504
    Even frame by frame the effect is so quick that it's hard to see, but I didn't see any outline on the dissolved parts...
    The entire effect spans across ~5 frames at 60 fps so that's about 0.08 seconds, so for something that fast I would suggest swapping a shader with a non-outline version, and just do the dissolve animation then. You can also decrease the outline width progressively towards 0 for a few frames before the effect starts to avoid things popping out.
    At this speed I don't think the absence of the outline during the effect would be noticeable.
     
  31. geyluigi223

    geyluigi223

    Joined:
    Dec 14, 2020
    Posts:
    9
    Infact, i have their generated shader which they complied for that effect but when i loaded it in unity, it didnt work

    Here's one of them:
     

    Attached Files:

  32. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    504
    This appears to be the compiled shader for the OpenGL ES platform only; and as stated at the beginning of the file: "NOTE: This is *not* a valid shader file".

    From the properties though, it looks like they added some parameters for the dissolve part and it is indeed used for the outline pass it seems; so maybe they altered the dissolution code to make it work with their effect on the outline.
    Please send me your shader by DM or email and I'll look into adding the dissolution in the outline pass, but as I stated, while it's technically possible, chances are that it won't look as expected.
     
  33. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    504
    I've downloaded it but please delete your post, because you are providing copyrighted material for free in a public forum.
    This is why I specifically wrote by DM or email.
     
  34. lk1

    lk1

    Joined:
    Feb 28, 2015
    Posts:
    2
  35. geyluigi223

    geyluigi223

    Joined:
    Dec 14, 2020
    Posts:
    9
    is my shader done yet?
     
  36. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    504
    Sent by DM just now - I was off last week.
     
  37. geyluigi223

    geyluigi223

    Joined:
    Dec 14, 2020
    Posts:
    9
    Can you please add some dissolution code in my second shader because i don't know how to add the way you did in my recent one .

    I've sent it through email.
     
    Last edited: Jan 4, 2021
  38. j0hnbane

    j0hnbane

    Joined:
    Jul 2, 2014
    Posts:
    20
    Have you got a any custom vegetation shaders using the Hybrid base available for download? I'm knee deep into working on my current project and just haven't had time to dabble with SG2. If so, I can send you my order# for a link if needed.
     
  39. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    504
    Unfortunately no; my plan is to eventually include a good library of shaders generated with SG2 as examples and ready-to-be-used shaders, but I haven't got to do that yet as I've been quite busy improving the tool itself and the templates.

    The easiest way for a vegetation shader would be to enable "Alpha Testing" for the transparency, and possibly the "Wind Animation" feature.
    For the latter, you'll need to know how to modulate which vertices should be affected by the wind though (it uses the vertex colors R G by default, but can be changed to anything else, e.g. a texture map).
    "Subsurface Scattering" can help too, although this one is more suited for volumetric objects... I ought to add planar backlighting support at some point for a better approximation of vegetation subsurface.
    Feel free to send me an email if you need help in all that or want me to send a quick example based on your needs.
     
  40. j0hnbane

    j0hnbane

    Joined:
    Jul 2, 2014
    Posts:
    20
    That would be amazing, thank you. I'll send something here shortly.
     
  41. Ceraph

    Ceraph

    Joined:
    May 16, 2013
    Posts:
    16
    Hello,

    First off, I just want to say that this asset is incredible! I'm working on using Shader Generator 2 to create a hair shader for my character. I've selected the Hair Anisotropic option and while I see the specular highlights on the hair mesh, I don't see the jagged / wavy lines in it like in the documentation example. I've included a screenshot of my mesh along with the settings in the shader and Shader Generator. This screenshot is from Unity 2020.1.2f1 but I've also tried importing it into 2019.4 and I get the same result. I've tried all of the different tangent options in the fbx importer options for my mesh as well.

    Any help you can provide would be greatly appreciated!

    anistropicHair.png
     
  42. geyluigi223

    geyluigi223

    Joined:
    Dec 14, 2020
    Posts:
    9
    Hey, is there any way to animate TCP material using material property block or by using a script, because i don't know how to animate my material with my custom TCP shader.
     
  43. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    504
    The wavy lines are created using a texture that will perturb the original tangent information: as you can see in the material, there's a slot for a "Tangent Shift Texture". It will use the red channel only (so you can use a single channel grayscale texture to use less memory), and will act like this: a mid-gray value (0.5) won't do anything, white (1) will add to the tangent and black (0) will remove from it. So depending on the contrast of your texture the effect will be more or less strong.
    Here is a quick texture I made using Photoshop that should make a good starting point.
     

    Attached Files:

    Ceraph likes this.
  44. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    504
    It works the same way you'd animate any other shader/material in Unity.
    Please stop asking for support until you have a legitimate license of Toony Colors Pro 2.
     
  45. Ceraph

    Ceraph

    Joined:
    May 16, 2013
    Posts:
    16
    Thank you for the quick reply! That makes a lot of sense and that texture you provided is a great starting point.

    Thank you again for making such a high quality asset and for providing amazing support!
     
  46. twglhk

    twglhk

    Joined:
    Apr 23, 2019
    Posts:
    5
    Hi. Jean,

    I'm using Toony Colors Pro 2 now.
    The shader worked well on the Built-in Render, but it all came out purple when I tried to use it on the URP.
    And I don't see Hybrid Render in the selecting shader option.
    How do I solve this?

    I'm using Unity version 2019.4.16f1, and URP version is 7.3.1
    please reply
     
    Last edited: Feb 2, 2021
  47. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    504
    The Hybrid Shader is the only one that automatically works across pipelines, i.e. you don't have to do anything to make materials work when changing pipeline.
    That shader should be in "Toony Colors Pro 2/Hybrid Shader" in the material shader menu.
    If it doesn't show, make sure that there aren't any compilation errors - you can try to right click on the shaders folder and click "Reimport" as sometimes Unity fails to re-compile shaders when it's needed.

    The other alternative for URP is using the Shader Generator 2, with the URP template (which will be automatically selected if that's the current pipeline), and make your own shaders with it.
     
  48. twglhk

    twglhk

    Joined:
    Apr 23, 2019
    Posts:
    5

    Thanks Jean. I'll try it!
     
  49. sef-sama

    sef-sama

    Joined:
    Oct 31, 2016
    Posts:
    1
    Hi! We've encountered an odd trouble with TCP and recent Unity versions (2020.2+)
    We were able to solve it, but I'm sharing this with devs and those who might have encountered it.
    How to reproduce:
    1. Add TCP2 to the project with a demo for URP
    2. Push changes to the repo (we're using Git and GitLab repos)
    3. Open this project on another PC (both PCs have TCP2 purchased) in Unity 2020.2+
    4. Now the project is crushing on load! Removing library or cash or clean pulling the project not helping as well.
    By experiments we were able to solve this by doing the following:
    - Deleting TCP2_Demo3DText.shader from the folder SG Demo Assets
    - Sometimes it doesn't work, then deleting SG Demo Asset folder helps. So there must be something in those.
    Thank you! Hope it will be fixed to save us some time :)
     
  50. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    504
    Thanks for this report, I'll have a look at this specific shader see if anything could crash Unity.
    Can you confirm that this only happens on other PCs pulling the repo? i.e. the original project that pushed the changes never crashes?
     
unityunity