Shader with transparency on the iPhone - unusable?

I can’t get any shader with transparency to work on the iPhone, I get flickering artifacts , like randomly transparent faces.
when the camera is stationery the “missing faces” are also stationery , but when the camera starts moving they blink like crazy.
This happens mostly on small faces with all the transparent shaders that I could find - alpha blending and alpha test.
When I tried to use an orthographic camera this almost never happened, but with a perspective camera it’s all over the place.
This dosent happend inside the editor at all, only inside the iPhone.
help please!

  • Resolved : I had to resave the scene under a different name and thats it… there goes 4 hours for nothing…at least it’s working now

I take it back… it’s not resolved - this problem only occurs when the scene is not the first to load - there is an opening scene loading it.
When the problematic scene is the first to load the problem is gone.
This is getting REALLY frustrating.
Any ideas why this could be happening?

‘Transparent>Diffuse’ works in our scenes (even loaded scenes). We are using it on large, flat faces – maybe it is something to do with transparency on small faces.

Thanks,
I finally figured it out - it was because I was using GUIx in the first scene.
when I removed it, it all started working again.
:smile:

hi,

have problems with transparent shader if they are back to back. Sometimes they are completely invisible or the object which is behind the first object is always visible.

have somebody the same problem ? … i think its some sorting problem

It’s indeed a sorting problem. Have a look at this thread to see one way of dealing with this issue:

http://forum.unity3d.com/viewtopic.php?p=106671&highlight=#106671

ok but if i have 3 or 4 objects ? … if i change the shader i can not add the combine children script because the objects will have different materials and therefore combine children will have no effect

Well, semi-transparent geometry is always tricky (in any engine). To get it working perfectly might be impossible at the moment, but one method I can think of, and to be honest haven’t tested, is to dynamically change the rendering queues of all your semi-transparent objects on the fly.

So, do some distance test from the camera to each mesh and use renderer.material.renderQueue to place the mesh in the proper render queue based upon its distance from the camera. But to be honest, trying to layer 3-4 semi-transparent objects on the iPhone seems unrealistic in the first place unless the scene is extremely simple.

Ethan

There was a bug with transparency sorting which is fixed in 1.0.1. Take a look it could solve your problem.

hmm i have a scene with simple planes. For example grass, flowers and mushrooms. Sometimes i put them in front and sometimes they are in back. So make a script for them is not a good solution i think.

All uses the alpha/diffuse shader. So is there no possibility to render them in the right order ? i really need this for my game. I read in forum to use the Vegation Two Pass lit shader but thats to expensive for the iphone.
What is the solution? :frowning:

1.0.1 should solve this.

no, have the same problem :frowning:

Note that sorting criteria for transparent object is renderQueue index then distance from center of bounding box to camera. Check that bounding boxes of your transparent geometries do not overlap too much.