Skip to content

Instantly share code, notes, and snippets.

@miguel12345
Created July 10, 2015 16:48
Show Gist options
  • Select an option

  • Save miguel12345/dffb59db65bf744fbae3 to your computer and use it in GitHub Desktop.

Select an option

Save miguel12345/dffb59db65bf744fbae3 to your computer and use it in GitHub Desktop.
Shader "Custom/SeeThrough" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
_NormalColor ("Normal Color", Color) = (1.0,0.0,0.0)
_SeeThroughColor ("See-trough Color", Color) = (0.0,1.0,0.0)
}
SubShader {
Tags { "Queue"="Overlay" }
LOD 200
Cull Back
CGPROGRAM
#pragma surface surf Lambert
sampler2D _MainTex;
half3 _NormalColor;
struct Input {
float2 uv_MainTex;
};
void surf (Input IN, inout SurfaceOutput o) {
half4 c = tex2D (_MainTex, IN.uv_MainTex);
o.Albedo = _NormalColor;
o.Alpha = c.a;
}
ENDCG
Cull Back
ZTest Greater
CGPROGRAM
#pragma surface surf Lambert
sampler2D _MainTex;
half3 _SeeThroughColor;
struct Input {
float2 uv_MainTex;
};
void surf (Input IN, inout SurfaceOutput o) {
half4 c = tex2D (_MainTex, IN.uv_MainTex);
o.Albedo = _SeeThroughColor;
o.Alpha = c.a;
}
ENDCG
}
FallBack "Diffuse"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment