I’ve been trying to add shadows to a very simple vertex color+texture shader but unfortunately to no avail. The aim is to have a shader that renders a texture which it then blends with custom vertex colors (working) and to receive shadows from other objects in the scene. I’ve tried several approaches but none of them seems to do the trick.
Please find the shader code below (originated from: http://wiki.unity3d.com/index.php/VertexColor):
Shader " Vertex Colored" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
}
SubShader {
Pass {
Material {
Diffuse(1,1,1,1)
Ambient(1,1,1,1)
}
ColorMaterial AmbientAndDiffuse
Lighting On
SetTexture [_MainTex] {
Combine texture * primary, texture * primary
}
SetTexture [_MainTex] {
constantColor [_Color]
Combine previous * constant DOUBLE, previous * constant
}
}
}
Fallback "VertexLit"
}