Created
September 18, 2019 08:55
-
-
Save CarlLee/e57276a2f72c0f35c58de474ed570ce6 to your computer and use it in GitHub Desktop.
Unity See through shader
This file contains 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/SeeThrough" | |
{ | |
Properties | |
{ | |
_Color ("Color", Color) = (1.0, 1.0, 1.0, 1.0) | |
} | |
SubShader | |
{ | |
Tags { "RenderType"="Transparent" "Queue" = "Transparent" } | |
LOD 100 | |
Pass | |
{ | |
Blend SrcAlpha OneMinusSrcAlpha | |
Cull Off | |
CGPROGRAM | |
#pragma vertex vert | |
#pragma fragment frag | |
// make fog work | |
#pragma multi_compile_fog | |
#include "UnityCG.cginc" | |
struct appdata | |
{ | |
float4 vertex : POSITION; | |
}; | |
struct v2f | |
{ | |
float4 vertex : SV_POSITION; | |
}; | |
float4 _Color; | |
v2f vert (appdata v) | |
{ | |
v2f o; | |
o.vertex = UnityObjectToClipPos(v.vertex); | |
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