Created
September 16, 2015 17:50
-
-
Save rje/4853977a4b13ed8cdaf6 to your computer and use it in GitHub Desktop.
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 "Custom/BasicOcclusionShader" { | |
Properties{ | |
_OcclusionColor("Color", Color) = (1, 0, 1, 1) | |
} | |
SubShader { | |
Tags{ "RenderType" = "Transparent" "Queue" = "Transparent" } | |
Pass { | |
Blend SrcAlpha OneMinusSrcAlpha | |
ZTest Greater | |
ZWrite Off | |
LOD 200 | |
CGPROGRAM | |
#pragma vertex vert | |
#pragma fragment frag | |
#include "UnityCG.cginc" | |
struct appdata_t | |
{ | |
float4 vertex : POSITION; | |
}; | |
struct v2f | |
{ | |
float4 vertex : SV_POSITION; | |
}; | |
fixed4 _OcclusionColor; | |
v2f vert(appdata_t IN) | |
{ | |
v2f OUT; | |
OUT.vertex = mul(UNITY_MATRIX_MVP, IN.vertex); | |
return OUT; | |
} | |
fixed4 frag(v2f IN) : SV_Target | |
{ | |
return _OcclusionColor; | |
} | |
ENDCG | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment