Unity - Surface Shader
Shader "Custom/Unlit/Hologram" {
Properties {
_Color ("Main Color", Color) = (1,0,1,1)
_MainTex ("Texture RGBA", 2D) = "white" {}
_Alpha("Alpha" ,Range(0,1)) = 0.5
_SpecColor ("Spec Color", Color) = (1,1,1,0)
_Emission ("Emissive Color", Color) = (0,0,0,0)
_Shininess ("Shininess", Range (0.1, 1)) = 0.7
}
Category
{
ZWrite On
ColorMask 0
SubShader
{
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
LOD 200
// extra pass that renders to depth buffer only
Pass
{
Blend SrcAlpha OneMinusSrcAlpha
Material {
Diffuse [_Color]
Ambient [_Color]
Shininess [_Shininess]
Specular [_SpecColor]
Emission [_Emission]
}
Lighting Off
SetTexture [_MainTex]
{
constantColor [_Color]
Combine texture * primary DOUBLE, texture * primary
}
}
CGPROGRAM
#pragma surface surf Lambert alpha
//#include "UnityCG.cginc"
sampler2D _MainTex;
fixed4 _Color;
float _Alpha;
struct Input {
float2 uv_MainTex;
};
void surf (Input IN, inout SurfaceOutput o) {
fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color;
o.Emission = c.rgb;
//o.Alpha = c.a * _Alpha;
o.Alpha = _Alpha;
}
ENDCG
}
}
Fallback "Unlit/Transparent"
}
Properties {
_Color ("Main Color", Color) = (1,0,1,1)
_MainTex ("Texture RGBA", 2D) = "white" {}
_Alpha("Alpha" ,Range(0,1)) = 0.5
_SpecColor ("Spec Color", Color) = (1,1,1,0)
_Emission ("Emissive Color", Color) = (0,0,0,0)
_Shininess ("Shininess", Range (0.1, 1)) = 0.7
}
Category
{
ZWrite On
ColorMask 0
SubShader
{
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
LOD 200
// extra pass that renders to depth buffer only
Pass
{
Blend SrcAlpha OneMinusSrcAlpha
Material {
Diffuse [_Color]
Ambient [_Color]
Shininess [_Shininess]
Specular [_SpecColor]
Emission [_Emission]
}
Lighting Off
SetTexture [_MainTex]
{
constantColor [_Color]
Combine texture * primary DOUBLE, texture * primary
}
}
CGPROGRAM
#pragma surface surf Lambert alpha
//#include "UnityCG.cginc"
sampler2D _MainTex;
fixed4 _Color;
float _Alpha;
struct Input {
float2 uv_MainTex;
};
void surf (Input IN, inout SurfaceOutput o) {
fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color;
o.Emission = c.rgb;
//o.Alpha = c.a * _Alpha;
o.Alpha = _Alpha;
}
ENDCG
}
}
Fallback "Unlit/Transparent"
}
Comments