Search Unity

  1. Engage, network and learn at Unite Austin 2017, Oct 3 - 5. Get your ticket today!
    Dismiss Notice
  2. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  3. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice
  4. Unity 2017.1 is now released.
    Dismiss Notice
  5. Unity 2017.2 beta is now available for download.
    Dismiss Notice

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

Discussion in 'Unity UI & TextMesh Pro' started by KingSlizzard, Sep 12, 2017.

  1. KingSlizzard

    KingSlizzard

    Joined:
    Jan 9, 2010
    Posts:
    219
    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)
    [​IMG]
    The UI object in the scene looks like this
    [​IMG]

    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:
    254
    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. KingSlizzard

    KingSlizzard

    Joined:
    Jan 9, 2010
    Posts:
    219
    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.
    [​IMG]
    So my problem is that this default shader does not appear.
     
  4. Johannski

    Johannski

    Joined:
    Jan 25, 2014
    Posts:
    254
    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?