Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Outlines from the Toon shader not showing on an Android build

Discussion in 'Open Projects' started by BNJMO, Nov 18, 2020.

  1. BNJMO

    BNJMO

    Joined:
    Dec 6, 2015
    Posts:
    11
    Hi everyone!

    I tried to experiment with the great-looking toon shader created with this project by testing it on a mobile game. So I copied to Shaders folder to another project which targets Android. In the editor, everything looks fine. However, when I build the game, the outlines just disappear. Any thoughts why?

    Thanks
     
  2. cirocontinisio

    cirocontinisio

    Joined:
    Jun 20, 2016
    Posts:
    884
    Hey @BNJMO! I replied on YouTube - but I'll reply again here:

    It could be because of a variety of reasons. A wild guess: do you have anti-aliasing on? It's needed by the effect to work properly. Maybe it's off by default on Android. In that case you should try by turning it back on as a first step.

    In any case, just speaking in general our target platforms are PC, Mac and Linux.
     
  3. BNJMO

    BNJMO

    Joined:
    Dec 6, 2015
    Posts:
    11
    Thank you for your answer. I actually found out that the Depth Texture and Opaque Texture in my URP quality settings were disabled. A better understanding of how the shader works made me understand they were needed.
    There is something else that I noticed about the shader. The thickness of the lines would change according to the resolution of the device it is running on. This would mean the overall look of the game might vary according to the resolution of the different players
     
    cirocontinisio likes this.
  4. cirocontinisio

    cirocontinisio

    Joined:
    Jun 20, 2016
    Posts:
    884
    Yes, totally, the quality and final appearance of the Outline is really dependent on the resolution, and I really wish we could fix this in the long term. Or make it better, in general.

    We actually have a thread specifically for the outline, not much activity in there anymore but that's where I'd post if you want to make modifications to the effect!
     
  5. Divesh_dogra

    Divesh_dogra

    Joined:
    Mar 30, 2020
    Posts:
    6
    Hello, I am having the same issue in unity 2020.3.
    I made a shader from shader graph for creating an outline from normals
    Here is a link which I followed to make this shader -

    This works fine in unity but after I make a build for android it is simply not visible, I checked my URP settings I have both opaque and depth texture enabled also anti-aliasing is enabled in URP settings.
    Any help would be appreciated.

    Thank you