Need help to make a color replace shader
Hi guys, I basically know little to nothing about shaders and need one for my game unfortunately. I am trying to replace the white color of my sprite with any color I desire. I was stuck until I found the unity multiply shader which essentially removed all white from my sprite and made it transparent. Although, I dont want it to be transparent, I want it to be another color. You can see what I am trying to achieve here:
See how the armor is transparent? It was originally white, but the multiply shader removes all white. Can anyone help me with what im trying to achieve? I will post the original color multiplier code from unity below. Thanks!
Shader "Mobile/Particles/Multiply" {
Properties {
_MainTex ("Particle Texture", 2D) = "white" {}
}
Category {
Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" }
Blend Zero SrcColor
Cull Off Lighting Off ZWrite Off Fog { Color (1,1,1,1) }
BindChannels {
Bind "Color", color
Bind "Vertex", vertex
Bind "TexCoord", texcoord
}
SubShader {
Pass {
SetTexture [_MainTex] {
combine texture * primary
}
SetTexture [_MainTex] {
constantColor (1,1,1,1)
combine previous lerp (previous) constant
}
}
}
}
}
$$anonymous$$ultiply is not what you want. You would want a normal sprite shader that simply replaces the colour white (or close to) with a colour of your choice. I can help with that, but not right now.
Oh asesome, If you can help please do! There are over 132ppl following this question :)