Hey guys,I got a confusing trouble when I useing GUI with StereoscopicCamera

like this img showing, that i got a testdemo using StereoscopicUniversalCamera, when i put a Gui on the view center i can got two button is right, but when i clicking the button something is weird like this img


here is the demo
StereoscopicUniversalCameraWithGui | Babylon.js Playground (babylonjs.com)

@RaananW might know if it should work ?

This seems to be be a bug in the way we calculate the clicks in a two-cameras scenario.

@msDestiny14, want to take a look at this? This will be affected by any scene with camera viewport set to anything other than full screen viewport.

BTW - I would recommend you to use XR instead of this class (though we don’t support fullscreen UI in both modes).

2 Likes

Going to first set what happens when it’s a normal camera with split viewport and see if it’s the same effect. Then work up to StereoscopicUniversalCamera.

Logging and will keep you updated as well. :slight_smile:

Picking works when a camera viewport is set:
StereoscopicUniversalCameraWithGui | Babylon.js Playground (babylonjs.com)

2 Likes

The system is correctly using the camera viewport but is not aware of the final postprocess that the camera is setting up

@RaananW: How do you deal with that in XR mode? Can we port the way to support it for the stereoscopic cameras?

1 Like

We don’t support fullscreen UI in dual-screen XR (yet), but I will look into that and make sure it does what it should.

1 Like

PR submitted - [GUI] Correct pointer events for rig cameras by RaananW · Pull Request #11563 · BabylonJS/Babylon.js (github.com)

Rig cameras are not set as the active camera until the rendering loop is running, and pointer events are broadcasted outside of the render loop. This change allows rig cameras to respond correctly to GUI pointer events in full screen. One step closer in supporting full screen UI in XR (now just need the projection layer).

5 Likes

thanks for your help soooooo much

1 Like