NewsCrawler.org

Porting a Meta Quest project to Unreal Engine 5.8 to use Unreal MCP

UE 5.8のMCPを使いたくて、Meta Quest向けプロジェクトを移植してみた
Image: zenn.dev

The author migrated a Meta Quest game in development from Unreal Engine 5.4 to 5.8 mainly to use Unreal MCP[1], a feature that lets AI agents call Unreal Editor functions such as placing actors, setting up lighting and creating material instances; the MCP server runs inside the editor and the AI connects to it locally. No UE 5.8-ready Meta XR plugin was available at the time, so the old plugin was replaced with Meta XR SDK205 and patched for 5.8: FCustomPresent::Present was matched to the new engine signature, calls to the old Vulkan API RHISetImageLayout were removed behind version checks, and OnBackBufferReadyToPresent was added in the OVRPlugin[2] layer to attach CustomPresent to viewports that meet the conditions, with delegate registration at startup and removal at shutdown. The work ran on Windows 10 with Unreal Engine 5.8.0, a Meta Quest 3, Visual Studio Community 2022, Android NDK 27.2.12479018 (r27c) and Android/ASTC packages using Vulkan. On the project side the XR setting was switched to XrApi=NativeOpenXR, Meta XR was enabled in the .uproject file, and the unused AndroidFileServer was disabled.

The build installed on the Quest 3, but the app first stalled on the Unreal Engine logo, and once it ran the headset showed the real world through passthrough[3] while the game displayed only a white stick, even though the map was loaded, its assets existed, the camera was inside the field and the meshes were not set to hidden. Adding the mobile transparency setting r.Mobile.PropagateAlpha=1 did not help, but toggling settings on the device showed the display changed with r.MSAACount: with r.MSAACount=4 the field and menus were missing, with r.MSAACount=1 they appeared. The final configuration therefore sets r.Mobile.PropagateAlpha=1 together with r.MSAACount=1, which puts MSAA[4] in an effectively disabled state; this is a workaround that reduces edge smoothness rather than a fix of MSAA rendering.

A separate on-device warning, "Lighting needs to be rebuilt (18 unbuilt objects)", was handled on its own: the DumpUnbuiltLightInteractions command, run over ADB on a Development build, pointed to a DirectionalLight and 18 meshes, and after rebuilding the map's lighting and regenerating the Android data the unbuilt count on the device reached 0. For the team, the patched plugin is shared as a ZIP while configuration files, the .uproject, maps and lighting data go through Git with PC-specific simulator paths excluded; the old plugin is backed up before replacement, and new work is done on a branch off the 5.8 branch because Blueprints and maps do not merge like text files. Since the MSAA display problem is only worked around, the author does not consider the port fully complete and plans to follow the official Meta XR plugin support status and try development with MCP next.

Read the original zenn.dev

Sources

  • Zenn JA

    UE 5.8のMCPを使いたくて、Meta Quest向けプロジェクトを移植してみた

    5 likes3 bookmarks0 comments

Published: First seen: Читать по-русски

Open as a page