Clear to transparent, but still respect tex alpha?

The effect I'm trying to achieve is a renderTexture with transparent regions applied as a GUITexture over a scene (there are explicit reasons for making it a GUItexture rather than a render window, which I won't get into).

So my main scene camera does its thing fine- clears to whatever, renders the scene, outputs, cool.

My to-texture camera... if I set it to clear to an opaque color, the remaining unrendered/transparent regions of the image come out solid and completely obliterate the main camera render once applied in the GUI. As expected. However, when I clear to a low- or 0-alpha color, anything rendered with a transparent shader seems to get premultiplied by the clear alpha, even in its opaque regions. I understand the generic transparency math needs to factor in the alpha of anything already in the buffer as it blends new alpha'd content in, but shouldn't alphas ultimately ~add~ when layering transparent stuff into the buffer rather than ~multiply~ (e.g. color=fragColor*fragAlpha + bufColor*(bufAlpha); alpha=fragAlpha+bufAlpha)? Is there any quick way to get it to reflect a more intuitive behavior when rendering a high-opacity object over [empty] (some setting I'm overlooking somewhere...) or am I looking at hacking my own shader here?

After much research on ShaderLab and gnashing of teeth, I noticed one innocuous little line that seems to be the source of my grief. All the stock transparency shaders include "ColorMask RGB" in the head, which basically says "compute everything, but don't actually write the resultant alpha to the buffer, just write the resultant color." Which strikes me as a little odd, since the calculations go on to actively process alphas differently from colors, and return a perfectly acceptable alpha value. C'est la vie...

Anyway, if you want to roll your own shader which will ~properly~ render at-all-opaque transparent-shaded objects to a transparent-cleared buffer, just remove the offending line:

Category {
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
LOD 200
Alphatest Greater 0
ZWrite Off
//ColorMask RGB

... }

And voila. Alphas get written as well, and everything cooperates so long as every transparent object in the scene uses the modified shader. Now, this may not be an all-cases solution, there's probably a perfectly legit reason the stock shaders mask the alpha write, but any such artifacts aren't showing up in my use case, so I'm happy.

Update for Unity 3: The new surface shader system will result in any of your nice corrected-as-above Unity 2.x shaders getting clobbered down to their fallbacks if you try to import them. And similarly, none of the stock Transparent or Cutout shaders seem to like rendering to a transparent buffer, and rendering an opaque-shaded object into the buffer followed by transparent-shaded objects will punch holes in the opacity, likely because the initial opaque object still doesn't flag pixels as alpha-critical. Fortunately, the fix to actually write partially-opaque alpha values to an initially transparent image buffer is even less technical in the new system. Most new transparent shaders start with something like

SubShader {
    Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
    LOD 300

CGPROGRAM
#pragma surface surf Lambert alpha

Relative to the 2.x versions, many of the parameters including our ColorMask are simply omitted, and the #pragma directives are much more sparse. The real key appears to be the #pragma alpha as documented on http://unity3d.com/support/documentation/Components/SL-SurfaceShaders.html . The behavior of "alpha" appears to be to alpha-blend the color of the incoming fragment onto the image buffer and then multiply the alpha of the buffer with the alpha of the fragment (opaque textures rendered with "alpha" will not show up opaque when rendered to a transparent buffer, but transparent objects will punch holes in any opaque content in the buffer). "decal:blend", however, seems to intelligently add the alpha of the fragment to the alpha of the buffer. So just make that tweak and it ought to work. For good measure I've added back and repurposed our friend ColorMask to just be sure all 4 channels are being written.

SubShader {
    Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
    LOD 300
    ColorMask RGBA

CGPROGRAM
#pragma surface surf Lambert decal:blend