Search Unity

Possible for Canvas UI Objects to Receive Shadows ?

Discussion in 'Unity UI & TextMesh Pro' started by Spuddicus, May 23, 2017.

  1. Spuddicus

    Spuddicus

    Joined:
    Aug 11, 2014
    Posts:
    9
    Does anybody know how to modify the Unity 5.6 built-in UI shaders so that they can receive shadows from 3D objects? My game has a score card in the background created from Text and Image objects and CanvasRenderers. These UI elements are rendered behind 3D objects by setting the Render Mode of the Canvas to Screen Space - Camera. I want these 3D objects to cast shadows onto the UI elements. Is this possible? Thanks!
     
  2. sandstedt

    sandstedt

    Joined:
    May 24, 2015
    Posts:
    3
    Did you solve this somehow?
     
  3. WhosTheBoss

    WhosTheBoss

    Joined:
    Jan 8, 2013
    Posts:
    46
    I have a similar issue.
    I have 3D objects inside canvases. In the Editor, i can see shadows but when i deploy to mobile phone, there are no shadows
     
  4. WhosTheBoss

    WhosTheBoss

    Joined:
    Jan 8, 2013
    Posts:
    46
    I finally solved it.
    It all has to do with the scaling of Objects.

    Try adjusting the scaling of the 3D and 2D objects. Also, go to Edit>Project Settings>Quality. Search for Shadow distance and try adjusting it up and down to see if you notice any difference.

    Good luck.