Now the code compiles for Metal (If I go to “Compile and show code → Metal”)
I noticed I can set the Target Version to 8.1 in xcode.
But the shader doesn’t run on my IPad (IOS8.1.1, Xcode 6.1), they all fall back to vertex lit.
With the error:
… Pass ‘’ shader state not supported
… All passes removed
… Setting to default shader.
By default you don’t have to do anything. The default setting (“automatic” graphics API) will use Metal when on iOS8+ and capable device. On older OSes or older devices, OpenGL ES will be used.
You don’t have to do anything like that. See above - if you’re running on iOS8 and capable device, then Metal will be used under default settings.
Right there in your shader, you say “I’m for Direct3D 9 and OpenGL ES only”. Why? Stop doing that
Right now your shader will not work on D3D11, Mac/Linux, Metal, or any of the consoles.
Clarification: Metal already exists in Unity 5.0 builds (since beta 9 or so - i.e. all public preorder betas have it). If you have problems with it, report bugs!
We’re also working on backporting Metal to 4.x, since apparently many in-production games do not want to switch to a major Unity version midway, but they want Metal.