Search Unity

Unity 4.6.3: Metal rendering support and update of IL2CPP for iOS

, 二月 19, 2015

Today we shipped the public release of Unity 4.6.3. You can get it on our download pageWith this release, we’re bringing iOS Metal rendering support to Unity 4.x. Unity 4.6.3 is the first Unity 4.x public version supporting both critical features in the iOS world: iOS 64 bit via IL2CPP and Metal rendering. Unity 4.6.3 also brings critical updates to IL2CPP for iOS 64 bit.

What is Metal rendering ?

It is a new low-level rendering API developed by Apple for iOS 8 and further. It focuses on doing less in GPU drivers, so the CPU overhead while making Metal calls is minimal. This way, games can consume less CPU time and can do more fancy stuff in the remaining freed up time.

Here’s a short description from Apple:

“Metal provides the lowest-overhead access to the GPU, enabling you to maximize the graphics and compute potential of your iOS 8 app. With a streamlined API, precompiled shaders, and support for efficient multi-threading, Metal can take your game or graphics app to the next level of performance and capability.”

For more information, please consult the official Apple Metal rendering developer site.

How to enable Metal rendering ?

To bring Metal support, Unity takes care of most of the things that happen behind the scenes. Metal will be used by default on capable devices. If you want more control, you can find Graphics API selector in Player Settings; with values like Automatic, Metal, OpenGL ES 3.0, OpenGL ES 2.0:

If you want to detect whether you’re running on Metal at runtime, do something like if (SystemInfo.graphicsDeviceVersion.StartsWith(“Metal”)).

We worked really hard to make Metal usage as seamless as possible, but please report issues if you run into them!

Update of IL2CPP on iOS-64 bit

Unity 4.6.3 is a critical update to IL2CPP on iOS-64 bit:

  • Fifty fixes were made for various bugs and crashes. We are very grateful for your feedback which enabled us to move and iterate fast.

  • Missing support of .NET classes was added for ThreadPool, Asynchronous Sockets, WebRequest.

  • Added support for async delegates (BeginInvoke/EndInvoke).

We are committed to fixing and improving IL2CPP support for iOS-64 bit in further Unity 4.6.x patches and public releases as well as in Unity 5, so if you have any issues, do not hesitate to report those and ping us on the forums.

Other goodies

Unity 4.6.3 release is not limited only to Metal rendering or IL2CPP on iOS. It has number of fixes and improvements to Android, iOS, 2D, animation, shaders, UI and others. For a full list of changes, please consult the release notes.

42 replies on “Unity 4.6.3: Metal rendering support and update of IL2CPP for iOS”

I found this article on 20 spot in google search results, you should lower your bounce rate. You will see results fast, i know what can help you, just type in google for: Dasusuri’s Bounce Plugin

Please allow us to disable metal for automatic mode.
So we can switch between ES2/3 and ignore metal.

My app does not need to be bleeding edge, but ES2/3 seem fairly stable so far.

Perhaps a better option would be checkboxes, rather than the dropdown, allowing developers to specify the chain of fallbacks manually.

Still does not support EndInvoke!

Error : NullReferenceException: A null value was found where an object instance was required.
at DragGameOption+GetOptionResultHandle.EndInvoke (IAsyncResult result) [0x00000] in :0

Please fix this bug ASAP!

I don’t know why 4.6.3 changed the launch screen for all iPhones to a 320×480 size image and just scaled it to adapt all iPhones. That’s quite a lazy and worst way. Imagine that, the user got a iPhone 6 plus and open our app, it turns out he sees a 320×480 pixels launch image. We are supposed to offer a high resolution launch image to give end users a good impression. But 4.6.3 screwed it up.
Hi guys, is it a just temporary solution or you are going to insist it in the future?
Come on, seriously!

just quote the comments in the code from SplashScreen.mm. Jumped high when I saw it

// Launch screen uses the same aspect-filled image for all iPhones. So,
// we need a special case if there's a launch screen and iOS is configured
// to use it.
// Note that we don't use launch screens for iPads since there's no way
// to use different layouts depending on orientation.
if (m_XibView == nil)
{
m_XibView = [[[[NSBundle mainBundle] loadNibNamed:@"LaunchScreen" owner:nil options:nil] objectAtIndex:0] retain];
[self addSubview:m_XibView];
}

OK. The solution is replace the LaunchScreenImage-Portrait.png with a desired png. That’s a good walkaround.
BTW. How to delete my post?

Hi,

Have you set up the iPhone 6+ splash images? Unity uses them for the default launch screen and fall backs to the shared mobile splash only if they are not set up. Note, that you can always disable the launch screen and revert to the old behavior, but unfortunately in that case the app won’t be featured by Apple.

