Skip to content

Instantly share code, notes, and snippets.

@lucabelluccini
Last active August 29, 2015 14:01
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 lucabelluccini/4fecfd1bd80d161ac62b to your computer and use it in GitHub Desktop.
Save lucabelluccini/4fecfd1bd80d161ac62b to your computer and use it in GitHub Desktop.
Self Lit, Alpha channel (global), Texture mapped to UV, Mask mapped to UV2
Shader "Custom/Shader4S" {
Properties {
_MainTex ("Texture", 2D) = "white" { }
_Mask ("Mask", 2D) = "white" {}
_Alpha ("Alpha", Range(0.0,1.0)) = 1.0
}
SubShader {
Tags { Queue = Transparent }
ZWrite Off
Blend SrcAlpha OneMinusSrcAlpha
Pass {
BindChannels {
Bind "Vertex", vertex
Bind "texcoord", texcoord1
Bind "texcoord1", texcoord0
}
SetTexture [_Mask] {combine texture}
SetTexture[_MainTex] {
combine texture, previous * texture
constantColor(0,0,0,[_Alpha])
combine texture, previous * constant
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment