Search Unity

Setting Z-Depth of legacy TextMeshPro

Discussion in 'UGUI & TextMesh Pro' started by cthomas1970, Dec 31, 2019.

  1. cthomas1970

    cthomas1970

    Joined:
    Sep 12, 2017
    Posts:
    75
    Hey, I am using Unity 2017.4.34f and as a result, the legacy (non bundled) Text Mesh Pro plugin. I am also using Shader Forge, and as a result I am having to manage the Z-Depth of various elements in my projects as a number of shaders have hard-coded Z-depth.

    So.. it appears that TMP has a fixed Z-Depth of 3000, and as a result, when I set a backing plane (shader created in ShaderForge) with a Z of 3000, it fights with TMP and the text is rendederd randomly behind or in front of the backing geo (which IS behind it). So, to fix this, I set the backing geos Z to 2999 and problem solved? Well, yes and no. The text renders to the fore now on THAT backing plane, but it also renders in front of EVERY other use of that same shader, with Z 2999.

    So, is it possible to set the Z-Depth of a TMP object?