daily pastebin goal
41%
SHARE
TWEET

Demo 33 - Bilboard bush

tonynogo Jul 6th, 2017 2,063 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Shader "Custom/Billboard"
  2. {
  3.     Properties
  4.     {
  5.         _MainTex ("Texture", 2D) = "white" {}
  6.     }
  7.     SubShader
  8.     {
  9.         Tags { "Queue"="Transparent" "RenderType"="Transparent" }
  10.  
  11.         Blend SrcAlpha OneMinusSrcAlpha
  12.         Pass
  13.         {
  14.             CGPROGRAM
  15.             #pragma vertex vert
  16.             #pragma fragment frag      
  17.             #include "UnityCG.cginc"
  18.  
  19.             struct v2f
  20.             {
  21.                 float4 pos : SV_POSITION;
  22.                 float2 uv : TEXCOORD0;
  23.             };
  24.  
  25.             sampler2D _MainTex;
  26.             float4 _MainTex_ST;
  27.            
  28.             v2f vert (appdata_base v)
  29.             {
  30.                 v2f o;
  31.                 o.pos = mul(UNITY_MATRIX_P,
  32.                 mul(UNITY_MATRIX_MV, float4(0, 0, 0, 1)) + float4(v.vertex.x, v.vertex.y, 0, 0)) ;
  33.                 o.uv = TRANSFORM_TEX(v.texcoord, _MainTex);
  34.                 return o;
  35.             }
  36.            
  37.             fixed4 frag (v2f i) : SV_Target
  38.             {
  39.                 fixed4 col = tex2D(_MainTex, i.uv);
  40.                 return col;
  41.             }
  42.             ENDCG
  43.         }
  44.     }
  45. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top