【问题标题】:Vuforia (Unity created Xcode project) shows blank screen after adding to existing Xcode appVuforia(Unity 创建的 Xcode 项目)添加到现有 Xcode 应用程序后显示空白屏幕
【发布时间】:2019-03-01 23:00:23
【问题描述】:

我通过this tutorial 将 Xcode Unity AR(带有 Vuforia)项目添加到现有 Xcode 应用程序中。我的问题很少,但我都解决了,我的项目现在正在真实设备中构建和运行。应用程序像以前一样工作,但是当我尝试从菜单中选择 AR 项目时,我的 Unity AR 控制器被推送。我得到黑屏(白屏)。这些是控制台日志中的几行(我认为与问题有关):

User pre-granted access to the camera
[6669:1320892] INFO/AR(6669) 2018-09-27 10:08:15: Vuforia selected rendering API OpenGL ES 2.x
[6669:1320892] INFO/AR(6669) 2018-09-27 10:08:15: Vuforia SDK version 7.2.23
[6669:1320892] INFO/AR(6669) 2018-09-27 10:08:15: Vuforia Fusion: Detected and enabled use of ARKit
[6669:1320892] Rendering mode set to: OpenGL ES 2.0
[6669:1320892] Rendering mode set to: OpenGL ES 2.0
[6669:1320892] DEBUG/AR(6669) Could not find a UIView with CAEAGLLayer or CAMetalLayer layer class that responds to selector renderFrameVuforia
[6669:1320892] DEBUG/AR(6669) UIView has CAEAGLLayer layer class
[6669:1320892] DEBUG/AR(6669) UIView does not respond to selector renderFrameVuforia
[6669:1320892] DEBUG/AR(6669) UIView has CAEAGLLayer layer class
[6669:1320892] DEBUG/AR(6669) UIView does not respond to selector renderFrameVuforia
[6669:1320892] DEBUG/AR(6669) Could not find a UIView with CAEAGLLayer or CAMetalLayer layer class that responds to selector renderFrameVuforia
Vuforia initialization successful
...
[6669:1320892] ERROR/AR(6669) 2018-09-27 10:08:16: Cannot setMode to AR before Camera is initialized
Dataset ARBoxes could not be loaded and cannot be activated.
...
cameraDeviceStartCamera
[6669:1320892] INFO/AR(6669) 2018-09-27 10:08:16: Starting camera with profile for iPhone10,4, 720.1
[6669:1320892] ERROR/AR(6669) 2018-09-27 10:08:16: VideoBackgroundConfig with screen size of zero received, skipping config step

有关版本的更多信息:

  • Xcode 10
  • iPhone 8 (iOS 12)
  • 团结 2018.2.9
  • Vuforia 7.2.23

我尝试根据我发现的许多论坛帖子更改许多设置,但没有任何帮助。我没有使用 Metal(我使用的是 OpenGLES3,我也尝试过 OpenGLES2)。

感谢您的帮助

【问题讨论】:

  • 当您使用 Unity 显示控制器时,您的 Unity 场景是否显示?可能您的问题不在于 Vuforia,而在于将 Unity 集成到本机应用程序中?您可以在 Unity 中添加简单场景并检查您的交互是否有效(您的简单场景是否可以在本机应用程序中显示)

标签: unity3d augmented-reality arkit vuforia xcode10


【解决方案1】:

问题在于 Unity 中的图形 API。最新 Xcode 版本不支持 Metal 并将 Metal 替换为 OpenGLES2 或 OpenGLES3。

【讨论】:

    【解决方案2】:

    ARKit 是一个最新的框架,它被设计为广泛使用Metal/SceneKit 渲染,而不是OpenGL ES。将ARSCNViewOpenGL ES 2.x 渲染混合在一起似乎非常非常糟糕。

    切换到金属。

    另外,将 Vuforia Engine 更新到新的 7.5 版本。黑屏问题必须解决。并使用 Xcode 10 (10A255) 的官方版本,而不是 beta。

    附:你用的是什么 iPhone?您正在写您使用 iPhone 8,但控制台显示:Starting camera with profile for iPhone10,4, 720.1

    【讨论】:

    • 我更新了 Unity 和 Vuforia,并将图形 API 重新设置为 Metal。问题是,使用 Metal 时,我在使用 Unity AR:UnityGfxDeviceWorker (38): EXC_BAD_ACCESS 打开视图控制器时出现此错误,当我在论坛中发现我应该删除 Metal 并使用 OpenGL ES 之前尝试修复它时。
    • 你能把你的代码截图发给我吗?
    • 删除 OpenGLES2Metal。试试Auto Graphics API 打勾。您在场景中使用了多少个 MOV 文件?
    • 在我看来 Unity 有一个关于 Metal 的错误。有几个帖子,我不知道用户是否解决了问题....
    猜你喜欢
    • 1970-01-01
    • 2023-02-01
    • 2019-08-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多