Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We're looking for insight from anyone who has experience with game testing to help us better Unity. Take our survey here. If chosen to participate you'll be entered into a sweepstake to win an Amazon gift card.
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Unity 2018.3 is now released.
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

TextMesh Pro GUI- Surface shader lighting

Discussion in 'Unity UI & TextMesh Pro' started by Antragon, Dec 7, 2018.

  1. Antragon

    Antragon

    Joined:
    Jun 9, 2015
    Posts:
    4
    Hey there,

    I'm currently trying to figure out how to get lighting to work in game view on Textmesh Pro GUI.

    Basically what I do is:
    - open new Unity project (tried with Unity 2018.2.15f1 as well as Unity 5.6.1p1)
    - Add Gameobect > UI > TextMeshPro - Text
    - Set Shader to TextMeshPro/Distance Field (Surface)
    - Add Gameobject > Light - Directional Light

    and what I get is this:

    upload_2018-12-7_5-28-20.png

    Clearly the game view looks different from the scene view. I know I could use a TextMeshPro 3D Gameobject, but given that lighting affects the GUI correctly in the scene view, is there any other way to resolve this issue without 3D objects?

    Thanks!
     
    Last edited: Dec 7, 2018
  2. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    2,150
    The Canvas must be in either Screen Space Camera or WorldSpace. Make sure you assign a Camera to the Canvas.

    For better visuals, use a Point Light or Spot Light.
     
  3. Antragon

    Antragon

    Joined:
    Jun 9, 2015
    Posts:
    4
    Thanks a lot, that did the trick!
     
    Stephan_B likes this.