We’ve been using a GUI atlas for our current project and recently the alpha blending shader has stopped working the way it was a few builds back. I have attached a screen of the issue. If anyone is able to help I’d be very grateful. We have a deadline tomorrow…
Doesn’t appear to be a very good shader for the job, though I don’t know all that you need. You need to move the buttons into a later queue than the background image; the rendering order of triangles is random, so they can’t use the same mesh.
Thanks Jessy. The background image is actually just a fill (no image used). I think, though, that all of the GUI elements are using a single mesh. Sounds like that may be our problem.
By “background image”, I meant the brown horizontal stuff behind the round thingies. Also, I meant they can’t use the same mesh with that shader. You can do it with a “decal”-type shader though.
That may have contributed (though it’s not actually sorting anything, as happens per-object in the higher rendering queues). But it’s up to chance. Like I said, the order was always unpredictable. (I’m sure it wasn’t actually “random”, but close enough, to a human, and not a GPU.) In my experience, you tend to get the same results frequently, which can make you think that you’re safe, but you’re not. It used to be that an easy way to check for this, was to throw things into Unity or Unity iPhone, because this kind of rendering almost always behaved differently in each app. Nowadays, I’m not sure if there’s a similar trick. Preparing for the worst, even if you never see it yourself, is generally a good idea when you’re using alpha blending. Assume that your triangles and objects are going to render in a stupid order, and safeguard yourself against it.