问题描述: 在 UE5.4 中开启 Quest 2/3 的穿透功能(passthrough)以实现 AR 模式
解决方案: 以官方的 Virtual Reality 模板为例,介绍一下如何开启 Quest 2/3 在虚幻引擎(UE5.4)中的透视功能
Step 1. 开启插件中的 MetaXR 功能,重启引擎
Step 2. 前往编辑 (edit) > 项目设置 (project settings) > 渲染 (Rendering),更改 Enable alpha channel support in post processing 的选项为 Allow through tonemapper,再一次重启
Step 3. 前往编辑 (edit) > 项目设置 (project settings) > MetaXR,按下图进行勾选
Step 4. 找到模板中的 VRPawn 蓝图,在左侧 component 中添加 OculusXRPassthroughLayer 到 Camera 下,随后在蓝图中添加 Passthrough Subsystem 并设置 Shape 类型为 Reconsturcted Passthrough Layer,同时图层设置为 underlay
Step 5. 回到关卡中,设置天空球(SkySphere)属性为 Hidden in Game
Step 6. 在头显中运行,即可看到周围环境
参考链接:
[1] How To Set Up MetaXR Passthrough on UE5
[2] Setting Up Meta XR Passthrough For AR in Unreal Engine
[3] 开启 Passthrough | META Horizon OS Developers