files/en-us/web/api/xrcubelayer/index.md
{{securecontext_header}}{{APIRef("WebXR Device API")}}{{SeeCompatTable}}
The XRCubeLayer interface of the WebXR Device API is a layer that renders directly from a cubemap and projects it onto the inside faces of a cube.
XRCubeLayer requires the layers feature to be enabled for the {{domxref("XRSession")}}. You can request it in {{domxref("XRSystem.requestSession()")}}.
To create a new XRCubeLayer, call {{domxref("XRWebGLBinding.createCubeLayer()")}}.
To present layers to the XR device, add them to the layers render state using {{domxref("XRSession.updateRenderState()")}}.
{{InheritanceDiagram}}
Inherits properties from its parent, {{domxref("XRCompositionLayer")}}.
space property.Inherits methods from its parents, {{domxref("XRCompositionLayer")}} and {{domxref("EventTarget")}}.
XRCubeLayer object when the underlying resources of the layer are lost or when the XR Compositor can no longer reproject the layer. If this event is sent, authors should redraw the content of the layer in the next XR animation frame.{{Specifications}}
{{Compat}}