- Home /
Shader light fix?
The shader below, is not affected by light how can i fix that? Thank you.
Shader "Custom/TextureMask" { Properties { _Color ("Main Color", Color) = (1,1,1,0) _SpecColor ("Spec Color", Color) = (1,1,1,1) _Emission ("Emmisive Color", Color) = (0,0,0,0) _Shininess ("Shininess", Range (0.01, 1)) = 0.7 _MainTex ("Base (RGB) Transparency (A)", 2D) = "white" {} _Mask ("Culling Mask", 2D) = "white" {} _Cutoff ("Alpha Mask", Range (1,0)) = 0.0
} SubShader { Material { Diffuse [_Color] Ambient [_Color] Shininess [_Shininess] Specular [_SpecColor] Emission [_Emission] }
Lighting On
SeparateSpecular On
Tags {"Queue"="Transparent"}
AlphaTest LEqual [_Cutoff]
Pass
{
SetTexture [_Mask] {combine texture}
SetTexture [_MainTex] {combine texture + Primary , previous}
}
}
}
Comment
Answer by Jessy · Mar 22, 2011 at 02:54 PM
It's affected by lighting. You don't add lighting, though. You multiply it. (And typically you use the Double keyword, too.)
Your answer
![](https://koobas.hobune.stream/wayback/20220613114154im_/https://answers.unity.com/themes/thub/images/avi.jpg)