GeeItSomeLaldy

Unity-Nodraw.shader

Aug 13th, 2019 (edited)
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.01 KB | None | 0 0
  1. Shader "Unlit/NoDraw"
  2. {      
  3. Properties {
  4.    
  5.         _Color ("Main Color", Color) = (1,1,1,1)
  6. }
  7.     SubShader
  8.     {
  9.         Tags { "RenderType"="Opaque" }
  10.         LOD 100
  11.  
  12.         Pass
  13.         {
  14.             CGPROGRAM
  15.             #pragma multi_compile_local __ IN_SCENE_VIEW
  16.             #pragma vertex vert
  17.             #pragma fragment frag
  18.             struct appdata
  19.             {
  20.                 float4 vertex : POSITION;
  21.                 float2 uv : TEXCOORD0;
  22.             };
  23.  
  24.             struct v2f
  25.             {
  26.                 float2 uv : TEXCOORD0;
  27.                 float4 vertex : SV_POSITION;
  28.             };
  29.  
  30.             fixed4 _Color;
  31.  
  32.             v2f vert (appdata v)
  33.             {
  34.                 v2f o;
  35.                 o.vertex = UnityObjectToClipPos(v.vertex);
  36.                 return o;
  37.             }
  38.  
  39.             fixed4 frag (v2f i) : SV_Target
  40.             {
  41.                 #ifdef IN_SCENE_VIEW
  42.                     discard;
  43.                 #endif
  44.                 return _Color;
  45.             }
  46.             ENDCG
  47.         }
  48.     }
  49. }
Add Comment
Please, Sign In to add comment