I want to make a semi transparent mesh, if I put the transparent diffuse shader, will that render correct on the iphone?
Yes but you will see the insides of the mesh if you do that, to fix that theres another shader on the wiki that stops you form seeing the inside I use it and its great, here it is.
Shader "Transparent/VertexLit with Z" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
}
SubShader {
Tags {"RenderType"="Transparent" "Queue"="Transparent"}
// Render into depth buffer only
Pass {
ColorMask 0
}
// Render normally
Pass {
ZWrite Off
Blend SrcAlpha OneMinusSrcAlpha
ColorMask RGB
Material {
Diffuse [_Color]
Ambient [_Color]
}
Lighting On
SetTexture [_MainTex] {
Combine texture * primary DOUBLE, texture * primary
}
}
}
}
its an expensive shader.
Hmm I see, then I should leave semi transparent things to later stages, when I can do tests.
One question, what about adding gui on the scene? Don’t I need the transparent shader to do that?
pretty surely you will unless you do it all in ragespline or with pure meshes that only contain geometry where textures are
for transparency ie png style images, use the mobile/particles/alpha shader. It’s fast and flexible.
If you need to make things 2 sided in a shader, duplicate the shader, rename it in the shader and filename, and add Cull Off etc. Generally fiddling like that is best, and easy.