I've got a quick question.
I've tried changing the alpha value of the background to make my GUI semi-transparent, but it didn't work. Has anyone tried this before? Is the camera supposed to ignore this alpha value?
asked Aug 27 '10 at 07:29 AM
An alpha value does not necessarily equate to transparency; it's just something that it's used for a lot. The camera does indeed use whatever you set as its background color's alpha value. Here's a shader you can use to prove this to yourself (the alpha value of the Scene View camera's background is black, so test this in the Game View):
You can't use this for transparency (blending). Blending would require a shader, and this is just a solid color, not something you can manipulate the blending of. Most likely, what you want to do is set your camera to "Depth Only", and use a transparent shader on your GUI items.
Here's something I use to make a solid-colored transparent overlay that goes behind GUI buttons, but blends into another camera (it "darkens" the main camera for the pause menu). It might be the kind of thing you're looking for, but may need to be tweaked for your purposes. My buttons are non-blended rectangles, for example. You'd need a slight alteration if your buttons need transparency, such as for rounded corners.
Just a quick one for no background
mySecondaryCamera.clearFlags = CameraClearFlags.Nothing;
This will leave colors and depth buffer from the previous frame or whatever was displayed before
answered Feb 15 '11 at 04:43 PM