In XR with a refraction texture and multiview enabled, the scene only renders scene.clearColor

Hi folks,

I’m noticing a bug on Quest 3 that reproduces in v8.24.1 onwards. In this playground, I’ve created a minimal scenario where the scene does not render correctly with multiview enabled in WebXR: https://playground.babylonjs.com/#9K3MRA#2001. The issue seems to result from the use of a refractionTexture on a PBRMaterial.

With multiview disabled, I see the ground plane as expected:

However, with multiview enabled, I don’t see anything other than the background:

When adding more objects or a skybox to the scene, I still only see the purple background color.

I also tried manually disabling the extension oculus multiview extension in favor of the default multiview extension, and the visuals render in the left eye, but not the right eye.

Thanks for any help!

1 Like

cc @docEdub

I will investigate this next week.

1 Like

I haven’t gotten to the bottom of this, yet, but I found setting the projectionLayerInit: { clearOnAccess: false } option works around the issue on my Quest 3.

https://playground.babylonjs.com/#9K3MRA#2009

Does that work for you?

That fixes the playground for me as well! Let me try to upgrade my app to the latest Babylon and see if that resolves the issue. Thanks!

Unfortunately, the issue still persists in my application with that parameter set to false. I’ll try to make a new playground that replicates my error more closely and see if that helps debug!

Ok, I’m still investigating, too. I got Spector.js working in headset, now, so hopefully I’ll be able to figure it out soon.

I’ve also been able to replicate it in a playground with clearOnAccess: false set in the projectionLayerInit: https://playground.babylonjs.com/#9K3MRA#2052

Ya, same here. There was a mistake in the PG I posted that commented out the refraction texture.

I’ve been investigating the issue this week and it looks like the view projection uniforms are not being set correctly for RTTs when multiview is enabled. I’m currently exploring options for a fix.

2 Likes

I have a pretty good idea on how to fix this. I just need to carve out some time to implement and test it. Hopefully later this week.

1 Like

Hey Andrew! This bug is blocking us from upgrading BabylonJS to get bug fixes, which is blocking us from publishing a release that includes those other fixes to users. Do you have an ETA?

Ya, this is still on my radar. What version of BabylonJS are you on now that you’re upgrading from?

I’m looking into this further but RenderDoc is not working on my Quest 3 anymore, so it’s slow going.

It would be helpful to know which old version of Babylon.js you have multiview working on with a refraction texture. I have not seen any version of Babylon.js working with multiview and refraction, yet, but it sounds like you have this working in an old version. Which version is it?

8.24 was the last version where these features worked together (in our testing) on Quest 2, Quest 3, Snap Spectacles (snapOS 2.0) and Samsung Galaxy XR

Ok, thanks. I think I found the commit that causes the issue, but I don’t know if it’s a regression or not, yet, because the given repro doesn’t work in my Quest 3 for version 8.24.0.

Can you confirm the playground provided to repro this issue works for you with version 8.24.0 by going to the following link in headset and entering immersive mode?

https://playground.babylonjs.com/?version=8.24.0#9K3MRA#2001

Try this PR: Fix WebXR multiview regression by docEdub · Pull Request #17385 · BabylonJS/Babylon.js · GitHub and let me know if it fixes the multiview issue you’re seeing.