Skip to content

Instantly share code, notes, and snippets.

@TachibanaKoki
TachibanaKoki / StencilOutlinePostEffect.shader
Created September 17, 2018 06:53
StencilOutlinePostEffect.shader
Shader "StencilOutlinePostEffect"
{
Properties
{
_OutlineColor("OutlineColor", Color) = (1, 1, 1, 1)
}
SubShader
{
Cull Off ZWrite Off ZTest Always
Pass
{
Stencil
{
Ref 2
Comp always
Pass replace
}
Cull Back
Pass
{
Stencil
{
Ref 1
Comp always
Pass replace
}
Cull Front
Shader "Custom/StencilOutline" {
Properties
{
_OutlineWidth("Outline Width", float) = 0.1
}
SubShader
{
Tags{ "RenderType" = "Transparent" "Queue" = "Transparent" }
Pass