Created
March 30, 2017 05:05
-
-
Save hadashiA/c8876f9823bacfd2f7699ab46f012b52 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shader "ShaderDrill/0327/Subtractive" | |
{ | |
Properties { | |
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {} | |
_Color ("Tint", Color) = (1,1,1,1) | |
} | |
SubShader | |
{ | |
Tags | |
{ | |
"Queue"="Transparent" | |
"IgnoreProjector"="True" | |
"RenderType"="Opaque" | |
} | |
Cull Back | |
Blend SrcAlpha One | |
BlendOp RevSub | |
Pass | |
{ | |
CGPROGRAM | |
#pragma vertex vert | |
#pragma fragment frag | |
#pragma target 2.0 | |
#include "UnityCG.cginc" | |
struct appdata_t | |
{ | |
float4 pos : POSITION; | |
float2 uv : TEXCOORD0; | |
}; | |
struct v2f | |
{ | |
float4 pos : SV_POSITION; | |
half2 uv : TEXCOORD0; | |
}; | |
sampler2D _MainTex; | |
sampler2D _MaskTex; | |
float4 _MainTex_ST; | |
fixed4 _Color; | |
v2f vert(appdata_t v) | |
{ | |
v2f o; | |
o.pos = UnityObjectToClipPos(v.pos); | |
o.uv = TRANSFORM_TEX(v.uv, _MainTex); | |
return o; | |
} | |
fixed4 frag(v2f i) : SV_Target | |
{ | |
return tex2D(_MainTex, i.uv) * _Color; | |
} | |
ENDCG | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment