Hi folks,
Sorry if this gets posted all the time, but I couldn’t find an answer specific to this.
I’ve created a quick shader based on the Standard Specular as I needed 2 sided rendering, but it’s not receiving shadows for some reason. Any ideas what I’m missing?
Shader "Standard (2 Sided)" {
Properties {
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Albedo (RGBA)", 2D) = "white" {}
_Glossiness ("Smoothness", Range(0,1)) = 0.5
_Specular ("Specular Color", Color) = (0,0,0)
_Cutoff ("Cutoff", Range(0,1)) = 0.5
}
SubShader {
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="TransparentCutout"}
LOD 200
Blend SrcAlpha OneMinusSrcAlpha
Cull Off
CGPROGRAM
#pragma surface surf StandardSpecular alpha:fade fullforwardshadows
#pragma target 3.0
sampler2D _MainTex;
struct Input {
float2 uv_MainTex;
};
half _Glossiness;
fixed3 _Specular;
float _Cutoff;
fixed4 _Color;
void surf (Input IN, inout SurfaceOutputStandardSpecular o) {
// Albedo comes from a texture tinted by color
fixed4 c = tex2D (_MainTex, IN.uv_MainTex);
o.Albedo = c.rgb;
// Metallic and smoothness come from slider variables
if (c.a > _Cutoff) {
o.Alpha = c.a;
o.Specular = _Specular;
o.Smoothness = _Glossiness;
}
else
{
o.Alpha = 0;
}
}
ENDCG
}
FallBack "Standard"
}
Thanks!