Guest User

Untitled

a guest
Jul 15th, 2018
112
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
  2.  
  3. Shader "Sprites/Diffuse"
  4. {
  5.     Properties
  6.     {
  7.         [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
  8.         _Color ("Tint", Color) = (1,1,1,1)
  9.         [MaterialToggle] PixelSnap ("Pixel snap", Float) = 0
  10.         [HideInInspector] _RendererColor ("RendererColor", Color) = (1,1,1,1)
  11.         [HideInInspector] _Flip ("Flip", Vector) = (1,1,1,1)
  12.         [PerRendererData] _AlphaTex ("External Alpha", 2D) = "white" {}
  13.         [PerRendererData] _EnableExternalAlpha ("Enable External Alpha", Float) = 0
  14.     }
  15.  
  16.     SubShader
  17.     {
  18.         Tags
  19.         {
  20.             "Queue"="Transparent"
  21.             "IgnoreProjector"="True"
  22.             "RenderType"="Transparent"
  23.             "PreviewType"="Plane"
  24.             "CanUseSpriteAtlas"="True"
  25.         }
  26.  
  27.         Cull Off
  28.         Lighting Off
  29.         ZWrite Off
  30.         Blend One OneMinusSrcAlpha
  31.  
  32.         CGPROGRAM
  33.         #pragma surface surf Lambert vertex:vert nofog nolightmap nodynlightmap keepalpha noinstancing
  34.         #pragma multi_compile _ PIXELSNAP_ON
  35.         #pragma multi_compile _ ETC1_EXTERNAL_ALPHA
  36.         #include "UnitySprites.cginc"
  37.  
  38.         struct Input
  39.         {
  40.             float2 uv_MainTex;
  41.             fixed4 color;
  42.         };
  43.  
  44.         void vert (inout appdata_full v, out Input o)
  45.         {
  46.             v.vertex = UnityFlipSprite(v.vertex, _Flip);
  47.  
  48.             #if defined(PIXELSNAP_ON)
  49.             v.vertex = UnityPixelSnap (v.vertex);
  50.             #endif
  51.  
  52.             UNITY_INITIALIZE_OUTPUT(Input, o);
  53.             o.color = v.color * _Color * _RendererColor;
  54.         }
  55.  
  56.         void surf (Input IN, inout SurfaceOutput o)
  57.         {
  58.             fixed4 c = SampleSpriteTexture (IN.uv_MainTex) * IN.color;
  59.             o.Albedo = c.rgb * c.a;
  60.             o.Alpha = c.a;
  61.         }
  62.         ENDCG
  63.     }
  64.  
  65. Fallback "Transparent/VertexLit"
  66. }
RAW Paste Data