Hi!!
I’m beginner in shaders… I’m trying to put a shadow in my shader. He will be on static objects and I cannot use lightmap.
I got to cast shadows adding fallback and I’ve tried everything to make the model also receives shadows. Follow the code below, if anyone can help me would be very grateful. ![]()
Shader "stand colors" {
Properties {
_Emission ("Emissive Color", Color) = (0,0,0,1)
_Correction ("Correction", Color) = (1,1,1,1)
_SpecColor ("Spec Color", Color) = (1,1,1,1)
_MaskColor1 ("MaskColor1", Color ) = (1,1,1,1)
_MaskColor2 ("MaskColor2", Color ) = (1,1,1,1)
_MainTex ("Texture", 2D) = ""
_Mask1 ("Mask1", 2D) = ""
_Mask2 ("Mask2", 2D) = ""
}
SubShader {
Blend SrcAlpha OneMinusSrcAlpha
Pass {
Material {
Diffuse [_Correction]
Specular [_SpecColor]
Emission [_Emission]
}
Lighting On
SeparateSpecular On
SetTexture[_MainTex]{
constantColor [_Correction]
Combine texture * constant
}
}
Pass{
AlphaTest Greater 0.5
Blend DstColor SrcColor
SetTexture[_Mask1] {
constantColor [_MaskColor1]
Combine texture * constant
}
}
Pass{
AlphaTest Greater 0.5
Blend DstColor SrcColor
SetTexture[_Mask2] {
constantColor [_MaskColor2]
Combine texture * constant
}
}
}
Fallback "Diffuse"
}