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

Issues customizing generated Text Mesh Pro Materials/Shaders.

Discussion in 'UGUI & TextMesh Pro' started by JFernald, Jun 26, 2020.

  1. JFernald

    JFernald

    Joined:
    May 11, 2015
    Posts:
    4
    I'm developing a system that required me to customize the standard SDF shader that Text Mesh Pro generates to add a _RefrenceID of a particular game object I want to use as a stencil for text mesh pro. Nothing super special just a new integer parameter in the property and it works just fine although the custom editors for TextMeshPro prevent me from seeing the value/changing it unless I switch to debug view (a minor annoyance).

    The problem I'm having here is that it looks like the material is buried somewhere in the TextMeshPro .asset file that gets generated so I'm unable to access the material/copy it and set the value to different things easily.

    Is there any workaround for this?
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    What do you mean by buried in the .asset?

    The default material is a sub object of the TMP_FontAsset. This material can be accessed by using the fontSharedMaterial property of the text object or simply the .material of the Font Asset.