Render Texture With Transparent Regions and Opaque Regions

I’m having the exact problem as described (and apparently solved, in Unity 2.0 and 3.0) here: http://answers.unity3d.com/questions/17588/clear-to-transparent-but-still-respect-tex-alpha.html

My render texture, if rendered using a standard Transparent Diffuse shader, gets entirely multiplied by the camera clear value’s alpha value, even in the opaque regions. The offered solution, however, does nothing to help. Anyone with any ideas?

I am not sure if it’s going to help you at this point in time, but hoping to help others.

In Unity 5 personal free edition:

  1. set camera clear flags to solid
    color
  2. set color’s alpha to 0
  3. set the material shader to “sprite default”

For me this resulted in correct opaque regions on the texture.

I found that the sprite default shader didn’t work so well on 3D objects, but it did set the opaque bits as desired.
So then I tried a two pass approach:

    Material material = gameObject.GetComponent<Renderer>().material;
    material.shader = Shader.Find("Sprites/Default");
    camera.Render();
    material.shader = Shader.Find("Standard");
    camera.Render();

Which gave the effect I wanted