I don’t know why 4.6.3 changed the launch screen for all iPhones to a 320×480 size image and just scaled it to adapt all iPhones. That’s quite a lazy and worst way. Imagine that, the user got a iPhone 6 plus and open our app, it turns out he sees a 320×480 pixels launch image. We are supposed to offer a high resolution launch image to give end users a good impression. But 4.6.3 screwed it up.
Hi guys, is it a just temporary solution or you are going to insist it in the future?
Come on, seriously!

just quote the comments in the code from SplashScreen.mm. Jump high when I saw it

// Launch screen uses the same aspect-filled image for all iPhones. So,
// we need a special case if there's a launch screen and iOS is configured
// to use it.
// Note that we don't use launch screens for iPads since there's no way
// to use different layouts depending on orientation.
if (m_XibView == nil)
{
m_XibView = [[[[NSBundle mainBundle] loadNibNamed:@"LaunchScreen" owner:nil options:nil] objectAtIndex:0] retain];
[self addSubview:m_XibView];
}

Hi!
I’m experiencing big CPU-spikes (20-25ms), every other frame, on an iPad Air 1 when building with Metal enabled. When running with GLES 3.0 it works fine. Bug report is filed.

Another issue i am experiencing with IOS 8.1.3 is that the Input.location is not working, it will not finish the LocationServiceStatus.Initializing state.

4.6.3. Screen Corruption in the editor view. Occurs in all projects. Nasty visual artifacts and even the meshes turns green. Will report.

Please implement .net code for System.Globalization.CultureInfo class.
for example : something like lack of createspecificculture function code.
as of mono 2.x. it works well, but Il2cpp missing alot of .net code. please fix thanks.

Testing 4.6.3 with a 2D game I’m developing, there is a noticeable drop in frame rate when using Metal on my iPad Air, whereas forcing OpenGL ES 3.0 (or 2.0) results in the original (better) frame rate.

At first I thought this may have been related to IL2CPP, but I made sure I was testing in Release mode and the issue remains the same.

Any known issues?

First thing I’d try: make sure to disable “metal API validation” in Xcode scheme settings (it’s on by default I think). Validation catches more possible errors, but has quite a high overhead on the CPU.

If it’s not that… file a bug with a repro please.

Thanks for your suggestion Aras.

Unfortunately this didn’t work for me. Additionally, I tried many other settings/configurations and issue persists.

I have logged a bug with a sample project, with the necessary steps, to reproduce and demonstrate the issue.

Even after 4.6.3p1 we still see regular, short framerate drops when using metal – game plays smoothly for a few secs and then shortly framerate drops in a very noticable way. We do not see this when using OpenGL ES.

I have several problems with the Unity Free 4.6.3 version:
– link errors when compiling in ARM64 (was OK with 4.6.2p1)
– splash screen error

Trying to go back to 4.6.2p1

Me too – same as before.

The workaround is just : delete LaunchScreen.xib , LaunchScreenImage-Portrait.png and LauncScreenImage-Landscape.png .
In info.plist delete the key UILaunchStoryboardName~Iphone.

thanks, Alexander! I’m also getting the splash screen bug, free unity on iOS

Unfortunately, this fix didn’t work for me. I removed LaunchScreen.xib & LaunchScreenImage-Portrait.png, but I could not find LauncScreenImage-Landscape.png

Also, when I edited the info.plist, I made it unreadable. I was trying just to remove the key, and then that whole section, but I don’t know enough about that language to understand. I also tried deleting the info.plist.

Alexander, I realize now you meant “LaunchScreenImage-Landscape.png” – found that and deleted it also. I still get the splash screen error, probably because i don’t know what i’m doing in the info.plist file

sorry for the multiple posts. I’m an idiot…

this worked for me. i deleted the “key” in Xcode easily

thanks, Alexander!

I am also experiencing issues with the splashScreen. Ive tried all i can find, including the mentioned above.

Environment:

Iphone5 IOS 8.1.3
Xcode 6.1.1
Unity3D 4.6.3 (free)

I tried downgrading, but then i run into SDK compatibility issues.

It seems this is an issue every time there is a major update. What do i do, i basically can’t do anything anymore. Do we just wait until this is fixed by the Unity team? If so, when will a fix be expected?

I’m guessing that if i have Metal selected, the player will fall back to OpenGLES if the device doesn’t support it.

If you have “just Metal” selected, then it will require Metal. Use Automatic to have Metal->GLES3->GLES2 fallback chain. (or alternatively for the brave, find the selection code in the trampoline and modify to do whatever you wish)

Comments are closed.