- Home /
Tint an Additive shader
Hi I am using Jessy's additive shader on iOS for the shadow material of my objects. However the shader currently additively blends out the black areas of my texture and I would like my shadow to be black. How can I add a tint color to this shader?
Thanks!
Jessy's shader is as follows:
Shader "Additive Texture" {
Properties {
_MainTex ("Texture", 2D) = ""
}
SubShader {
Tags {Queue = Transparent}
Blend One One
ZWrite Off
Pass {
SetTexture[_MainTex]
}
}
}
Answer by col000r · Feb 07, 2014 at 10:41 AM
Dark colors will never show with an additive shader. Are you sure you're not looking for a multiply shader or an unlit shader with alpha?
Anyway, here's my modification of Jessy's shader that adds a color property that you can use to tint the texture. If you set the color to white the result will be the same as with the above shader, move towards black and you can fade out the texture.
Shader "Additive Texture with Color" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Texture", 2D) = ""
}
SubShader {
Tags {Queue = Transparent}
Blend One One
ZWrite Off
Pass {
SetTexture[_MainTex] {
constantColor [_Color]
Combine texture * constant
}
}
}
}
Your answer
Follow this Question
Related Questions
Tint the visible parts of an Additive texture 0 Answers
Adding tint color variable to shader 1 Answer
surface shader homeworld (space) colorize transparent 1 Answer
Additive particle shader with higher max alpha? 0 Answers
Is additive transparency incompatible with this implementation of falloff transparency? 0 Answers