I am having problem changing material´s alpha value on my self iluminated shader material, I am able to change the other values of the color ( such as red, green or blue values ) but not the alpha value, this is what I´m trying to do:
this.renderer.material.color = new Color( 1.0f, 1.0f, 1.0f, 0.0f );
By doing that, I expected the material to be totally transparent, but it just ignores the alpha value of 0 that I assigned, this is the shader´s code that I´m using:
Shader "AlphaSelfIllum" {
Properties {
_Color ("Color Tint", Color) = (1,1,1,1)
_MainTex ("SelfIllum Color (RGB) Alpha (A)", 2D) = "white"
}
Category {
Lighting On
ZWrite Off
Cull Back
Blend SrcAlpha OneMinusSrcAlpha
Tags {Queue=Transparent}
SubShader {
Material {
Emission [_Color]
}
Pass {
SetTexture [_MainTex] {
Combine Texture * Primary, Texture * Primary
}
}
}
}
}
I´m totally noob at shader coding, so if anyone could point me in a direction, I would be very thankfull.