Skip to content

Instantly share code, notes, and snippets.

@GOROman
Last active August 24, 2017 10:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GOROman/2cd61ae9eab52cadbae6 to your computer and use it in GitHub Desktop.
Save GOROman/2cd61ae9eab52cadbae6 to your computer and use it in GitHub Desktop.
かまいたちの夜シェーダー
Shader "Custom/Kamaitachi" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
}
SubShader {
Tags { "Queue" = "Transparent" }
Stencil {
Ref 1
Comp always
Pass replace
}
ColorMask 0
// ZWrite Off
// Cull Off
CGPROGRAM
#pragma surface surf Lambert
sampler2D _MainTex;
struct Input {
float2 uv_MainTex;
};
void surf (Input IN, inout SurfaceOutput o) {
o.Alpha = 0;
}
ENDCG
}
FallBack "Diffuse"
}
Shader "Custom/Mask" {
Properties {
_Color ("Main Color", Color) = (0,0,1,0.5)
_MainTex ("Base (RGB)", 2D) = "white" {}
}
SubShader {
Tags { "Queue" = "Transparent" }
Stencil {
Ref 1
Comp equal
}
Pass {
Blend SrcAlpha OneMinusSrcAlpha
Color [_Color]
Lighting Off
// SetTexture [_MainTex] {
// combine texture * primary double, texture * primary
// }
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment