CesiumGS / cesium-unreal

Bringing the 3D geospatial ecosystem to Unreal Engine
https://cesium.com/platform/cesium-for-unreal/
Apache License 2.0
885 stars 286 forks source link

All terrain tiles render black when running natively on Quest headsets #1391

Closed AmrAbuElyazid closed 2 months ago

AmrAbuElyazid commented 3 months ago

Description: When running a project natively on Meta Quest 3, all terrain tiles render black. However, the project renders correctly on PC. John uploaded the sample project, and I, as the reporter, am also facing the same issue. I've tried rebuilding the project from scratch multiple times to isolate potential settings causing this issue, but no luck.

Sample project: CesiumQuest (uses the Meta XR plugin)

Thanks to @john-terrell for uploading the sample project

Steps to reproduce: Clone the provided sample project from the GitHub repository. Build and deploy the project to a Meta Quest 3 headset. Observe that all terrain tiles render black.

Expected behavior: Terrain tiles should render correctly on Meta Quest 3, similar to their rendering on PC.

Additional information: This issue occurs consistently on Meta Quest 3. The project utilizes the Meta XR plugin.

Any insights or suggestions on resolving this issue would be appreciated.

image

j9liu commented 3 months ago

Hi @AmrAbuElyazid, thank you for opening this issue.

You mentioned "rebuilding the project from scratch multiple times to isolate potential settings causing this issue". Can you describe what you've tried in more detail? It can help us narrow down the issue when we try to troubleshoot this.

AmrAbuElyazid commented 3 months ago

Hi @j9liu

Thanks for getting back to me.

I've isolated the issue to Cesium's terrain by creating empty projects with Unreal's VR and blank templates, building and deploying with and without Cesium to Meta Quest 3. The issue appears once Cesium is included in the project.

Here's what I've experimented with so far:

Despite these efforts, the terrain tiles continue to render black only on the Meta Quest 3, while the project works as expected on PC. I hope these details help in narrowing down the potential cause of this issue.

Looking forward to any suggestions or insights you might have.

Thank you.

azrogers commented 3 months ago

Just to update you on where things are at @AmrAbuElyazid - while we don't yet have a Quest 3 around the office to test with, I was able to replicate your issue using the provided project on the Quest 2. I'm digging into it now, and I'll keep this issue updated with my findings!

AmrAbuElyazid commented 3 months ago

@azrogers Thanks a lot, looking forward to hearing your inputs!

azrogers commented 3 months ago

I've tracked the issue down to the KHR_texture_transform changes in Cesium for Unreal 2.4.0. Particularly the way normal textures are transformed. I still haven't figured out why this breaks on Quest specifically, but I can at least offer a workaround for the time being - under CesiumForUnreal/Content/Materials/Layers open ML_CesiumGltf.asset. Scroll over to the section where the normal texture coordinates are transformed: image And change the graph to ignore the transformation node: image This, of course, disables KHR_texture_transform support for normal maps, so it's not a permanent solution, but it should help you get unblocked while we continue to investigate.

AmrAbuElyazid commented 3 months ago

@azrogers Thanks a lot for prompt response! I've tried your suggestion but it seems to be the same on my meta quest 3. I've tried it in both the sample project I linked and in my main project that I am working on, but to no avail, the terrain is still black.

com oculus shellenv-20240414-183909

azrogers commented 2 months ago

As it turns out, this seems to have been the same issue that #1225 was addressing for iOS devices - that is, for some reason, 1x1 textures on mobile just get sampled incorrectly. I've merged #1225 which just upscales our default textures to 4x4 instead of 1x1, which fixes the issue on my end. Please give the latest version of main a try and let me know if it works for you too! @AmrAbuElyazid

AmrAbuElyazid commented 2 months ago

@azrogers That fixed it! Thanks a lot for your support!