Advertisement
Guest User

Untitled

a guest
Jul 9th, 2012
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.37 KB | None | 0 0
  1. Shader "Custom/crate" {
  2.  
  3.     Properties {
  4.         _Color ("Main Color", Color) = (1,1,1,1)
  5.         _MainTex ("Diffuse (RGB) Alpha (A)", 2D) = "white"
  6.     }
  7.  
  8.  
  9.     SubShader {
  10.         Blend SrcAlpha OneMinusSrcAlpha
  11.         Tags { "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" }
  12.         LOD 200
  13.  
  14.        Pass {
  15.  
  16.             CGPROGRAM
  17.  
  18.                 #pragma vertex vert
  19.                 #pragma fragment frag
  20.                 #pragma multi_compile_builtin
  21.                 #pragma fragmentoption ARB_precision_hint_fastest
  22.                 #include "UnityCG.cginc"
  23.                
  24.                 struct v2f
  25.                 {
  26.  
  27.                     float4  pos : SV_POSITION;
  28.                     float2  uv : TEXCOORD0;
  29.                 };
  30.  
  31.  
  32.                 v2f vert (appdata_base v)
  33.                 {
  34.                     v2f o;
  35.                    o.pos = mul(UNITY_MATRIX_MVP, v.vertex);
  36.                    o.uv = v.texcoord.xy;
  37.                    return o;
  38.                 }
  39.  
  40.  
  41.                 sampler2D _MainTex;
  42.                 float4 _Color;
  43.                 fixed4 frag(v2f i) : COLOR
  44.  
  45.                 {
  46.                     fixed4 result = tex2D(_MainTex, i.uv) * _Color;
  47.                     return result;
  48.                 }
  49.  
  50.             ENDCG
  51.  
  52.         }
  53.     }
  54.  
  55.     FallBack "Transparent/Cutout/VertexLit"
  56.  
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement