x


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}
      }
   }

}
more ▼

asked Mar 22 '11 at 02:39 PM

Kourosh gravatar image

Kourosh
1.5k 47 53 65

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

It's affected by lighting. You don't add lighting, though. You multiply it. (And typically you use the Double keyword, too.)

more ▼

answered Mar 22 '11 at 02:54 PM

Jessy gravatar image

Jessy
15.6k 72 95 196

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2199
x1655
x425
x65

asked: Mar 22 '11 at 02:39 PM

Seen: 991 times

Last Updated: Mar 22 '11 at 02:39 PM