# OQ2 webGL/webXR layers basic usage

**URL:** <https://discourse.threejs.org/t/oq2-webgl-webxr-layers-basic-usage/27698>\
**Category:** Questions\
**Tags:** webxr\
**Created:** [July 1, 2021, 10:33am UTC](https://discourse.threejs.org/t/oq2-webgl-webxr-layers-basic-usage/27698 "2021-07-01T10:33:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![eviltik](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/eviltik/32/18513_2.png) [@eviltik](https://discourse.threejs.org/u/eviltik)\
**Post date:** [July 1, 2021, 10:33am UTC](https://discourse.threejs.org/t/oq2-webgl-webxr-layers-basic-usage/27698/1 "2021-07-01T10:33:34Z")

</div>

Now we have WebXR Layers support. Thank you ! Dixit Oculus doc, textures are more accurates, this is cool ! I’m looking around a webXR code structure/organization (focused on the OQ2)

Imagine a multiplayer FPS game (mouse+keyboard support AND OQ2), a la pavlovvr ++.

Does it make sens to “think layers”, like this ? Perhaps i’m missing something and we can not use layers like that ?

- layer 0: scene meshes
- layer 1: reserved (rendering)
- layer 2: reserved (rendering)
- layer 3: weapon & controllers (may be 2 different layers)
- layer 4: contextual objects (menus, bullets fast animation, may be 2 different layers)
- layer 5: raytracer + bvh ?

Does the code should have a kind of layer manager to handle switches in layers if needed, depending of the session (XR or keyboard+mouse - no layers ) ? technicaly possible ? overkill ?

Does it make sens to tend to try to use webworkers “by layers” ? with webworkers contraints, of course.

Any kind of feedback appreciated 😉

---

<div class="post-metadata">

**Author:** ![eviltik](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/eviltik/32/18513_2.png) [@eviltik](https://discourse.threejs.org/u/eviltik)\
**Post date:** [July 1, 2021, 10:39am UTC](https://discourse.threejs.org/t/oq2-webgl-webxr-layers-basic-usage/27698/2 "2021-07-01T10:39:31Z")

</div>

Does it make sens to use blender custom attributes to store layer number which are exported into a gltf file and setting it when traversing childs scene ?

---

<div class="post-metadata">

**Author:** ![eviltik](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/eviltik/32/18513_2.png) [@eviltik](https://discourse.threejs.org/u/eviltik)\
**Post date:** [July 1, 2021, 10:52am UTC](https://discourse.threejs.org/t/oq2-webgl-webxr-layers-basic-usage/27698/3 "2021-07-01T10:52:55Z")

</div>

Does webgl layers has something to do with webxr layers ?

I missed something.

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [July 1, 2021, 1:46pm UTC](https://discourse.threejs.org/t/oq2-webgl-webxr-layers-basic-usage/27698/4 "2021-07-01T13:46:14Z")

</div>

> [@eviltik](#):
>
> Does webgl layers has something to do with webxr layers ?

[Object3D.layers](https://threejs.org/docs/index.html?q=object#api/en/core/Object3D.layers) is unrelated to WebXR. Or do you mean a different layers property?

---

<div class="post-metadata">

**Author:** ![capnmidnight](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/capnmidnight/32/20463_2.png) [@capnmidnight](https://discourse.threejs.org/u/capnmidnight)\
**Post date:** [August 26, 2021, 9:22pm UTC](https://discourse.threejs.org/t/oq2-webgl-webxr-layers-basic-usage/27698/5 "2021-08-26T21:22:22Z")

</div>

WebXR Layers would be in reference to this: [WebXR - Layers Samples](https://immersive-web.github.io/webxr-samples/layers-samples/)
