Why text always appears and isn't influence by directionnal or point lights ?

Hi all :slight_smile:

All the question is in the title…

TextMesh appears to fu*k-up material.
I’d like to have text used as decal, beeing hidden by objects in front and darken at night and lighten in the sunlight…

Is this simple thing possible ?

Thanks in advance for you answer !

nobody can answer ???
Is this forum still alive ? 3 questions of mine not aswered since several days^^ :frowning:

Textmeshpro has it’s own set of shaders. You can use the text texture to add it to a custom material ((un)lit shader graph with alpha clip), but it will look a bit worse. You could try doing this in a decal shader graph as well and see if it works. Did you already try it?

Calm down, this is a community forum, so almost everyone here helps eachother for free

I know it and i’m calm :stuck_out_tongue:
I didn’t use TMP yet as textmesh is just perfect to me except for shaders…
I’ll give TMP a try…
I suspect textmesh not to provide normals to the shader…

Thanks for your answer and happy unitying :slight_smile:

Coming here with some more info.
Legacy textmesh is bugged and faces come to shader flipped. This is simply why characters won’t react to any light.
Normals just have to be flipped.
Using this shader works like a charm:

Shader "Custom/rien"
{
    Properties
    {
        _Color ("Color", Color) = (1,1,1,1)
        _MainTex ("Albedo (RGB)", 2D) = "white" {}
    }
    SubShader
    {
        Tags { "RenderType"="Opaque" }
        LOD 200

        CGPROGRAM

        #pragma surface surf Lambert vertex:vert

        // Use shader model 3.0 target, to get nicer looking lighting
        #pragma target 3.0

        sampler2D _MainTex;

        struct Input
        {
            float2 uv_MainTex;
        };

        fixed4 _Color;
       

         void vert (inout appdata_full v)
         {
            v.normal = v.normal * -1.0f;
         }

        void surf (Input IN, inout SurfaceOutput o)
        {
            // La texture dont l'alpha nous interesse
            fixed4 c = tex2D (_MainTex, IN.uv_MainTex);
           
            clip(c.a-0.5f);

            o.Albedo = _Color;

            o.Alpha = c.a;
        }
        ENDCG
    }
    FallBack "Diffuse"
}

Happy unitying ! :smile: