Hi,
I am trying to do a shader to blend two lightmap with a slider. I will use that shader to make a daylight room and a night room. I'll change the slider's state and it will goes ok for me.
But i confused with my shader. I am trying to fix it but i cant. Got problem with my second lightmap. Slider working well but lightmap completely filling my first lightmap and diffuse. Can someone check my shader? What is wrong with it? I really need a hand to fix that :(
Shader "--BULENT--/Combiner"
{
Properties
{
_Color ("Color", Color) = (0,0,1)
_SpecColor ("Spec Color", Color) = (1,1,1,1)
_Shininess ("Shininess", Range (0.01, 1)) = 0.7
_MainTex ("Texture", 2D) = "" {}
_LightMap ("Lightmap", 2D) = "" {}
_NightMap ("Nightmap", 2D) = "" {}
_Blend ("Blend", Range(0.0,1.0)) = 0.0
}
Category
{
SubShader
{
BindChannels
{
Bind "vertex", vertex
Bind "Texcoord", Texcoord0
Bind "Texcoord1", Texcoord1
Bind "Texcoord1", Texcoord2
}
Material
{
Diffuse [_Color]
Specular [_SpecColor]
Ambient [_Color]
Shininess [_Shininess]
Emission [_LightMap]
Emission [_NightMap]
}
Lighting On
SeparateSpecular On
Pass
{
SetTexture[_MainTex]
{
constantColor [_Color]
Combine texture * constant
}
SetTexture[_LightMap]
{
Combine texture * previous
}
}
Pass
{
SetTexture[_MainTex]
{
constantColor [_Color]
Combine texture * constant
}
SetTexture[_NightMap]
{
ConstantColor (0,0,0, [_Blend])
combine texture lerp(constant) previous
}
}
}
}
}