Why is background rendered first?

This page says that background e.g. skybox will be rendered first:
http://docs.unity3d.com/Documentation/Components/SL-SubshaderTags.html
But mobile optimisations page says that skybox should be rendered after opaque geometry for best performance:
http://docs.unity3d.com/Documentation/Manual/MobileOptimisation.html

which makes sense as z culling will ignore not visible pixels.
It might makes sense to render skybox first if it is uses some simple shader just to clear buffers, but for more complex shaders definitely not.
Also the first page says that alpha tested objects are sorted back to front automatically, but the second one says they should be sorted front to back for best performance.
Are these differences between mobile and desktop and should I make my own sorting, not relying on tags, in order to get best performance?
(I’m trying to use OpenGLES 2.0 to display quite a few alpha tested objects)

If you do nothing - alpha-test will be treated as opaque.
If you put it into “alpha-test” render queue [“Queue”=“AlphaTest”], then they will be sorted like opaque, BUT separately, to be after them (read: like in optimization doc).

EDIT: misread first, extra info

Hi Alexey,
Thanks for reply. First page says:

,but it should also say that AlphaTest is sorted the same way as geometry, right?

well, in unity lingo it is RenderQueue that determine if the object is opaque/transparent/whatever. So, as long as you have objects with shaders that are properly marked with queue - it will be all good 8)

well, alpha tests falls inside geometry queue (at the very end of it)

Thanks, it makes more sense now.
What about skyboxes and far background geometry, should they be marked as geometry or background?

at least for skybox i would push it to be after all opaque geometry. smth like TRANSPARENT-1
*sure with zwrite off and clearing with depth only :wink:
but yeah - try this out - i’m not quite THAT proficient in unity rendering order handling :wink:

Thanks :smile:

How can one do this currently, either through the inspector or maybe with a custom shader through shader graph?