Advertisement
tonynogo

Step 02 - Color

Jul 4th, 2017
7,194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Shader "Unlit/Step 2 - Color"
  2. {
  3.     Properties
  4.     {
  5.         _Color ("Color", color) = (1.0, 1.0, 1.0, 1.0)
  6.     }
  7.     SubShader
  8.     {
  9.         Tags { "RenderType"="Opaque" }
  10.  
  11.         Pass
  12.         {
  13.             CGPROGRAM
  14.             #pragma vertex vert
  15.             #pragma fragment frag
  16.  
  17.             struct appdata {
  18.                 float4 vertex : POSITION;
  19.             };
  20.  
  21.             struct v2f {
  22.                 float4 pos : SV_POSITION;
  23.             };
  24.  
  25.             v2f vert(appdata v) {
  26.                 v2f o;
  27.                 o.pos = mul(UNITY_MATRIX_MVP, v.vertex);
  28.                 return o;
  29.             }
  30.  
  31.             // Color from the property section
  32.             float4 _Color;
  33.  
  34.             float4 frag(v2f i) : SV_Target {
  35.                 return _Color;
  36.             }
  37.  
  38.             ENDCG
  39.         }
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement