Thank you very much. I managed to finally fill the font color with my texture but now I have a problem:
I had to create a shader based on the GUI/Text shader code, just changed a few lines and got my texture in the font, the problem is that it's now affecting the Effects like "Outline" or "Shadow" check the screenshots attached.
The first screenshot has a red outline, and the second one has a white outline but as you can see it's mixing with the texture, so no white outlines allowed (same happnes with Shadow).
Can anyone give me a hand? I'm not a shader expert so here's the code:
(I placed a comment on the lines I added)
Shader "Custom/TexturedText" {
Properties {
_MainTex ("Font Texture", 2D) = "white" {}
_DetailTex ("Detail Texture", 2D) = "white" {} //added by justjuank
_Color ("Text Color", Color) = (1,1,1,1)
}
SubShader {
Tags {
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
"PreviewType"="Plane"
}
Lighting Off Cull Off ZTest Always ZWrite Off Fog { Mode Off }
Blend SrcAlpha OneMinusSrcAlpha
Pass {
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata_t {
float4 vertex : POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
};
struct v2f {
float4 vertex : POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
};
sampler2D _MainTex;
uniform float4 _MainTex_ST;
uniform fixed4 _Color;
sampler2D _DetailTex; //added by justjuank
v2f vert (appdata_t v)
{
v2f o;
o.vertex = mul(UNITY_MATRIX_MVP, v.vertex);
o.color = v.color * _Color;
o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex);
return o;
}
fixed4 frag (v2f i) : COLOR
{
fixed4 col = i.color;
col.rgb *= tex2D(_DetailTex, i.texcoord).rgb; //added by justjuank
col.a *= tex2D(_MainTex, i.texcoord).a;
return col;
}
ENDCG
}
}
}
Not sure if this will ever work by modifying the frag function, I tried to modify the vert function to achieve the same but I failed since I have no idea.
Thanks