Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

TextMesh Pro Visual Artifacts when Main Camera clear color matches Image color

Discussion in 'UGUI & TextMesh Pro' started by BillyGraban, Apr 2, 2020.

  1. BillyGraban

    BillyGraban

    Joined:
    Apr 1, 2020
    Posts:
    7
    Repro Steps:
    - Turn off skybox
    - Create Canvas
    - Add TMPro Text object to canvas
    - Add UI Image to canvas (below TMPro object)
    - Set Image color to match the camera clear color exactly
    - Move the Image over the text

    Screenshot 2020-04-01 19.12.59.png

    You can can see that the text has been corrupted visually. For some reason this only works when the Image itself is of a certain size. Smaller images will simply write over the text (the effect I was hoping to achieve)

    Is there a better solution than: "Just don't use the same color"?
     
  2. BillyGraban

    BillyGraban

    Joined:
    Apr 1, 2020
    Posts:
    7
    Found a decent solution. Instead of clearing the MainCamera to a solid color, I changed it to Skybox clear. Added a skybox component and a simple material with a shader that sets all pixels to the desired background color.

    After that the visual artifacts from images overplayed on TMPro Text components draw as intended.