-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Description
Is your feature request related to a problem? Please describe.
The best illustration of the problem is if you want to do the following:
- create an XRProjectionLayer with some 3D environment
- create a XRQuadLayer with some media (photo / video)
- create an XRProjectionLayer for controllers / hands / cursors to always be the last thing rendered (top)
Currently there is no way to define the elements from a scene that should be included in projLayer1 and also define the other elements that should be on projLayer2.
Describe the solution you'd like
Ideally you'd be able to do something like:
session.updateRenderState({ layers: [projLayer1, mediaLayer, projLayer2] });
Potentially, projLayer1 and projLayer2 could each be defined by an instance of a new class called XRProjectionLayerGroup that extends THREE.Group. The WebXRManager could check the scene children for instances of XRProjectionLayerGroup to create multiple projection layers.
The current implementation of xr layers seems to only allow the creation of a single projection layer from a single threejs scene / renderer. As you can see here the projection layer is session.renderState.layers[ 0 ] which is set by the WebXRManager. For someone to create a second projection layer from a group of elements within the same scene, I believe they'd have to implement their own version of WebXRManager and they'd also have to figure out how to render the two groups of elements separately.