Search Unity

Unity UI Why do my UI images have no shader (rendering as invisible) when active in the hierachy?

Discussion in 'UGUI & TextMesh Pro' started by QuantumCalzone, Sep 12, 2017.

  1. QuantumCalzone

    QuantumCalzone

    Joined:
    Jan 9, 2010
    Posts:
    262
    I'm on v5.6.3p1 and I've found sometimes my UI Image elements are invisible with no shader.
    The inspector looks like this (the red box is where I'd expect to see the Shader info)

    The UI object in the scene looks like this


    The object is behaving as if it's inactive in the hierarchy (any UI image in the hierarchy has no shader info) but in this case, it's active so I'm quite puzzled as to the cause of this.

    Any ideas? Thanks for your time.
     
  2. Johannski

    Johannski

    Joined:
    Jan 25, 2014
    Posts:
    826
    You don't see any shader info because the image has no material assigned (only then will you see the shader info).

    As for the visibility: Your setup seems to be correct, so it is strange that you don't see the element. Do you maybe use a mask in one of the upper layers. From the information you are showing I can't see any problem, I guess it is hidden somewhere else. Did you try to disable and enable the object? that should trigger a redraw.
     
  3. QuantumCalzone

    QuantumCalzone

    Joined:
    Jan 9, 2010
    Posts:
    262
    Not necessarily. As you can see in my screenshot below, I have a UI Image with no material and it still has the default shader.

    So my problem is that this default shader does not appear.
     
  4. Johannski

    Johannski

    Joined:
    Jan 25, 2014
    Posts:
    826
    Huh, you're right... Somehow I always ignored it as it is not that interesting for me if I can't set any values.

    What happens if you add a material? And if you see the element then, what happens if you remove it again? Can you see child objects from invisible ones?
    Other than that did you check my last suggestion?