Skip to content

Instantly share code, notes, and snippets.

@bibinba
Created June 30, 2017 13:54
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 bibinba/ad8877a0ade33a0f2a92ac6087f118b4 to your computer and use it in GitHub Desktop.
Save bibinba/ad8877a0ade33a0f2a92ac6087f118b4 to your computer and use it in GitHub Desktop.
Shader "FX/mmat" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
}
SubShader {
Tags {"Queue"="AlphaTest" "IgnoreProjector"="True" "RenderType"="TransparentCutout"}
LOD 200
Blend Zero SrcColor
CGPROGRAM
#pragma surface surf ShadowOnly alphatest:_Cutoff
fixed4 _Color;
struct Input {
float2 uv_MainTex;
};
inline fixed4 LightingShadowOnly (SurfaceOutput s, fixed3 lightDir, fixed atten)
{
fixed4 c;
c.rgb = s.Albedo*atten;
c.a = s.Alpha;
return c;
}
void surf (Input IN, inout SurfaceOutput o) {
fixed4 c = _Color;
o.Albedo = c.rgb;
o.Alpha = 1;
}
ENDCG
}
Fallback "Transparent/Cutout/VertexLit"
}
@bibinba
Copy link
Author

bibinba commented Jul 9, 2017

影のみを表示する透明マテリアル用シェーダー

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment