Search Unity

  1. Unity 2018.3 is now released.
    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. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  5. Nominations have been announced for this years Unity Awards. Celebrate the wonderful projects made by your peers this year and get voting! Vote here!
    Dismiss Notice
  6. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  7. 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:
    3
    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:
    1,874
    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:
    3
    Thanks a lot, that did the trick!
     
    Stephan_B likes this.