Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Toony Colors Pro+Mobile 2

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

  1. OhiraKyou

    OhiraKyou

    Joined:
    Mar 27, 2012
    Posts:
    248
    Back again with another suggestion! I must be getting a bit annoying at this point. Sorry about that.

    I vertex colored some geometry partially white to simulate the bottom being lit using the vertex colors as an emission map value (so that the light and texture don't have to share a UV space) and immediately came to the conclusion that it could be significantly improved by adding an exponent property to the shader to control the falloff.

    Here's an example showing an HDR emissive color with a brightness of 3 filtered through a half black and half white vertex colored cube, which has no bloom at all and a reduced falloff due to the brightness; and, below that, the same color with a brightness of 10, which has a nice bit of bloom, but with an even less noticeable falloff. The objects are not sunk into the liquid; they are sitting on top, scaled down vertically. Ideally, I'd like to specify an exponent value to add some intense falloff so that the very bottom blooms heavily while most of the object remains primarily colored by the texture. This would visually ground the object in the liquid and give the impression that it is being aggressively corroded.

    So, my suggestion is simply to add an exponent material property to the emissive map.
     
  2. OhiraKyou

    OhiraKyou

    Joined:
    Mar 27, 2012
    Posts:
    248
    Implemented the pow falloff myself directly in the shader earlier. Here's the result (with a little bit of tinting in the texture, to really sell the effect): https://imgur.com/r0XjLLn

    I just added the pow to the emissive line, like this:
    Code (csharp):
    1. o.Emission += mainTex.rgb * (pow(vcolors.r, _EmissionPower) * _EmissionColor.a) * _EmissionColor.rgb;
     
    Last edited: Oct 12, 2017
  3. pleasantPretzel

    pleasantPretzel

    Joined:
    Jun 12, 2013
    Posts:
    29
    Hi Jean!

    I have a question about outlines and renderQueues. (Well, I think it's related to the queue.)

    In my scene, I'm running into problems with the outline being rendered before other effects, like cloud systems (Enviro), despite the fact that the clouds are definitely further away from the camera.

    I've attached an image to help explain. The outline is set to opaque/#000000FF. Not quite sure what to make of this? Any suggestions? Is this something I should ask Enviro about instead?

    EDIT
    : Looks like it's the Fog script that is causing the trouble. It's rendering fog with a material at queue 3001, but if I change the TCP2 material's queue to more or less than 3001, it doesn't help the outline.

    toony-color-pro-renderqueue-question.jpg


    Thanks for reading! :)
     
    Last edited: Oct 12, 2017
  4. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    486
    Great that you could add it yourself! These kind of features are very specific, so I don't think they'd be a good candidate to add on the main shader template.

    I'm not sure if that means that you solved the problem? If not, can you send me an email with a small repro project so that I can take a deeper look; right now I'm not sure what could be the cause (also don't forget to tell me the Unity version you use).
     
  5. hitorikyo

    hitorikyo

    Joined:
    Jan 2, 2015
    Posts:
    6
    Hello Jean,

    I am having an issue with the toony color 2 shaders. In the "stylization/outline" section of the shader, if I enable legacy outline and outline behind model is set to "depth buffer" all shadows cast onto the object disappear, this is not the case when using the non legacy method. Is this an issue that can be resolved?

    The reason I want to use the legacy version is because I am using a custom material for the ground and there is render sorting issues with the outline in non legacy.

    I am using Unity 2017.1.0f3 and created the shader using the shader generator.

    Thanks in advance.

    - Tom
     
  6. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    486
    I'm pasting the answer I gave you by email for other people that might have this issue:
    More info about Unity's render queues can be found here: https://docs.unity3d.com/Manual/SL-SubShaderTags.html
     
  7. hitorikyo

    hitorikyo

    Joined:
    Jan 2, 2015
    Posts:
    6
    Hello Jean, that did the trick, thank you very much.
     
  8. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    630
    Hi!
    Regarding GPU instancing, it seems the Shader Generator ones don't support it? (no tick box in GUI) The non-user ones do.
    Expected? Anything that can be done please?
    Thanks!
     
  9. OhiraKyou

    OhiraKyou

    Joined:
    Mar 27, 2012
    Posts:
    248
    Generated shaders definitely support instancing. If you're using a shader from an earlier version, however, you may need to regenerate it after updating.
     
  10. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    630
    Hey, thx for replying! Odd. I did regenerate (by that I mean I opened it in Shader generator and clicked update). It's a PBR based one. Maybe that could cause problems? I'll try doing it from scratch too. Thx
     
  11. OhiraKyou

    OhiraKyou

    Joined:
    Mar 27, 2012
    Posts:
    248
    Huh. Apparently, it's the opposite: my older generated PBR shaders have the checkbox, but a PBR shader I just generated to test it does not.
     
    Arkade likes this.
  12. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    630
    I've clicked "like" on your reply cuz it's like a currency thing but booo.... don't like it! ;-)
    Hopefully @Jean-Moreno has some info!
     
    OhiraKyou likes this.
  13. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    486
    @Arkade @OhiraKyou It looks like GPU instancing doesn't work for PBS shaders: the option doesn't show for generated shaders, and even though it does show in non-generated ones, it doesn't seem to do anything.
    I'm investigating that and will let you know what I find!

    EDIT: found the issue, a fix will come in v2.3.372!
     
    Last edited: Nov 22, 2017
    Arkade and OhiraKyou like this.
  14. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    630
    wonderful, thanks!
     
  15. Crocomodo

    Crocomodo

    Joined:
    Nov 21, 2017
    Posts:
    29
    Soory I reply on the wrong thread. AO and Custom Ambient aren't working. I use Unity 2017.3.0f3. Anyone have the same issue?
     
  16. Piahouka

    Piahouka

    Joined:
    Sep 1, 2015
    Posts:
    40
    Hi,Jean-Moreno.
    I have one problem about pbs double side shader.
    Back face reflects distant shadow.

    Please give me an answer how to solve this.
     

    Attached Files:

    Last edited: Jan 7, 2018
  17. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    486
    I've found an issue with these and a fix will come in the next version! (2.3.39)
    If you don't want to wait, please send me an email and I'll send you the updated template.

    (both threads are actually active, people still post in the original one for issues with TCP2!)
     
  18. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    486
    Try to enable "Add Shadow Passes" in the Shader Generator, and if that doesn't work please send me an e-mail with the shader attached.
    I haven't been able to reproduce the issue locally so far!
     
    Piahouka likes this.
  19. Piahouka

    Piahouka

    Joined:
    Sep 1, 2015
    Posts:
    40
    There is no Add Shadow Passes check box in PBR mode.
    But, normal mode works correctly.:)
     
  20. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    486
    Great!
    I'd still like to solve the issue on PBR though!
    I've identified an issue when using the Transparent rendering mode in the material. Is that what you're using?
    Could you send me the generated shader and the material you're using by email?
    I'd appreciate it!
     
  21. Piahouka

    Piahouka

    Joined:
    Sep 1, 2015
    Posts:
    40
    I sent you Email from asset store support email address.
     
    Jean-Moreno likes this.
  22. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    486
    Try to enable "Backface Lighting" just below the Culling options in the PBR template.
     
  23. Piahouka

    Piahouka

    Joined:
    Sep 1, 2015
    Posts:
    40
    It remains reflecting shadow.
    But, normal mode shader can imitate PBS appearance.
    And It has much more interesting function.
    So, I decided to use normal shader for hair.;)
     
  24. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    486
    Hmm weird, it did solve the issue on my end.
    But fair enough, glad to know your problem is resolved!
     
    Piahouka likes this.
  25. Jick87

    Jick87

    Joined:
    Oct 21, 2015
    Posts:
    124
    @Jean-Moreno Just ran across an issue with the WindWaker water shader which is included with the examples in the asset...

    I have a quad with a material which has that shader on it. I have the quad set as static. When I bake the lighting in my scene the quad with that shader ends up completely black. No other objects in my scene have this issue. This is using the default Unity quad, not a custom mesh. I'm using the Progressive Lightmapper in Unity 2017.3. It is the unchanged WindWaker shader included with the asset, I have not modified it at all.

    Is this a known issue? Is there a way to fix it?

    Thanks for the great asset! It has really helped me with my current project. :)
     
  26. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    486
    Currently water shaders are not meant to work along with lightmaps, but I'm realizing that it could make sense. I'll look into a way to fix that for the next update, and will modify the example shaders accordingly!
     
  27. Jick87

    Jick87

    Joined:
    Oct 21, 2015
    Posts:
    124
    Sounds great! I'll look forward to that. Thanks so much! :)
     
  28. Piahouka

    Piahouka

    Joined:
    Sep 1, 2015
    Posts:
    40
    Hi, Jean-Moreno. I have one problem.
    Toony colors pro2 conflicts other asset(But no error in console)
    PBS shader works fine but normal shader will be pure white in any setting.
    Please teach me what thing is wrong.

    Toony colors pro2 is latest version.
     
    Last edited: Jan 26, 2018
  29. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    486
    I forgot to add it in the release notes, but the latest version, 2.3.39, has the lightmap fix for water template.

    No error in console sounds weird, do you see any error in the inspector when selecting a broken shader file in the Project view?
    Have you tried right-clicking on the TCP2 folder, and click on "Reimport"? (it may take a few minutes to recompile the shaders, but sometimes that's necessary to make them work again, especially after the folder has been moved)
     
    Jick87 likes this.
  30. Piahouka

    Piahouka

    Joined:
    Sep 1, 2015
    Posts:
    40
    Thank you for reply.
    After re-import asset I got some syntax shader error like this.
    Shader error in 'Toony Colors Pro 2/Examples/Default/Subsurface Scattering': syntax error, unexpected ';' at token ";" type name expected at token ";" at /UnityShadowLibrary.cginc(63) (on d3d9)
    I think this caused by NGSS's custom UnityShadowLibrary(https://www.assetstore.unity3d.com/jp/#!/content/79454)
    Do I sent you UnityShadowLibrary.cgnic?
     
  31. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    486
    Yes you can send it to me by email and I can take a look, however I think it's also worth contacting the author of NGSS see if they have any clue.
     
    Piahouka likes this.
  32. Piahouka

    Piahouka

    Joined:
    Sep 1, 2015
    Posts:
    40
    I sent you mail from asset store.:)
    And I contact in NGSS support forum too.



    This syntax error will fix next version NGSS.
    Jean-Moreno thank you for helping me!
     
    Last edited: Jan 26, 2018
    Jean-Moreno likes this.
  33. h00man

    h00man

    Joined:
    Apr 17, 2017
    Posts:
    54
    hey man im trying use standard specular of your toony shader but it gives me this error and my character turn all pink , is there any way to fix this ? thanks

    Standard PBS (Specular)': 'unitySampleShadow': cannot implicitly convert from 'float2' to 'float4' at Assets/JMO Assets/Toony Colors Pro/Shaders PBS/TCP2_PBS_Core.cginc(24) (on d3d11)
     
  34. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    486
    I just tested and I can't get any error on my end! (Unity 2017.3.0)

    What version of Unity are you using?
    What options in the material?
    How is your lighting setup?
     
  35. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    9,848
    Backface Lighting is incorrectly implemented.

    This line:
    s.normalWorld.z *= vface;
    should be:
    s.normalWorld.xyz *= vface;

    Flipping the z works if you're flipping the tangent space normal as the z is aligned to the surface normal. Flipping the world space z is just that, flipping the world space z.

    Alternatively you could use:
    // for forward base
    VertexOutputForwardBase i = tcp2i.base;
    i.tangentToWorldAndPackedData[2] *= vface;


    // for forward add
    VertexOutputForwardAdd i = tcp2i.base;
    i.tangentToWorldAndLightDir[2] *= vface;


    That'll flip the vertex normal while keeping the normal maps tangent space x and y.

    The first option is likely more desirable for characters or other objects which have a normal map baked for that specific mesh. The second is better for generic normal maps.
     
    hopeful likes this.
  36. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    486
    I guess this is from a shader generated with the "Standard PBS" template?
    I actually wasn't sure about this, it seemed that one way worked in some cases, and the other way in others. Your explanation makes sense now!

    I did add the option a while ago to choose between Z and XYZ in the "Default" template, but didn't do it in the PBS one - I'll add that for the next update.
    Thanks for the heads up!

    EDIT: backface lighting has been fixed for the "Standard PBS" template as of v2.3.391
     
    Last edited: Mar 12, 2018
    hopeful and bgolus like this.
  37. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    9,848
    Yes, sorry, I should have specified.
     
  38. marcos

    marcos

    Joined:
    Oct 18, 2009
    Posts:
    589
    Hi @Jean-Moreno ,

    Any plans to add tessellation?

    Would be cool to have.

    Kindest,
    Mark
     
  39. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    486
    Phong Tessellation has been added to the Shader Generator (default template) a few versions ago, but:
    - it doesn't work with vertex-based options (this is a Unity limitation with Surface shadeds unfortunately)
    - it isn't implemented for outlines, so while the main mesh could be tessellated the outline won't be
    - I don't think it'll ever be implemented for the PBS template as it would make for a quite complicated file and I don't know enough about domain/hull shaders to really know how all this could work
    [EDIT: Tessellation for "Standard PBS" template has been added as of version 2.3.54!]

    The implementation I made was an experiment based on Unity's docs, and I might add other kind of tessellation in the future, like height-map based or edge distance.
    Was there one in particular that you wanted?

    That being said I have other higher priority things to add for TCP2 currently!
     
    Last edited: Jul 27, 2018
  40. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,153
    The mobile shader included doesn't have many of the options described in the docs. There are some hidden shaders absurdly not accessible for the user, and the overall system is very unintuitive. I 'm trying to setup the outline feature in the mobile shader but that option (and others) is not present in the inspector. The simple outline shaders included don´t work, at least in Shader Model 2.0. (they don't show any outline).
    I have the last version of Toony Colors Pro 2 on Unity 5.1.4.
     
    Last edited: Mar 14, 2018
  41. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    486
    The mobile shader should have all the options described in the Unified Material Features section in the documentation (except for Reflection which is specifically marked as Desktop-only).
    The other options are available using the Shader Generator.
    What options can't you find specifically?

    The hidden shaders are actually automatically selected based on the options you select in the Desktop or Mobile shaders inspectors: this is an alternative to using shader keywords, which were extremely limited back when TCP2 was released (I think you could only use 64 project-wide, minus the ones reserved by Unity).

    That being said you are using Unity 5.1, so from what I can see the version of TCP2 that you are getting is from august 2016, and it has evolved a lot since then.
    Any reason why you can't upgrade?

    Please send me the outline shader that doesn't seem to work by email and I'll take a look at it.
     
  42. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,153
    From asset store about Toony Colors Pro :

    Version: 2.3.391 (Mar 06, 2018)Size: 25.1 Mb

    Originally released: 12 April 2013
    Package has been submitted using Unity 4.5.5, 5.0.0, 5.3.0, 5.4.0, and 5.5.0 to improve compatibility within the range of these versions of Unity.

    It is assumed all versions are updated.

    Anyway the method to add properties to mobile shader (with Shader generator) is very unintuitive.
    Is it not easier to expose the options by default to the user? The outline option is not available by default.
    In my experience, contacting you by email is a waste of time, sorry.
     
  43. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    486
    Unfortunately the Asset Store doesn't have a way to specify the version of the package for each Unity version, and this is the only way to let it being downloaded for older versions of Unity even though they are older versions of the package itself.

    The outline option should be available in the Mobile shader by default, hence why I asked for you to send me the shader so that I can verify this. Or you can tell me the version of TCP2 by looking at its readme file, and I can then find it in my archives.
    If letting me help you is a waste of your time, then I'm sorry but there's nothing further I can do for you.
    If you are unhappy with your purchase, I'd be happy to allow a refund, provided that you bought it in the last 15 days.
     
  44. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,153
    Sorry but the last time I contacted you, at least one year ago, I didn't receive any response.
    And I don't see any outline option available by default in the mobile version.
     
  45. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    486
    Ok I found that conversation from March 2016, and I sent the last email to it, asking you to update TCP2 to the latest version, which was fully compatible with your Unity version at the time.
    Going over it, you weren't answering the questions I asked to try to figure out what could be wrong, but instead only reassessed that things weren't working as you expected them to, even though in my tests everything worked fine.
    Kind of like what you are doing here: I've asked you multiple questions and your only response is that you can't find that option without answering the questions.
    As I wrote earlier, if you're not willing to let me help you, then I can't do anything more for you.
     
    adslitw likes this.
  46. K0m1x

    K0m1x

    Joined:
    Aug 19, 2013
    Posts:
    26
    hey, can you tell me how I can change the outline width per script? thanks
     
  47. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    486
    Sure, you just have to change the _Outline shader variable on the material using material.SetFloat, e.g.:
    Code (CSharp):
    1. Renderer myRenderer;
    2. Material mat = myRenderer.sharedMaterial;
    3. mat.SetFloat("_Outline", 0.5f);
     
  48. K0m1x

    K0m1x

    Joined:
    Aug 19, 2013
    Posts:
    26
    I used that code and it overwrote all the materials in the game permanently.... but I managed to restore it... guess what I wanted was with material instead of sharedmaterial.
     
  49. Nick_Counter

    Nick_Counter

    Joined:
    Apr 19, 2018
    Posts:
    1
    I was having this same issue, the point light and directional light were not working and I tried EVERTHING...
    BUT
    Turns out my Project Settings/Quality settings were set to Fastest which has a pixel light count of zero, when I switched the settings to 'Simple' the Pixel Light Count is at 1 and everything worked beautifully.
    My bad for being a Noob I guess :p
     
  50. ToamoaStudio

    ToamoaStudio

    Joined:
    Jul 1, 2015
    Posts:
    13
    Hi,

    I wanted to know if it was possible to do this kind of effect with TCP2?



    Thanks !
     
unityunity