Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Shader "Super Text Mesh/UI/Pixel Snap" {
- Properties {
- _MainTex ("Font Texture", 2D) = "white" {}
- _MaskTex ("Mask Texture", 2D) = "white" {}
- }
- SubShader {
- Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
- Lighting Off Cull Off ZWrite Off Fog { Mode Off }
- Blend SrcAlpha OneMinusSrcAlpha
- CGPROGRAM
- #pragma surface surf Lambert alpha vertex:vert
- sampler2D _MainTex;
- sampler2D _MaskTex;
- struct Input {
- float2 uv_MainTex : TEXCOORD0;
- float2 uv2_MaskTex : TEXCOORD1;
- float4 color : COLOR;
- };
- void vert(inout appdata_full v){
- v.vertex = UnityPixelSnap (v.vertex);
- }
- void surf (Input IN, inout SurfaceOutput surface) {
- half4 text = tex2D (_MainTex, IN.uv_MainTex.xy);
- half4 mask = tex2D (_MaskTex, IN.uv2_MaskTex.xy);
- surface.Emission = mask.rgb * IN.color.rgb;
- surface.Alpha = text.a * mask.a * IN.color.a;
- }
- ENDCG
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement