- Home /
Transparent Self-Illumin shaders?
Hi there! So I need to know if any of the self-illumin shaders allows to make the objects transparent. I'm trying to make a cloaking device like effect, and so I would need to give the information that his ship is cloaked, while allowing the player to see it...
Any ideas?
Thanks in advance...
Answer by Wolfram · Jan 10, 2013 at 06:22 PM
The Unity builtin shaders reserve the alpha channel for the gloss map, that's the main reason there are no builtin transparent equivalents.
If you don't need a gloss map, and also don't really use the illumination map (except to mark the whole ship as "being there" by assigning a white texture (or none at all)), you can just use the builtin Unlit/Transparent shader.
Otherwise you'd have to write or find a shader which has alpha, gloss, and/or illumination as separate textures.
Well, I'm needing all those both the gloss and the illumitation map... As well the alpha...
Answer by Meltdown · Jan 10, 2013 at 06:27 PM
You can use this shader...
Shader "Unlit/AlphaSelfIllum" {
Properties {
_Color ("Color Tint", Color) = (1,1,1,1)
_MainTex ("SelfIllum Color (RGB) Alpha (A)", 2D) = "white"
}
Category {
Lighting Off
ZWrite Off
Cull Back
Blend SrcAlpha OneMinusSrcAlpha
Tags {Queue=Transparent}
SubShader {
Pass {
SetTexture [_MainTex] {
constantColor [_Color]
Combine Texture * constant, Texture * constant
}
}
}
}
}
The builtin "Unlit/Transparent" shader does the same, except that it's not tintable.
The ideal (if you ignore the lack of Gloss, that is) would be having a similar shader, but with a alpha cutoff float, where 1 would be totally oppacc and 0 would be invisible...