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

Resolved Is there a way to make TMP text color blend with the background.

Discussion in 'UGUI & TextMesh Pro' started by Gunner22, Dec 9, 2022.

  1. Gunner22

    Gunner22

    Joined:
    Jan 15, 2020
    Posts:
    53
    I would like for my text to have a add blend effect with the background. So I have a background that is not static and has movement. I would like for my text color to bled to that background so it has its own color but it changes base on background. Basically an add blend effect like in adobe software. I assume this needs to be done with a shader or in material settings but not sure how.
     
    Last edited: Dec 9, 2022
  2. Gunner22

    Gunner22

    Joined:
    Jan 15, 2020
    Posts:
    53
    If anybody is having a same question I found a solution on this link:
    https://answers.unity.com/questions/1686550/additive-shader-for-textmeshpro.html

    This adds additive or add blend mode to TMPText.
    You need to edit TextMeshPro/Mobile/Distance Field Overlay shader(You can assign it to text and right click select shader to find it) You can edit it directly around line 77 changing
    Code (CSharp):
    1.  Blend One OneMinusSrcAlpha
    to
    Code (CSharp):
    1.  Blend One One


    or you can duplicate it change the first line to Shader "TextMeshPro/Mobile/Distance Field Overlay Additive" and do the same for blend. Than just drag it to the material part of TMP component you don't need to create a new material.