Skip to content

Instantly share code, notes, and snippets.

@unitycoder
Created March 15, 2018 05:12
Show Gist options
  • Select an option

  • Save unitycoder/1dd558e1fbdd39617fa88508d9f2fc2f to your computer and use it in GitHub Desktop.

Select an option

Save unitycoder/1dd558e1fbdd39617fa88508d9f2fc2f to your computer and use it in GitHub Desktop.
Invert Blend Shader Test
Shader "Unlit/NegTest"
{
Properties
{
// _MainTex ("Texture", 2D) = "white" {}
_Color ("Color", Color) = (1,0,0,1)
}
SubShader
{
Tags { "Queue"="Transparent" "RenderType"="Transparent" "IgnoreProjector"="True" }
LOD 100
// blend mode
Blend OneMinusDstColor Zero
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
// sampler2D _MainTex;
float4 _MainTex_ST;
float4 _Color;
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
return o;
}
fixed4 frag (v2f i) : SV_Target
{
return _Color;
}
ENDCG
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment