Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Toony Colors Pro+Mobile 2

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

  1. e6586808

    e6586808

    Joined:
    Jun 3, 2015
    Posts:
    4
    Hello,can you help me fix these error?
    upload_2021-2-19_23-14-49.png
     
  2. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    583
    Can you verify that you have the file "TCP2_ExpressionParser.cs" in "JMO Assets\Toony Colors Pro\Editor\Utils"?
    If not, try to reimport the package from the Asset Store.
    If you do, please send me an email so that we can investigate why it doesn't want to compile properly.
     
  3. TPEUnity

    TPEUnity

    Joined:
    Jan 17, 2018
    Posts:
    36
    I can also add to this using 2019.4.21f1 LTS using URP 7.3.1 (and some other patch before as i updated to see if thats the case.). Unity randomly started crashing on start up. This started happening after adding latest TCP 2 to the project. I deleted TCP2 files from the Assets folder and it started to boot normally. I cannot confirm 100% this is problem with TCP2 since i've used it in previous projects without any issue but there is something fishy going on...
     
  4. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    583
    Unfortunately I haven't been able to reproduce nor pinpoint a potentially problematic file...
    Do you know if Unity is crashing while importing assets? If so maybe we could know which file crashes in the log somewhere.
    Also have you tried deleting the Library folder and reimporting everything from scratch? (could take a while depending on the project size)
     
  5. TPEUnity

    TPEUnity

    Joined:
    Jan 17, 2018
    Posts:
    36
    I think i was able to reproduce the crash i will DM u more information.
     
    Jean-Moreno likes this.
  6. TPEUnity

    TPEUnity

    Joined:
    Jan 17, 2018
    Posts:
    36
    For anyone else experiencing this. This was the solution (unity bug).

    https://issuetracker.unity3d.com/is...s-are-being-upgraded-during-importing-process
     
  7. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,818
    Hey,

    Anyone made a Zelda Breath Of The Wild type shader with this? If not what should I do to get this look @Jean-Moreno?

    Thanks,
    jrDev
     
  8. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    583
    Here's a quick example using the Hybrid Shader:
    upload_2021-3-31_11-2-32.png
    I've highlighted the settings that I think are the most important:
    - Shading ramp set to "Crisp" for a clear line separating lit and unlit parts
    - Specular set to "Crisp" as well. For this one, you might also want to add a Specular Map with a stroke-like texture: it looks like they used that in the game for an extra hand-drawn-like stylization touch.
    - Close values between the min/max rim lighting parameters, so that the line will also appear crisp. In the game I 'm pretty sure they used a post-processing effect to achieve this, so that's why its width looks consistent in the game. With the rim lighting technique, that will generally depend a bit on the mesh used, so ymmv.
    - "Light-based mask" so that the rim effect only shows in lit parts.

    That combined with the same kind of simple textures with flat colors should give you a good start.
    Note that the environment is less stylized in the game, probably using normal maps and a less pronounced shading ramp.
     
    crafTDev likes this.
  9. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,818
    Hello,

    Great, appreciated!

    I am currently building to WebGL and I am getting an error:
    Code (CSharp):
    1. Shader error in 'Toony Colors Pro 2/Hybrid Shader Outline': Duplicated input semantics can't change type, size, or layout ('TEXCOORD0'). at line 805 (on gles)
    How should I fix?

    Thanks,
    jrDev
     
  10. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    583
    My bad, it will be fixed in the next update.
    You can fix it manually in the mean time: open the file "TCP2 Hybrid Shader Outline.shader" and go to line 804, you'll find this line:
    Code (csharp):
    1. float2 uv : TEXCOORD0;
    replace it with:
    Code (csharp):
    1. float2 uv : TEXCOORD1;
    and it should work.

    Do the same for the non-outline version of the shader if you're using it as well.
     
    crafTDev likes this.
  11. Jihaysse

    Jihaysse

    Joined:
    Mar 29, 2020
    Posts:
    53
    I'm using the TCP Examples => PBS => Blended Outline shader, is there a way to make it write to the Depth Buffer so my fog can work correctly? Thank you!
     
  12. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    583
    You can edit the shader file manually, look for this line:
    Code (csharp):
    1. ZWrite [_ZWrite]
    and replace it with:
    Code (csharp):
    1. ZWrite On
    Note however that semi-transparent shaders writing to the depth buffer might result in visual artifacts because of sorting issues and depth culling!
     
  13. Jihaysse

    Jihaysse

    Joined:
    Mar 29, 2020
    Posts:
    53
    Thanks for you answer!

    Unfortunately, it didn't change my issue.

    But I found a workaround, using the Toony Colors => mobile shader and settings the outline to "Opaque" instead of "Blended" BUT I have an issue and can't save this:

    "Getting control 0's position in a group with only 0 controls when doing repaint".
    It happens everytime I select an outline type (Off, Opaque, Blended).

    Any idea on how to solve this?
     
  14. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    583
    This happens because changing the outline type changes the shader internally, and a new UI is loaded for it while the older UI didn't finish drawing (i.e. I wasn't doing things cleanly in the UI code!).
    This should only cause visual artifacts during one frame though; if everything looks good afterwards then this error should be harmless.
     
  15. NamraGame

    NamraGame

    Joined:
    Feb 17, 2019
    Posts:
    31
    Hi! your asset looks really complete although I do have a couple of questions before purchasing it :) I was wondering if it was possible, to assign on the same shaders:
    • "wind effect" (to foliage)
    • "see through walls" (to see the player behind objects)
    • "clouds effect" (like if it's cloudy and we see the cloud shadow moving)
    thank you!
     
  16. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    583
    You can use the Shader Generator 2 to generate your own shaders with those effects:
    • Wind Animation, vertex-based wind movement
    • Silhouette Pass, to view meshes when they are behind an object
    • For the clouds, it will be a bit more involved as you need to use the Shader Properties system to customize your shader; here's one way of achieving that though:
      upload_2021-4-13_7-52-19.png
    This is in the "Hooks/Main Light Attenuation" property: you can add a "Material Property/Texture" implementation, and then change the settings you see in bold green.
    This will multiply the texture on top of the shadow attenuation of the main light, with scrolling UVs, so that with the correct texture it will look like shadows over the world.
    A couple notes:
    • UVs are set to "World Position", so that they can nicely tile across objects in the world along the XZ plane; this also means that objects with a steep change in the Y axis will probably stretch the texture dramatically (e.g. a tall cube).
    • The Swizzle is set to RRR, so that only the red channel of the texture is used. This allows you to set your texture import settings to "Single Channel" with "Red" only and save on memory (as I'm guessing the texture will be grayscale) (prefer red over alpha only as it can be compressed on some platforms, unlike alpha-only).
    • You could also blend multiple textures with each other at different scrolling speed to add more organic movement instead of a single fixed pattern that moves (same principle as in this Diablo III VFX video)
    Please send me an email if you need help with that process.
     
  17. NamraGame

    NamraGame

    Joined:
    Feb 17, 2019
    Posts:
    31
    wow, that's a really complete answer. I'm sold :) thank you.
     
  18. Jihaysse

    Jihaysse

    Joined:
    Mar 29, 2020
    Posts:
    53
    Hello,

    I'm having an issue with the Animated Dissolve in the example shaders.
    Here are pictures showing the effect with Dissolve Value set to 0, 0.5 and 1:



    And the shader (I didn't change anything and it is the same as the one shown in the documentation):


    I'm using Unity 2019.4.2f1 with the built-in renderer.

    Thank you for your help!
     
  19. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    583
    Looks like you're missing a dissolve map, usually some kind of noise (see the example material).
    If it's not specified, the whole mesh will be dissolved at every point at the same time, so that's probably what's happening here.
     
    Jihaysse likes this.
  20. Jihaysse

    Jihaysse

    Joined:
    Mar 29, 2020
    Posts:
    53
    Thanks, it works better. I still have 2 questions though:
    1) Is it normal that even with a map it still looks like a "ghost" instead of being fully invisible? Like the 3rd picture in my previous post.
    2) Can I modify the blended outline example shader to add a dissolve function just the animated dissolve example? If yes, can you guide me on where I should look at please?

    Thank you so much for your help!
     
  21. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    583
    That part looks like the cast shadows not being discarded with the dissolved parts; you should be able to fix that by opening the shader in the Shader Generator 2 (using the small cog icon at the top-right of the material inspector), and in FEATURES > OPTIONS, check "Add Shadow/Depth pass".
    There is a tutorial available that describes how the dissolve shader was created, using the Shader Properties system of the Shader Generator 2.
    Small note: the Blended Outline example uses the PBS template from the Shader Generator 1, and PBS options aren't available in the Shader Generator 2 yet. You can replicate the blended outlines part though, by using "Custom" blending for the Outline option.
     
    Jihaysse likes this.
  22. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,818
    Hey @Jean-Moreno

    I am trying to put an outline on the sharp edges of a model. Is this possible?

    Thanks,
    jrDev
     
  23. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    583
    Yes, see the Smoothed Normals Utility.
     
  24. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,818
    This is. great tool but not actually what I meant. See pic:
    upload_2021-4-26_20-20-10.png

    That middle edge that the arrow is pointing at is what I want to show outline too. Unless the Smoothed Normals Utility does that and I don't understand the tool enough?

    Thanks,
    jrDev
     
  25. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    583
    Ah I see; no the Smoothed Normals Utility is used to fix the broken outlines for hard-edge vertices.
    For your issue I'm afraid I don't see any workaround with this outline technique, it would probably work better with an edge-detection post-process effect... I think you can find some implementations on Github (including my port of Unity's old edge detection effect but I'm not sure that one works nicely with the latest version of Unity anymore...)
     
  26. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,818
    That's unfortunate.

    Is there a shader in Toony Colors that can make us see that there is an edge there? Without the wireframe outline it just looks smooth all around which isn't the effect I want. It needs to be blocky...

    Thanks,
    jrDev
     
  27. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    583
    Well the lighting should help to see that there's an angle in there, depending on the light direction. You can use wrapped lighting to ensure that there are less parts of the mesh in the shadows and thus less likely to hide some of the angles.

    You could also use a texture to have a black line at this edge that will block direct and indirect lighting (i.e. render fully black just like the outline), which would help although the texture-based outline won't always look consistent with the actual outline around the object, but it's better than nothing.
     
  28. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,818
    Yeah, I don't want shadows since I need to view from all angles.

    Thanks,
    jrDev
     
  29. HiddenTess

    HiddenTess

    Joined:
    Jan 7, 2016
    Posts:
    21
    Today, I was tinkering with the Hybrid Shader, and with some generated shaders, and I discovered something really weird. Reflection Color seems to work properly in the Hybrid Shader, but it seems to be completely ineffectual in SG2 generated shaders, regardless of how I try to assign it (color, texture, etc.). I discovered this to be the case both in one I generated today, and one I generated a few months ago. If I look inside the generated code, it looks like it's just ignoring this parameter. Any idea what's going on?
     
  30. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    583
    Indeed, it looks like it's only applied if Planar Reflections are enabled... thanks for the report, I'll fix that for the next version.
    Send me an email if you want me to send the fixed SG2 template file to you before the update is released!
     
  31. NamraGame

    NamraGame

    Joined:
    Feb 17, 2019
    Posts:
    31
    Hi!
    first, thanks for your detailed reply, it was really easy to implement the features (wind in the tree, silhouette and clouds )


    now, I have another question... is there a way to paint textures, in unity, like the terrain shader directly in Unity:


    I know about the "blend" texture in RGB, but I wanted to know if there's a way to paint directly in Unity. I tried polybrush but it says the shaders don't support texture painting
     
  32. lukasynthetic

    lukasynthetic

    Joined:
    May 20, 2020
    Posts:
    23
    Hello. I apologize if it sounds stupid, but just a beginner here. How can I change the shader in whole scene? I'm not sure I understand how that works. I get how to change and tweak individual objects but not the whole scene - which is made with Polaris 2020 and Synty's packs. And I want it to look more stylized/cartoonish but retain low poly feeling. Thanks in advance.
     
  33. NamraGame

    NamraGame

    Joined:
    Feb 17, 2019
    Posts:
    31
    Are you sure you've applied the same material to your objects? Simply drag-drop the material on your objects in your scene, and it will affect all of them when you'll change it in the inspector.
     
    lukasynthetic likes this.
  34. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    583
    I think Polybrush paints on vertex colors, in which case it should work with TCP2.
    Just make a shader with the Shader Generator 2 with Texture Blending, and in the Shader Properties tab change the source from "Material Property/Texture" to "Vertex/Color".
    I'm not sure how Polybrush detects that the shader is compatible, so chances are that it'd still give a warning, but technically it should work nonetheless.

    Indeed, as @NamraGame mentioned, there's no concept of a shader for the whole scene in Unity, unless your scene uses a single material.
    You'll have to change the shader for each material used in your scene - you should be able to select all materials in the Project view, and change their shader at once in the Inspector.
     
    lukasynthetic likes this.
  35. NamraGame

    NamraGame

    Joined:
    Feb 17, 2019
    Posts:
    31
    that is correct and it works perfectly!
    For anyone interested in knowing how to paint on the mesh in directly in Unity:
    upload_2021-6-9_15-20-47.png
     
  36. cambridgeintl5961

    cambridgeintl5961

    Joined:
    Jul 8, 2020
    Posts:
    1
    Hi @Jean-Moreno

    Does this shader also support uv face animation?
     
  37. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    583
    Can you elaborate on what you mean exactly by "UV face animation"?
     
  38. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    598
    I'm using Unity 2021 with Built in RP and having trouble with the Water shaders, especially shader generator 2. The example stylized water shows as pink. The Water Height script only works with water authored in shader generator 1.
     
  39. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    583
    You can take a look at the documentation here for the explanation of each water effect; they should work fine in both pipelines. If anything doesn't seem to work, please let me know!
    Looks like I forgot to include the example shader and material in the package folder so they were excluded, this will be fixed in the next update!
    As for the water height script, I'll take a look at updating it as well, I acknowledge I forgot about it as well when making the water effects for the Shader Generator 2.
     
  40. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    598
    upload_2021-6-24_0-39-52.png
    This is how the stylised water demo looks when I open it in 2021, and I couldn't find the water demo from the product screenshots.

    I'm having a lot of problems with Material Layers. The thing I most want Toony Colors for is noise based surface blending, but whenever I enable Mateiral Layers, even if I don't change anything, I get errors.

    upload_2021-6-24_9-46-49.png


    I have read the documentation but it's clear I don't understand most of it because I can't seem to make any changes to material layers even with the Material Layer demo shaders without incurring this issue.

    Can you show the steps of showing material layers using vertex colours without it exploding like this?

    Edit - now I'm starting to suspect that this is a Unity 2021.1 specific issue. :| I'll test in 2019 when I have more time.
     
  41. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    583
    The files are missing in the Asset Store package; I'll fix that in a future version and I've sent them to you by DM in the meantime.

    Most of those errors are from other shaders (e.g. ASE); although there is a syntax error in "Docky/Toony/SurfaceBlend". Please send me the shader so that I can look at what happened during the code generation.

    I just tried on my end in Unity 2021.1, and a basic Material Layer shader does work.

    Here are the steps:
    • Add a new "Material Layer", and optionally rename it to something like "Vertex Color R"
    • Expand its "Source" property, and choose "Vertex/Color"
    • Change the swizzle if necessary (it will use the Red color by default)
    • Optionally enable the contrast & noise properties
    • Repeat the process for each vertex color channel you wish to use as a layer
    • In the "SHADER PROPERTIES" tab, look for the "Main Properties/Albedo" one and expand it
    • You will see your material layers at the top, you can select one
    • Toggle "Enable Layer '[layer name]'"
    • By default, it will use the same implementations as the base layer, i.e. for Albedo it will use a texture, but you can override that (if you need a single color for example, or if you need to change the parameters of the texture just for that layer like UV tiling, scrolling animation, non-repeating tiling, etc.)
    • Repeat that process for other properties that you want to change based on the layers
    • Generate/update the shader
    Here's the setup in the "MATERIAL LAYERS" tab:

    upload_2021-6-24_11-26-55.png

    And on the Albedo property:

    upload_2021-6-24_11-27-16.png
     
  42. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    598
    upload_2021-6-24_12-30-47.png

    Thanks, that helped a lot! I was able to get it working!

    One of the major things that was tripping me up was if I changed the texture coordinates for the base it tripped up the noise textures. I was setting the UVs to World XZ, which broke the noise textures until I made them World XZ too. Just something I need to watch out for, but possibly the editor could show a warning that the noise texture has no source.
     
  43. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    598
    A couple of questions!

    upload_2021-6-26_20-10-29.png
    Is it possible to get aspect corrected Screen UVs? The UVs are affected by the aspect ratio.
    Scale by Texel fixes the aspect ratio, but introduces a dependency on screen resolution.

    part5-dither-smo.jpg

    Is there any option for dithered transparency while retaining shadows/etc, as seen in lots of Nintendo games?

    EDIT: I found the solution! dithered transparency is solved by this post from January! Fantastic.
    https://forum.unity.com/threads/too...h-lots-of-features.178456/page-7#post-6770338
     
    Last edited: Jun 27, 2021
  44. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    598
  45. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    583
    I'll look into that! When you wrote "broke the noise texture", do you mean visually, or the shader wouldn't compile at all? (either way I'll find out eventually when I have time to test this)

    No option for that currently, but it absolutely makes sense. I'll look into adding that for the next update.

    I think it should be doable using either a Custom Code implementation, or Code Injection. I can make an example when I have some time if you need pointers!
     
  46. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    598
    I think it was just visual, but it didn't like that noise was set to uv coords, but my surface was set to World Pos XZ. I changed the noise texture uvs to World Pos XZ and it worked okay.

    That would be really appreciated! I think clipsafe would make a big difference to

    I took at look at both but really couldn't figure it out. Some basic examples would be useful, but honestly my favourite thing about Toony Colors is staying away from the code.

    Dithered clipsafe seems to be really common in Nintendo games and would really help using when Toony Colors for objects close to the camera.
     
  47. Carrmichaelll

    Carrmichaelll

    Joined:
    Nov 30, 2016
    Posts:
    68
    Hi, i'm new to this tool and getting the hang of it, currently working on a project and would love to know if the priority option will be available or at least made available as i use it to sort semi transparent materials in my current project.
    regards.
     

    Attached Files:

  48. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    583
    I'll look into that for the next update.

    EDIT: @Carrmichaelll I just looked into it, and the Priority slider is actually just an offset to the material queue. The URP Lit shader will automatically select the main queue (geometry, alpha test or transparent), and then this slider adds an offset on top of it.
    You can also finetune this in TCP2 by changing the number of the Render Queue directly:
    upload_2021-7-28_10-20-18.png
    Note that transparent objects should always be in the "Transparent" queue because they will be sorted back-to-front to ensure they won't cull any objects behind them.
    So if you had a priority of 20 for example, just type "3000 - 20" in the Render Queue to get the same behavior in a TCP2 shader (you can type formulas in the inspectors and it will automatically calculate).
     
    Last edited: Jul 28, 2021
    Carrmichaelll likes this.
  49. GDCUnity

    GDCUnity

    Joined:
    Nov 6, 2014
    Posts:
    2
    Hello! Do you have any instructions on how I can get any of the water shaders to work in URP? All of them just come out pink (using 2019.4.13f1)

    Thanks!
     

    Attached Files:

  50. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    583
    Those examples are for the built-in render pipeline, I do need to make some URP examples too but haven't got to that yet.
    To make water shaders, you use the Shader Generator 2, and enable the water-related features.
    The documentation should help, but let me know if there are specific effects that you can't get to work.