Hi.
I’m totally noob about shaders and trying to combine in a material 4 textures each one with it’s own color. The goal for this is making a customizable outfit for the players so they can choose their own cloth design pattern in any color. Achieved to combine the 4 textures ( 2 for upper body 2 for lower body: base coloured texture and coloured texture pattern) and it works well but looks so plain, unlit…
It’s the first time I’m messing around with shaders and I can´t make it react to light. The simplest diffuse would be enough, no need for complex output. Any clue in how to achieve this? Code below.
Thanks a lot in advance.
Have a nice day!
Shader "Combined + Diffuse" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
_BlendTex ("Alpha Blended (RGBA)", 2D) = "white" {}
_BlendTex2 ("Alpha Blended (RGBA) 2", 2D) = "white" {}
_BlendTex3 ("Alpha Blended (RGBA) 3", 2D) = "white" {}
_Color ("M1", Color) = (1,1,1)
_Color1 ("M2", Color) = (1,1,1)
_Color2 ("C1", Color) = (1,1,1)
_Color3 ("C2", Color) = (1,1,1)
}
SubShader {
Pass {
SetTexture [_MainTex] {
constantColor [_Color]
combine constant lerp(texture) previous
}
SetTexture [_MainTex] {
combine previous * texture
}
SetTexture [_BlendTex] {
constantColor [_Color1]
combine constant lerp(texture) previous
}
SetTexture[_BlendTex]{
combine previous * texture
}
SetTexture [_BlendTex2] {
constantColor [_Color2]
combine constant lerp(texture) previous
}
SetTexture[_BlendTex2]{
combine previous * texture
}
SetTexture [_BlendTex3] {
constantColor [_Color3]
combine constant lerp(texture) previous
}
SetTexture[_BlendTex3]{
combine previous * texture
}
}
}
FallBack "Diffuse"
}
Edited: A screenshot because I can feel I’m not explaining this correctly. Yellow is the main color of the upper outfit and blue is the pattern color. Orange is the main color of the lower outfit and green is the pattern color.