Advertisement
stefanplc

ZTest Shaders/Wall

Jul 30th, 2019
1,056
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Shader "ZTest Shaders/Wall"
  2. {
  3.     Properties
  4.     {
  5.         ObjectColor("Object Color", Color) = (1, 1, 1, 1)
  6.     }
  7.     SubShader
  8.     {
  9.         Tags {
  10.             "Queue" = "Transparent+5"
  11.         }
  12.        
  13.         Pass
  14.         {
  15.  
  16.             ZWrite On
  17.  
  18.             CGPROGRAM
  19.             #pragma vertex vert
  20.             #pragma fragment frag
  21.            
  22.             #include "UnityCG.cginc"
  23.  
  24.             struct appdata
  25.             {
  26.                 float4 vertex : POSITION;
  27.             };
  28.  
  29.             struct v2f
  30.             {
  31.                 fixed4 color : COLOR;
  32.                 float4 vertex : SV_POSITION;
  33.             };
  34.            
  35.             uniform fixed4 ObjectColor;
  36.  
  37.             v2f vert (appdata v)
  38.             {
  39.                 v2f o;
  40.                 o.vertex = UnityObjectToClipPos(v.vertex);
  41.                 o.color = ObjectColor;
  42.                 return o;
  43.             }
  44.            
  45.             fixed4 frag (v2f i) : SV_Target
  46.             {
  47.                 return i.color;
  48.             }
  49.             ENDCG
  50.         }
  51.     }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement