Created
March 15, 2018 05:12
-
-
Save unitycoder/1dd558e1fbdd39617fa88508d9f2fc2f to your computer and use it in GitHub Desktop.
Invert Blend Shader Test
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 "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