- Home /
Question by
TyrianRed · Oct 19, 2014 at 10:59 PM ·
shadermaterialtransparentunlit
Unlit alpha shader makes my object transparent?
I am using a shader entitled, "Unlit/UnlitAlphaWithFade", (detailed below) to tint only certain parts of my 3D player while maintaining their flat, spritish look. However, I am having a problem: The shader makes my parts invisible unless a solid part of the character is directly behind it, or I have a solidly shaded material behind the material this shader is on. I have tried to parse some of the shader code, but I'm not experienced here. Can anyone help me out?
Shader "Unlit/UnlitAlphaWithFade"
{
Properties
{
_Color ("Color Tint", Color) = (1,1,1,1)
_MainTex ("Base (RGB) Alpha (A)", 2D) = "white"
}
Category
{
Lighting Off
ZWrite Off
//ZWrite On // uncomment if you have problems like the sprite disappear in some rotations.
Cull back
Blend SrcAlpha OneMinusSrcAlpha
//AlphaTest Greater 0.001 // uncomment if you have problems like the sprites or 3d text have white quads instead of alpha pixels.
Tags {Queue=Transparent}
SubShader
{
Pass
{
SetTexture [_MainTex]
{
ConstantColor [_Color]
Combine Texture * constant
}
}
}
}
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613165452im_/https://answers.unity.com/themes/thub/images/avi.jpg)