Advertisement
axoila

properties.shader

Mar 23rd, 2018
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Shader "Tutorial/02_Properties"{
  2.     Properties{
  3.         _Color ("Color", Color) = (0, 0, 0, 1)
  4.     }
  5.  
  6.     SubShader{
  7.         Tags{ "RenderType"="Opaque" "Queue"="Geometry"}
  8.  
  9.         Pass{
  10.             CGPROGRAM
  11.             #include "UnityCG.cginc"
  12.  
  13.             #pragma vertex vert
  14.             #pragma fragment frag
  15.  
  16.             fixed4 _Color;
  17.  
  18.             struct appdata{
  19.                 float4 vertex : POSITION;
  20.             };
  21.  
  22.             struct v2f{
  23.                 float4 position : SV_POSITION;
  24.             };
  25.  
  26.             v2f vert(appdata v){
  27.                 v2f o;
  28.                 o.position = UnityObjectToClipPos(v.vertex);
  29.                 return o;
  30.             }
  31.  
  32.             fixed4 frag(v2f i) : SV_TARGET{
  33.                 return _Color;
  34.             }
  35.  
  36.             ENDCG
  37.         }
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement