Start a new topic

Unity iOS with OpenGLES3?

I downloaded the Wikitude_Unity_8-7-0_8-7-0_2019_08_13_03_15_42 Wikitude_Unity_8-7-0_8-7-0_2019_08_13_03_15_42 sample project. I successfully built and ran this version for iOS using Unity 2019.2.11f1 and Xcode 11.2, with Mac OS X 10.14.6 Mojave. I am building to Apple devices that are running some flavor of iOS 13 typically,


I tried switching the Graphics API from Metal to OpenGLES3. However, when building the example projects, I get a linking error - 


Undefined symbols for architecture arm64:

  "_OBJC_CLASS_$_MTLRenderPassDescriptor", referenced from:

      objc-class-ref in libUnityiOSBridge.a(libUnityiOSBridge.a-arm64-master.o)

ld: symbol(s) not found for architecture arm64


 Is it possible to use OpenGLES3 with Wikitude on iOS?


For my Wikitude project I would like to build it for OpenGLES3 rather than Metal, as my shaders do not work properly when built to Metal. When I build my own project to IOS and OpenGLES, I do not get the linking error above, and all the interactions work as expected. However, I find that the camera view when built to OpenGLES3 appears as a solid light grey color (the camera view is not displayed) and I receive a repeated OpenGL error each frame:


Failed to create framebuffer. OpenGL error 0x0000 occured


If it is the 8.7 version of Wikitude that is causing the incompatibility with OpenGLES3, I will contact you about upgrading or purchasing a new license. Thanks.


Hi,


Great to hear that you managed to find a workaround for compiling Metal shaders. We're still investigating the OpenGL ES issue and will hopefully release a fix with the next update.


Best regards,

Alexandru

I wanted to let you know that I did get my shaders to compile to Metal for this project, and I will be able to use Metal. There is a bug in the current Unity shader compiler when compiling to metal (https://issuetracker.unity3d.com/issues/ios?page=1#comments) but a workaround is to use the Shader Compiler for the 2019.3.x version (still in beta). I found that this solution worked for me.

Hi Alexandru


Thanks for confirming that. I wasn't sure if it wasn't just some build setting that I was forgetting.


The shaders that we are using also compile to OpenGLES2. But when building to OpenGLES2 I find that that there is a similar issue - the camera screen is pink or magenta instead of grey.


I will work today to see if I can get my shaders to compile to Metal as a workaround.


Thanks

Hi, 


I was able to reproduce the issue with 8.7 and 8.9 as well. Unfortunately at the moment I don't see any way to work around the issue, but I'll let you know as soon as I have any news on this.


Best regards,

Alexandru

Hi


Thanks for this info. I added Metal as a dependency of the libUnityiOSBridge library. This allowed me to build the 8.7 Wikitude example projects using the OpenGLES3 rendering library.


However, now the camera view is also a light grey color in the example project. And I am also receiving the same OpenGL error each frame -


Failed to create framebuffer. OpenGL error 0x0000 occured


 I have attached a screen grab to show the grey camera, in case this helps.

File.jpg
(67.2 KB)

Hi, 


When setting the OpenGLES 3 rendering API in Unity, the Metal framework is no longer included in the Xcode project, causing our library, which still needs to link to Metal objects, to fail with a linking error. Simply add the framework back and it should work again. You can either do this in Xcode, or in Unity by setting a dependency to Metal for one of our libraries. This should work in version 8.7 as well.


As for the second issue, I'm not sure if the framebuffer error happens because of Wikitude, or if it's a separate issue entirely. Could you expand on that point?


Thank you,

Alexandru

Login or Signup to post a comment