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

How to solve this?

Discussion in 'UGUI & TextMesh Pro' started by strongbox3d, Jan 22, 2020.

  1. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    860
    Hello guys,

    Here I have attached a screenshot illustrating my problem. I am using Unity 2019.2 This circles are images on canvases with World Space Render Mode. How should one go about only rendering the circles when it is within the floor area and not when it is above the empty space? Does anyone knows what the solution could be for this?

    Regards,
    Carlos

    CirclesImage.jpg
     
  2. Ambrose998800

    Ambrose998800

    Joined:
    Jun 23, 2015
    Posts:
    74
    If you use a camera rendering the floor only (with background/empty space disabled in culling mask) you could use that over a target texture as a mask for the circle.
     
  3. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,350
    "brute-forced" through some of the shader settings,
    and using alphatest on default UI shader seems to make similar effect?
    upload_2020-1-26_20-16-0.png

    in gameview only though(?)
    upload_2020-1-26_20-16-37.png
     
  4. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    860
    Thanks a lot to you guys for replying! I forgot to mention that I am using Unity 2019.2. In this version of Unity the UI shader doesn't have a Render Queue that I can see. Anyhow playing with the settings of the UI/Default shader following @mgear's idea, I got it to work:

    I have the circle sprite in the "Image" sprite Results_Screeshot.jpg colored with whatever color I need. And the shader is set as in this screenshot and it shows in both gameview and editor view:
    UI_Shader_Settings.jpg

    Hope I help someone with the same problem.
     
    xucian likes this.