NOTE: As my project deadline is sneaking up on me, I have now made this a paid project for anyone who can fix the problem. Please find the paid version here: http://forum.unity3d.com/threads/168...23#post1150723
Hey all,
I am working on a Decal shader (based on the Projector Light shader), which will project a decal onto a surface. Overall it is working great - it displays with proper color on the objects I want, in the way I want, and it even takes the Ambient Light into consideration. However, I cannot seem to get it to take Point Lights or any other kind of non-ambient light into consideration.
This image shows the decal projectors functioning:
Here is the shader code for the above projectors:
Shader "Projector/Decal"
{
Properties
{
_Color ("Main Color", Color) = (1,1,1,1)
_SpecColor ("Spec Color", Color) = (1,1,1,1)
_Emission ("Emmisive Color", Color) = (0,0,0,0)
_Shininess ("Shininess", Range (0.01, 1)) = 0.7
_ShadowTex ("Cookie", 2D) = "" { TexGen ObjectLinear }
_Falloff ("Cookie", 2D) = "" { TexGen ObjectLinear }
}
Subshader
{
Pass
{
ZWrite off
Fog { Color (0, 0, 0) }
Color [_Color]
ColorMask RGB
Blend OneMinusSrcAlpha SrcAlpha
Offset -1, -1
Material
{
Diffuse [_Color]
Ambient [_Color]
Shininess [_Shininess]
Specular [_SpecColor]
Emission [_Emission]
}
Lighting On
SeparateSpecular On
SetTexture [_ShadowTex]
{
combine texture * primary , ONE - texture
Matrix [_Projector]
}
}
}
}
How can I modify this shader so that it does take local lighting (Point Lights and such) into consideration?
Thank you!