- Home /
Question by
michellynitecki · Mar 27, 2019 at 01:49 AM ·
shader
shader blocking the color component
Can someone help me? I already tried to set via script more only that it does not accept because of the shader,What can it be? my shader
Shader "Custom/AlphaIsBlack" {
Properties {
_Color ("Color Tint", Color) = (1,1,1,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
_Threshold ("threshold", Range(0,1)) = 0.5
_Softness ("softness", Range(0,0.5)) = 0.0
}
SubShader {
Tags { "RenderType"="Transparent" "Queue"="Transparent" }
CGPROGRAM
#pragma surface surf Lambert alpha
sampler2D _MainTex;
float _Threshold;
float _Softness;
fixed4 _Color;
struct Input {
float2 uv_MainTex;
};
void surf (Input IN, inout SurfaceOutput o) {
o.Albedo = _Color.rgb;
o.Emission = _Color.rgb;
o.Alpha = _Color.a;
half4 c = tex2D (_MainTex, IN.uv_MainTex);
o.Albedo = c.rgb;
o.Alpha = smoothstep(_Threshold, _Threshold + _Softness,
0.333 * (c.r + c.g + c.b));
}
ENDCG
}
FallBack "Diffuse"
}
Comment