Problem with shaders semi-transparency

Hi, guys this is my object with the standard shader:

alt text

These are the material settings, as you can see it has reflections, specular and emission:

alt text

This is what happens when I try to switch to Fade or Transparent on the Standard Shader, I see the inside parts of the object.

alt text

I tried this shader here http://wiki.unity3d.com/index.php/Transparent_Alpha_Vertex_Lit_With_Z (Transparent Alpha With Specular), this is the result: (the object looks much different to what it is in the first picture - this is with alpha=1, i.e. opaque…

alt text

However that shader does enable me to control the transparency with z-buffer and this is the result:

alt text

However the object looks very different from the first picture, even when alpha = 1.
I don’t have any knowledge about shaders, please help me achieve the first object with real transparency as I am struggling with this task for a week now. Thanks!

The Standard shader by default disables “_ZWrite”. You can try using the debug inspector to change it from 0 to 1, however the normal inspector will overwrite the value as soon as you view the material in the inspector. The easiest solution is probably to just set the “_ZWrite” property via a script at runtime:

public Material mat;
void Start()
{
    mat.SetFloat("_ZWrite", 1);
}

Note that when testing in the editor and you select the object / material while in playmode the setting would be changed back by the inspector. For in editor testing you may want to set the value in Update. In a build it would be enough to set it once.

However keep in mind that enabling z writing for transparent shader might have unexpected effects when mixed with other transparent objects. Transparent objects are z sorted from far to near by Unity. So if a transparent object writes to the z buffer it prevents any drawing behind that object. In most cases this is fine since the objects are drawn from far to near, though there are edge cases like this or this where it’s impossible to sort the objects correctly

Can anyone please assist… I cannot seem to make it work either with other shaders or trying to change the standard shader code