Sure - here is the shader for the diffuse:
Shader "Composite Shader" {
Properties {
_SkinColor ("Skin Color", Color) = (1,1,1,1)
_HairColor ("Hair Color", Color) = (1,1,1,1)
_EyeColor ("Eye Color", Color) = (1,1,1,1)
_AccessoryColor ("Accessory Color", Color) = (1,1,1,1)
_NoseMouth ("Nose Mouth", 2D) = "white" {}
_Eyes ("Eyes", 2D) = "white" {}
_EyeMask ("Eye Mask", 2D) = "white" {}
_Pupils ("Pupils", 2D) = "white" {}
_Eyebrows ("Eyebrows", 2D) = "white" {}
_Accessory ("Accessory", 2D) = "white" {}
_Hair ("Hair", 2D) = "white" {}
}
SubShader {
Pass {
Color [_SkinColor]
SetTexture[_NoseMouth] { combine texture lerp (texture) previous }
SetTexture[_Eyes] { combine texture lerp (texture) previous }
}
Pass {
Blend SrcAlpha OneMinusSrcAlpha
SetTexture[_EyeMask] { combine texture }
SetTexture[_EyeMask]
SetTexture[_Pupils] {
constantColor[_EyeColor]
combine texture * constant, texture * previous
}
}
Pass {
Blend SrcAlpha OneMinusSrcAlpha
SetTexture[_Eyebrows] {
constantColor [_HairColor]
combine texture * constant
}
}
Pass {
Blend SrcAlpha OneMinusSrcAlpha
SetTexture[_Accessory] {
constantColor [_AccessoryColor]
combine texture * constant
}
}
Pass {
Blend SrcAlpha OneMinusSrcAlpha
SetTexture[_Hair] {
constantColor [_HairColor]
combine texture * constant
}
}
}
}
And the code for the normal
(Note that I’m getting an error if I try to do more than 4 layers in a pass, so I have a second pass here for the last layer . Also note that each of these normal maps are normals with alpha and are not tagged as normal maps in unity)
Shader "Composite Normal Shader" {
Properties {
_NmlColor ("Base Normal Color", Color) = (0.5,0.5,1,1)
_EyesNml ("Eyes", 2D) = "white" {}
_EyebrowsNml ("Eyebrows", 2D) = "white" {}
_AccessoryNml ("Accessory", 2D) = "white" {}
_HairNml ("Hair", 2D) = "white" {}
}
SubShader {
Pass {
Color [_NmlColor]
SetTexture[_EyesNml] { combine texture lerp (texture) previous }
SetTexture[_EyebrowsNml] { combine texture lerp (texture) previous }
SetTexture[_AccessoryNml] { combine texture lerp (texture) previous }
}
Pass {
Blend SrcAlpha OneMinusSrcAlpha
SetTexture[_HairNml] { combine texture }
}
}
}
And here is the error I get when I have that extra layer in one pass:
offset >= 0 && offset+size <= (m_BufferKeys[idx]>>16) && size > 0