- Home /
Dashboard Alpha Transparency
Can someone help explain to me a couple things about the "Use Alpha in Dashboard" setting under player settings?
a) How do I use it? When I enable it and set the main cam to "Don't clear flags" the widget just flashes and goes all weird. I also tried setting the background to black with 0% opacity with no luck.
b) Can it be used with OnGUI function objects? I'm trying to create a simple widget to display the current server/player count. I was trying to make the widget so that it functions more like the OnGUI objects are actual widgets instead of an embedded Unity player on the dashboard.
Other Info: I'm running Snow Leopard if that makes a difference. The few threads I've seen about this feature were all created back in 2007 when Unity was still in 1.7.
Thanks in advance.
Answer by Jessy · Jan 11, 2011 at 07:52 AM
As the documentation states, you have to actually set the alpha channel of the rendered image. "Don't Clear" isn't appropriate; you need to ensure that you're writing alpha information for every pixel. "Solid Color" is the easiest way to do it. Notice that the color has four components. The alpha matters, and is actually written. Here's a shader you can use to visualize your alpha information. Unfortunately, you can't render after UnityGUI, so this only applies to all other scene geometry(*)
Shader "Alpha to RGB" {
SubShader { Tags {Queue = Overlay} ZTest Always Blend DstAlpha Zero Pass {Color (1,1,1)} }
}
I don't know what you mean by "more like an actual Mac widget and less of a GUI object inside a Unity widget frame". I don't know what happens with GUI alpha writing presently; I don't like UnityGUI and my skills with it are rusty, so I'll leave you with that info, and let somebody else flesh out this question with information as to whether OnGUI writes to all color channels, or just RGB.
(*) unless UnityGUI only writes to RGB.
Hmm, I tried setting the camera to Solid Color with the background color opacity at 0% with still no luck. I also tried with a cube with a transparent diffuse shader (opacity set to 20% and then 0%) with no change. I dunno... maybe I'm doing something wrong...